|
|
@@ -19,17 +19,39 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
|
|
|
|
|
|
ScrollController _scrollController = ScrollController(); //初始化滚动轴监控对象
|
|
|
List listObj = [];
|
|
|
-
|
|
|
-
|
|
|
+ List lineList=[];
|
|
|
+ List<PopupMenuEntry<String>> widgets=[];
|
|
|
@override
|
|
|
void initState() {
|
|
|
- // TODO: implement initState
|
|
|
super.initState();
|
|
|
getOrderList().then((resp) {
|
|
|
setState(() {
|
|
|
listObj = resp.orderList;
|
|
|
});
|
|
|
});
|
|
|
+ getKey('stationId').then((value){
|
|
|
+ getLineFromStation(value).then((resp){
|
|
|
+ if(resp.success && resp.code==1){
|
|
|
+ setState(() {
|
|
|
+ lineList = resp.data;
|
|
|
+ });
|
|
|
+ List<PopupMenuEntry<String>> tempWidgets = [];
|
|
|
+ for(int i=0;i<lineList.length;i++){
|
|
|
+ tempWidgets.add(
|
|
|
+ PopupMenuItem<String>(
|
|
|
+ value: lineList[i].name,
|
|
|
+ child: Text(lineList[i].name,)
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }
|
|
|
+ print(lineList.length);
|
|
|
+ setState(() {
|
|
|
+ widgets =tempWidgets;
|
|
|
+ });
|
|
|
+ print(widgets.length);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
_scrollController.addListener(() {
|
|
|
if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {
|
|
|
print("滑到底部了");
|
|
|
@@ -49,7 +71,6 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
|
|
|
|
|
|
@override
|
|
|
void dispose() {
|
|
|
- // TODO: implement dispose
|
|
|
super.dispose();
|
|
|
_scrollController.dispose();
|
|
|
print('接单页listView滚动监听销毁了');
|
|
|
@@ -66,25 +87,20 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
|
|
|
backgroundColor: Color.fromRGBO(64, 98, 254, 1),
|
|
|
actions: < Widget > [
|
|
|
Container(
|
|
|
- child: PopupMenuButton < String > (
|
|
|
+ child: PopupMenuButton(
|
|
|
icon: Icon(Icons.add_circle_outline),
|
|
|
offset: Offset(0, 60),
|
|
|
padding: EdgeInsets.zero,
|
|
|
//child: IconButton(icon: Image.asset('lib/images/icon_shaixuan.png', scale: 1.8, ),onPressed: (){},),
|
|
|
- itemBuilder: (BuildContext context) => < PopupMenuEntry < String >> [
|
|
|
- PopupMenuItem < String > (
|
|
|
- child: Text("hahahahahh"),
|
|
|
- ),
|
|
|
- PopupMenuDivider(height: 1.0),
|
|
|
- PopupMenuItem < String > (
|
|
|
- child: Text("hahahahahh"),
|
|
|
- ),
|
|
|
- PopupMenuDivider(height: 1.0),
|
|
|
- PopupMenuItem < String > (
|
|
|
- child: Text("hahahahahh"),
|
|
|
- ),
|
|
|
- PopupMenuDivider(height: 1.0),
|
|
|
- ]
|
|
|
+ itemBuilder: (BuildContext context){
|
|
|
+ return widgets;
|
|
|
+ // <PopupMenuEntry<String>>[
|
|
|
+ // PopupMenuItem<String>(
|
|
|
+ // value: '1111',
|
|
|
+ // child: Text('lineList[0].name',)
|
|
|
+ // )
|
|
|
+ // ];
|
|
|
+ }
|
|
|
)
|
|
|
),
|
|
|
],
|