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

Hot reload not working with TripleBuilder #117

Open
phcs971 opened this issue Aug 10, 2023 · 1 comment
Open

Hot reload not working with TripleBuilder #117

phcs971 opened this issue Aug 10, 2023 · 1 comment

Comments

@phcs971
Copy link

phcs971 commented Aug 10, 2023

Describe the bug
When developing and hot reloading the app changes inside the TripleBuilder does not change (the builder function is not called) until a state change (update, setLoading, setError) happen.
I know it does not affect production code, once there is not hot reload in it, but it does make it harder to develop using TripleBuilder. ScopedBuilder works fine in hot reload.

Environment
flutter_triple: 3.0.0

To Reproduce
Run the following in dev mode, change anything inside the TripleBuilder and hot reload

class AppStore extends Store<int> {
  AppStore() : super(0);

  void increment() => update(state + 1);
}

class AppWidget extends StatefulWidget {
  const AppWidget({super.key});

  @override
  State<AppWidget> createState() => _AppWidgetState();
}

class _AppWidgetState extends State<AppWidget> {
  final store = AppStore();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: TripleBuilder(
        store: store,
        builder: (context, _) {
          return Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              // comment the first text, uncomment the second and hot reload
              Center(
                child: Text("Value: ${store.state}"),
                // child: Text("Reloaded value: ${store.state}"),
              ),
              const SizedBox(height: 12),
              ElevatedButton(
                onPressed: () => store.increment(),
                child: const Text("Increment"),
              ),
            ],
          );
        },
      ),
    );
  }
}

Expected behavior
Hot reload runs the builder function again

@GustavoFigueira
Copy link

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants