jonataslaw / jonataslaw/getx

Obx doesn't update ListView in GetWidget

Open
#970 12 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

**Describe the bug**
In my application I am binding controller through Get.create() function and Page where I have the controller extends with GetWidget.
Inside in this Page I have Obx with ListView builder which updates the list items.
When I use bindings with lazyPut so Obx works right but when I change binding to Get.create() function so Obx doesn't
update the ListView.

**Reproduction code
Project:
https://github.com/mjablecnik/flutter_getx_example
Bindings:
https://github.com/mjablecnik/flutter_getx_example/blob/master/lib/main.dart#L39
GetWidget:
https://github.com/mjablecnik/flutter_getx_example/blob/master/lib/pages/jottings.dart#L15

**To Reproduce**
Steps to reproduce the behavior:
1) Run in terminal:
```
git clone https://github.com/mjablecnik/flutter_getx_example.git
flutter pub get
flutter packages pub run build_runner build
```
2) Open this project in your IDE and run it in emulator
3) Click to button for add note, todo or folder
4) You can change bindings here for testing: https://github.com/mjablecnik/flutter_getx_example/blob/master/lib/main.dart#L39

**Expected behavior**
Update ListView after add items in my app:

**Video:**
https://user-images.githubusercontent.com/2686906/103431385-31c15780-4bcf-11eb-827e-e1cebe4e3bf3.mp4
(In the first build the ListView is updated but after second build not.)

**Flutter Version:**
Flutter 1.22.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7891006299 (3 weeks ago) • 2020-12-10 11:54:40 -0800
Engine • revision ae90085a84
Tools • Dart 2.10.4

**Getx Version:**
^3.24.0

**Describe on which device you found the bug:**
Nexus 6 API 28 - Android

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.