Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Doesn't respond to observable value changes #20

Closed
ScottWallace opened this issue Jul 5, 2022 · 2 comments
Closed

[Bug] Doesn't respond to observable value changes #20

ScottWallace opened this issue Jul 5, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@ScottWallace
Copy link

The DashChat widget doesn't reflect changes to observable values in a GetXController. In my instance, I'm using a settings controller to set MessageOptions.currentUserContainerColor and MessageOptions.currentUserTextColor. When I toggle between light and dark mode, other elements wrapped by an Obx(() => on the same page respond to this value change, but the DashChat doesn't.

   body: Obx(
          () => DashChat(
            messageOptions: MessageOptions(
                showCurrentUserAvatar: true,
                currentUserContainerColor:
                    _settingsController.currentListTheme.value.offsetColor,
                currentUserTextColor:
                    _settingsController.currentListTheme.value.textColor),
            currentUser: user,
            onSend: (ChatMessage m) {
              setState(() {
                messages.insert(0, m);
              });
            },
            messages: messages,
          ),
        ), 

Steps to reproduce the behavior:

  1. Put DashChat on a widget page within a scaffold,
  2. Create a GetxController, and observable values for colors and apply them to DashChat,
  3. Make the controller's color values respond to light/dark mode changes,
  4. Toggle between light and dark mode,
  5. Notice that the colors do not change.

Expected behavior

It is expected that DashChat will respond to observable value changes.

Environment

  • OS: macOS 12.4
  • Device: iOS Simulator
  • Language Version: Channel stable, 3.0.4
  • Software/library Version: DashChat ^0.0.10

Additional context

Great product, just need this.

@ScottWallace ScottWallace added the bug Something isn't working label Jul 5, 2022
@SebastienBtr
Copy link
Owner

Hey, I never used GetX (and don't want to but that's another debate aha), not sure why it wouldn't work. If you can provide a project for me to test and debug I'll take a look

@ScottWallace
Copy link
Author

Thanks, I would provide a project, but I've had to move on to a more fully developed package. I'll check in on yours later to check your progress - I prefer this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants