melodysdreamj / june

MIT License
48 stars 4 forks source link

Query regarding multiple states. #7

Open rajatsingla opened 2 weeks ago

rajatsingla commented 2 weeks ago

Hi, If i want to use multiple states in a widget, how to do that? is that possible somehow?

something like:

JuneBuilder(
            () => CounterVM(),
            () => CounterVM2(),
            builder: (vm, vm2) =>  Text(
                  '${vm.count} ${vm2.count}',
            ),
)

class CounterVM extends JuneState {
  int count = 0;
}

class CounterVM2 extends JuneState {
  int count = 0;
}
CodingWill0 commented 2 weeks ago

You can simply nest a JuneBuilder inside a JuneBuilder, I don't think there's any issue with that. But would like to see an official method, it is a relevant miss in the docs.