📜  ChangeNotifierProxyProvider 颤动 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:22.902000             🧑  作者: Mango

代码示例1
ChangeNotifierProxyProvider(
  create: (_) => MyChangeNotifier(),
  update: (_, myModel, myNotifier) => myNotifier
    ..update(myModel),
  child: ...
);
//A typical implementation of such MyChangeNotifier could be:
class MyChangeNotifier with ChangeNotifier {
  void update(MyModel myModel) {
    // Do some custom work based on myModel that may call `notifyListeners`
  }
}