jinyus / lite_ref

A lightweight dependency injection library for Dart and Flutter.
11 stars 3 forks source link

feat: rebuild widget if using ChangeNotifier #17

Closed yousefak007 closed 7 months ago

yousefak007 commented 7 months ago

are you planning to add this feature?

This is an alternative to Provider for classes that don't rebuild widgets

I think this library is better than Provider because it does more with less code

so it will be nice if this behaves like Provider when using of and it can use the listen property to determine to register it or use it once

and if the ref is Change Notifier it rebuilds the widget

jinyus commented 7 months ago

I thought about it but that would increase the scope of this package.

That would basically turn this into a state management solution when it was originally intended for use with my other package state_beacon, which is my take on state management using signals.

I will keep this open but I'm not making any commitments. I am open the PRs if you're interested in implementing it.

yousefak007 commented 7 months ago

I think I can't add it at the moment, so it would be wonderful and nice if you had the time and desire to add it. I would be very grateful to you. I want to replace the Riverpod library in my current project with this library, but time prevents me from searching and adding these features to this one. Tight time

yousefak007 commented 7 months ago

could this be solved shortly? 😢

jinyus commented 7 months ago

Not by me, I don't have the time to sink into it. I suggest you use Provider if that's absolutely necessary. Or try state_beacon Controllers as a replacement for ChangeNotifier.