I want do this (not possible):
class Model1 extends ChangeNotifier {
...
final List<Item> items = [];
}
class Model2 extends ChangeNotifier {
void performOperation() {
//Access items from Model1 here
final newItems = Provider.of<Model1>(context).items,
...
}
}
It seem suggestion is use ChangeNotifierProxyProvider
But this seem very inefficient. Why I must create another layer with ChangeNotifierProxyProvider
if I am not yet use this value in UI? I just want mix Model1
and Model2
for business logic here.
Thanks for help!