Problem:
Flutter refresh my screen while some value change in my model or in my data.How to achieve that.
Solution:
In your widget add the below code.
Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (_) => model,
child: Scaffold(body: Consumer<ViewModel>(
builder: (context, viewModel, child) {
In your viewmodel after change the data call this
notifyListeners();
Comments
Post a Comment