jonataslaw / jonataslaw/getx

GetBuilder 、Controller tag update not change

Open
#1,908 2 comments 0 reactions 1 assignee Claimed by @jonataslaw View on GitHub
Dominant language
Dart
Stars
11.2k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

**ATTENTION: DO NOT USE THIS FIELD TO ASK SUPPORT QUESTIONS. USE THE PLATFORM CHANNELS FOR THIS. THIS SPACE IS DEDICATED ONLY FOR BUGS DESCRIPTION.**
**Fill in the template. Issues that do not respect the model will be closed.**

**Describe the bug**
A clear and concise description of what the bug is.

**Reproduction code
NOTE: THIS IS MANDATORY, IF YOUR ISSUE DOES NOT CONTAIN IT, IT WILL BE CLOSED PRELIMINARY)**

example:

```dart
//Controller
import 'package:get/get.dart';

class Page1Controller extends GetxController {
int _i1 = 0;

Page1Controller get to => Get.find();

int get geti1 => _i1;

set seti1(int value) {
_i1 = value;
update();
}
}

//page
var p1 = Get.put(
Page1Controller(),
);

var p2 = Get.put(
Page1Controller(),
tag: 'a',
permanent: false,
);

...
GetBuilder(
init: p1,
builder: (_) {
return Column(
children: [
Text(p1.geti1.toString()),
ElevatedButton(
onPressed: () {
p1.seti1 = p1.geti1 + 1;
},
child: const Text('p1')),
],
);
}),
GetBuilder(
init: p2,
builder: (_) {
return Column(
children: [
Text(p2.geti1.toString()),
ElevatedButton(
onPressed: () {
p2.seti1 = p2.geti1 + 1;
},
child: const Text('p2')),
],
);
}),

```

**Expected behavior**
clicked ElevatedButton p1
Text(p1.geti1.toString()), view changed

clicked ElevatedButton p2
Text(p2.geti1.toString()), view not changed

**Flutter Version:**
2.5.2

**Getx Version:**
get: ^4.3.8

**Describe on which device you found the bug:**
ex: Moto z2 - Android.

**Minimal reproduce code**
Provide a minimum reproduction code for the problem

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.