jonataslaw / getx

Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
MIT License
10.27k stars 1.61k forks source link

【bug】inner GetBuilder does not trigger reactive changes and UI updates when nested inside an Obx widget #2843

Open bravekingzhang opened 1 year ago

bravekingzhang commented 1 year ago

Issue Description: When using the Get framework, there is an issue where the inner GetBuilder does not trigger reactive changes and UI updates when nested inside an Obx widget.

Steps to Reproduce:

  1. Use the Get framework in a Flutter application.
  2. Create a nested layout structure where the outer layer uses Obx and the inner layer uses GetBuilder.
  3. Bind an observed state within the inner GetBuilder and use that state to render the UI.
  4. Modify a value related to the observed state within the outer Obx.
  5. Observe whether the inner GetBuilder triggers reactive changes and updates the UI.

Expected Behavior: When modifying the value of the observed state within the outer Obx, the inner GetBuilder should trigger reactive changes and update the UI.

Actual Behavior: In the nested Obx and GetBuilder, only the outer Obx triggers reactive changes and UI updates, while the inner GetBuilder does not respond to reactive changes.

vipinkashyap commented 1 year ago

Issue Description:

When using the Get framework, there is an issue where the inner GetBuilder does not trigger reactive changes and UI updates when nested inside an Obx widget.

Steps to Reproduce:

  1. Use the Get framework in a Flutter application.

  2. Create a nested layout structure where the outer layer uses Obx and the inner layer uses GetBuilder.

  3. Bind an observed state within the inner GetBuilder and use that state to render the UI.

  4. Modify a value related to the observed state within the outer Obx.

  5. Observe whether the inner GetBuilder triggers reactive changes and updates the UI.

Expected Behavior:

When modifying the value of the observed state within the outer Obx, the inner GetBuilder should trigger reactive changes and update the UI.

Actual Behavior:

In the nested Obx and GetBuilder, only the outer Obx triggers reactive changes and UI updates, while the inner GetBuilder does not respond to reactive changes.

Have you tried using just obx to trigger inner updates as well. If you move the getbuilder logic to the controller that has obx variables . You could just be done using one controller and one obx widget

bravekingzhang commented 1 year ago

Issue Description: When using the Get framework, there is an issue where the inner GetBuilder does not trigger reactive changes and UI updates when nested inside an Obx widget. Steps to Reproduce:

  1. Use the Get framework in a Flutter application.
  2. Create a nested layout structure where the outer layer uses Obx and the inner layer uses GetBuilder.
  3. Bind an observed state within the inner GetBuilder and use that state to render the UI.
  4. Modify a value related to the observed state within the outer Obx.
  5. Observe whether the inner GetBuilder triggers reactive changes and updates the UI.

Expected Behavior: When modifying the value of the observed state within the outer Obx, the inner GetBuilder should trigger reactive changes and update the UI. Actual Behavior: In the nested Obx and GetBuilder, only the outer Obx triggers reactive changes and UI updates, while the inner GetBuilder does not respond to reactive changes.

Have you tried using just obx to trigger inner updates as well. If you move the getbuilder logic to the controller that has obx variables . You could just be done using one controller and one obx widget

Yes, it worked fine after I removed the internal getbuilder, but I think this might be a bug. Inner getbuilder wrap ui should update as well