diff --git a/lib/pages/vehicles_on_the_property/vehicle_history_screen.dart b/lib/pages/vehicles_on_the_property/vehicle_history_screen.dart index 379a3c02..1e90cc84 100644 --- a/lib/pages/vehicles_on_the_property/vehicle_history_screen.dart +++ b/lib/pages/vehicles_on_the_property/vehicle_history_screen.dart @@ -14,7 +14,7 @@ class _VehicleHistoryScreenState extends State int count = 0; final PagingController _pagingController = PagingController(firstPageKey: 1); - bool isSnackble = true; + bool _isSnackble = true; @override void initState() { @@ -36,7 +36,7 @@ class _VehicleHistoryScreenState extends State onDataUnavailable: (vehicles) { setState(() {}); final bool isFirst = pageKey == 2; - if (!isFirst && isSnackble) showNoMoreDataSnackBar(context); + if (!isFirst && _isSnackble) showNoMoreDataSnackBar(context); _pagingController.appendLastPage(vehicles); }, @@ -220,10 +220,10 @@ class _VehicleHistoryScreenState extends State ) // .then((response) async { if (response == true) { - isSnackble = false; + _isSnackble = false; _pagingController.refresh(); } else { - isSnackble = true; + _isSnackble = true; } }) // .whenComplete(() {}); diff --git a/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart b/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart index 7d5571d1..dfaade25 100644 --- a/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart +++ b/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart @@ -117,9 +117,8 @@ class _VehiclePageState extends State } void onEditingChanged(bool value) { - setState(() { - _model.handleEditingChanged(value); - }); + if (_model.isEditing) setState(() {}); + _model.handleEditingChanged(value); } Widget _buildVehicleHistory(BuildContext context) {