seState tabbar if isEditing
This commit is contained in:
parent
49154d9945
commit
fcf6af93b9
|
@ -14,7 +14,7 @@ class _VehicleHistoryScreenState extends State<VehicleHistoryScreen>
|
||||||
int count = 0;
|
int count = 0;
|
||||||
final PagingController<int, dynamic> _pagingController =
|
final PagingController<int, dynamic> _pagingController =
|
||||||
PagingController<int, dynamic>(firstPageKey: 1);
|
PagingController<int, dynamic>(firstPageKey: 1);
|
||||||
bool isSnackble = true;
|
bool _isSnackble = true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
@ -36,7 +36,7 @@ class _VehicleHistoryScreenState extends State<VehicleHistoryScreen>
|
||||||
onDataUnavailable: (vehicles) {
|
onDataUnavailable: (vehicles) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
final bool isFirst = pageKey == 2;
|
final bool isFirst = pageKey == 2;
|
||||||
if (!isFirst && isSnackble) showNoMoreDataSnackBar(context);
|
if (!isFirst && _isSnackble) showNoMoreDataSnackBar(context);
|
||||||
|
|
||||||
_pagingController.appendLastPage(vehicles);
|
_pagingController.appendLastPage(vehicles);
|
||||||
},
|
},
|
||||||
|
@ -220,10 +220,10 @@ class _VehicleHistoryScreenState extends State<VehicleHistoryScreen>
|
||||||
) //
|
) //
|
||||||
.then((response) async {
|
.then((response) async {
|
||||||
if (response == true) {
|
if (response == true) {
|
||||||
isSnackble = false;
|
_isSnackble = false;
|
||||||
_pagingController.refresh();
|
_pagingController.refresh();
|
||||||
} else {
|
} else {
|
||||||
isSnackble = true;
|
_isSnackble = true;
|
||||||
}
|
}
|
||||||
}) //
|
}) //
|
||||||
.whenComplete(() {});
|
.whenComplete(() {});
|
||||||
|
|
|
@ -117,9 +117,8 @@ class _VehiclePageState extends State<VehiclePage>
|
||||||
}
|
}
|
||||||
|
|
||||||
void onEditingChanged(bool value) {
|
void onEditingChanged(bool value) {
|
||||||
setState(() {
|
if (_model.isEditing) setState(() {});
|
||||||
_model.handleEditingChanged(value);
|
_model.handleEditingChanged(value);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildVehicleHistory(BuildContext context) {
|
Widget _buildVehicleHistory(BuildContext context) {
|
||||||
|
|
Loading…
Reference in New Issue