|
|
@@ -139,7 +139,6 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- super.build(context);
|
|
|
return Container(
|
|
|
child: Scaffold(
|
|
|
appBar: AppBar(
|
|
|
@@ -353,27 +352,27 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
|
|
|
orderList = [];
|
|
|
hasNextPage = false;
|
|
|
});
|
|
|
- oldLineIdStr = lineIdStr;
|
|
|
- setKey('lineIdStr', lineIdStr);
|
|
|
return;
|
|
|
}
|
|
|
lineIdStr = lineIdStr.substring(0, lineIdStr.length - 1);
|
|
|
-
|
|
|
- if (oldLineIdStr == lineIdStr) return;
|
|
|
- setState(() {
|
|
|
- orderList = [];
|
|
|
- hasNextPage = true;
|
|
|
- });
|
|
|
- getOrderList(stationId,lineIdStr, page).then((resp) {
|
|
|
- if (isNotError(context, resp) && this.mounted) {
|
|
|
- OrderListObj tempObj = OrderListObj.fromJson(resp.data);
|
|
|
- setState(() {
|
|
|
- orderList = tempObj.data.items;
|
|
|
- hasNextPage = tempObj.data.hasNextPage;
|
|
|
- });
|
|
|
- oldLineIdStr = lineIdStr;
|
|
|
- setKey('lineIdStr', lineIdStr);
|
|
|
- }
|
|
|
+ getKey('oldLineIdStr').then((oldLineIdStr){
|
|
|
+ if(oldLineIdStr == lineIdStr) return;
|
|
|
+ setKey('oldLineIdStr', lineIdStr);
|
|
|
+ setState(() {
|
|
|
+ orderList = [];
|
|
|
+ hasNextPage = true;
|
|
|
+ });
|
|
|
+ getOrderList(stationId,lineIdStr, page).then((resp) {
|
|
|
+ if (isNotError(context, resp) && this.mounted) {
|
|
|
+ OrderListObj tempObj = OrderListObj.fromJson(resp.data);
|
|
|
+ setState(() {
|
|
|
+ orderList = tempObj.data.items;
|
|
|
+ hasNextPage = tempObj.data.hasNextPage;
|
|
|
+ });
|
|
|
+ oldLineIdStr = lineIdStr;
|
|
|
+ setKey('lineIdStr', lineIdStr);
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
}
|