I am new to Flutter and I am trying to make the UI refresh the page whenever there's an action triggered by the user, e.g. on button pressed to update this order item status. I have the following codes for my widget with ChangeNotifierProvider.
body: ChangeNotifierProvider.value(
value: Provider.of<OrderItemModel>(context, listen: false),
child: Consumer<OrderItemModel>(builder: (context, model, child) {...some widgets...}
I have a function named updateStatus().
void updateStatus(orderItem, status) {
Provider.of<OrderItemModel>(context, listen: false)
.updateOrderStatus(orderItem, status, '');
}
However, I couldn't find a way to update the UI. Please help.