|
|
@@ -1,6 +1,6 @@
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
-
|
|
|
+import 'package:city_pickers/city_pickers.dart';
|
|
|
|
|
|
class SendExpressPage extends StatefulWidget {
|
|
|
final Widget child;
|
|
|
@@ -13,44 +13,44 @@ class SendExpressPage extends StatefulWidget {
|
|
|
_SendExpressPageState createState() => _SendExpressPageState();
|
|
|
}
|
|
|
|
|
|
-class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeepAliveClientMixin{
|
|
|
+class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeepAliveClientMixin {
|
|
|
|
|
|
@override
|
|
|
bool get wantKeepAlive => true;
|
|
|
|
|
|
final Map < Object,
|
|
|
- String > sendInfo = {
|
|
|
- "icon": 'lib/images/icon_send.png',
|
|
|
- "title": "发件信息",
|
|
|
- "phone": "010-8788 6890",
|
|
|
- "code": "345678",
|
|
|
- "name": "朝阳门大阳汽贸",
|
|
|
- "address": "北京市朝阳区",
|
|
|
- "addressDetail": "朝阳门外大街28号"
|
|
|
- };
|
|
|
+ String > sendInfo = {
|
|
|
+ "icon": 'lib/images/icon_send.png',
|
|
|
+ "title": "发件信息",
|
|
|
+ "phone": "010-8788 6890",
|
|
|
+ "code": "345678",
|
|
|
+ "name": "朝阳门大阳汽贸",
|
|
|
+ "address": "",
|
|
|
+ "addressDetail": "朝阳门外大街28号"
|
|
|
+ };
|
|
|
|
|
|
final Map < Object,
|
|
|
- String > getInfo = {
|
|
|
- "icon": 'lib/images/icon_shoujian.png',
|
|
|
- "title": "收件信息",
|
|
|
- "name": "香河汽修厂",
|
|
|
- "phone": "010-6734 3426",
|
|
|
- "address": "河北省廊坊市",
|
|
|
- "addressDetail": "香河县东大街29号院18栋3单元206"
|
|
|
- };
|
|
|
+ String > getInfo = {
|
|
|
+ "icon": 'lib/images/icon_shoujian.png',
|
|
|
+ "title": "收件信息",
|
|
|
+ "name": "香河汽修厂",
|
|
|
+ "phone": "010-6734 3426",
|
|
|
+ "address": "",
|
|
|
+ "addressDetail": "香河县东大街29号院18栋3单元206"
|
|
|
+ };
|
|
|
|
|
|
Map < String,
|
|
|
- String > _itemInfo = {
|
|
|
- "icon": "lib/images/icon_huowu.png",
|
|
|
- "title": "货物信息",
|
|
|
- "itemName": "汽车轮胎",
|
|
|
- "itemNo": "4",
|
|
|
- "expressPrice": "15",
|
|
|
- "collectionPrice": "15800",
|
|
|
- "supportPrice": "5000",
|
|
|
- "weight": "600",
|
|
|
- "itemDesc": "轮胎请核对数量轮胎请"
|
|
|
- };
|
|
|
+ String > _itemInfo = {
|
|
|
+ "icon": "lib/images/icon_huowu.png",
|
|
|
+ "title": "货物信息",
|
|
|
+ "itemName": "汽车轮胎",
|
|
|
+ "itemNo": "4",
|
|
|
+ "expressPrice": "15",
|
|
|
+ "collectionPrice": "15800",
|
|
|
+ "supportPrice": "5000",
|
|
|
+ "weight": "600",
|
|
|
+ "itemDesc": "轮胎请核对数量轮胎请"
|
|
|
+ };
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
return Container(
|
|
|
@@ -73,7 +73,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
padding: EdgeInsets.fromLTRB(0, ScreenUtil.getInstance().setHeight(20), 0, ScreenUtil.getInstance().setHeight(20)),
|
|
|
child: ListView(
|
|
|
children: < Widget > [
|
|
|
- _sendInfo(sendInfo),
|
|
|
+ _sendInfo(sendInfo,context),
|
|
|
_getInfo(getInfo),
|
|
|
_itemInfoWidget(_itemInfo),
|
|
|
_submitBtn()
|
|
|
@@ -85,7 +85,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- Widget _sendInfo(Map str) {
|
|
|
+ Widget _sendInfo(Map str,BuildContext context) {
|
|
|
return Container(
|
|
|
color: Colors.white,
|
|
|
margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
|
|
|
@@ -96,14 +96,14 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
_contentWiget('电话', str['phone']),
|
|
|
_contentWiget('企业编码', str['code']),
|
|
|
_contentWiget('企业名称', str['name']),
|
|
|
- _contentWiget('城市/区域', str['address']),
|
|
|
+ _cityWiget('城市/区域', str['address'],context),
|
|
|
_lastContentWiget('详细地址', str['addressDetail'])
|
|
|
],
|
|
|
)
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- Widget _getInfo(Map str) {
|
|
|
+ Widget _getInfo(Map str) {
|
|
|
return Container(
|
|
|
color: Colors.white,
|
|
|
margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
|
|
|
@@ -113,14 +113,14 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
_underLine(),
|
|
|
_contentWiget('企业名称', str['name']),
|
|
|
_contentWiget('电话', str['phone']),
|
|
|
- _contentWiget('城市/区域', str['address']),
|
|
|
+ _cityWiget('城市/区域', str['address'],context),
|
|
|
_lastContentWiget('详细地址', str['addressDetail'])
|
|
|
],
|
|
|
)
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- Widget _itemInfoWidget(Map _itemInfo){
|
|
|
+ Widget _itemInfoWidget(Map _itemInfo) {
|
|
|
return Container(
|
|
|
child: Container(
|
|
|
color: Colors.white,
|
|
|
@@ -194,7 +194,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
//Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
|
|
|
SizedBox(
|
|
|
width: ScreenUtil.getInstance().setWidth(500),
|
|
|
- child:TextField(
|
|
|
+ child: TextField(
|
|
|
keyboardType: TextInputType.number,
|
|
|
textAlign: TextAlign.end,
|
|
|
decoration: InputDecoration(
|
|
|
@@ -202,8 +202,8 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
-
|
|
|
- Icon(Icons.keyboard_arrow_right,color:Color.fromRGBO(199,199,204,1) ,)
|
|
|
+
|
|
|
+ Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
|
|
|
],
|
|
|
)
|
|
|
)
|
|
|
@@ -220,47 +220,100 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ Widget _cityWiget(String key, String value,BuildContext context) {
|
|
|
+ return
|
|
|
+ GestureDetector(
|
|
|
+ child: Padding(
|
|
|
+ padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
|
+ child: Column(
|
|
|
+ children: < Widget > [
|
|
|
+ SizedBox(
|
|
|
+ height: ScreenUtil.getInstance().setHeight(89),
|
|
|
+ child: Center(
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: < Widget > [
|
|
|
+ Expanded(
|
|
|
+ flex: 0,
|
|
|
+ child: Text('${key}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.end,
|
|
|
+ children: < Widget > [
|
|
|
+ //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
|
|
|
+ SizedBox(
|
|
|
+ width: ScreenUtil.getInstance().setWidth(500),
|
|
|
+ child: Text(value,textAlign: TextAlign.end,overflow: TextOverflow.ellipsis,)
|
|
|
+ ),
|
|
|
+ Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ flex: 0,
|
|
|
+ child: _underLine()
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ ),
|
|
|
+ onTap: (){
|
|
|
+ getCity(context).then((resp){
|
|
|
+ setState(() {
|
|
|
+ this.sendInfo['address'] = resp.provinceName+' '+resp.cityName+' '+' '+resp.areaName;
|
|
|
+ });
|
|
|
+ //print(value);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
Widget _lastContentWiget(String key, String value) {
|
|
|
return Padding(
|
|
|
padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
|
child: SizedBox(
|
|
|
- height: ScreenUtil.getInstance().setHeight(89),
|
|
|
- child: Center(
|
|
|
- child: Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
- children: < Widget > [
|
|
|
- Expanded(
|
|
|
- flex: 0,
|
|
|
- child: Text('${key}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
|
|
|
- ),
|
|
|
- Expanded(
|
|
|
- child: Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.end,
|
|
|
- children: < Widget > [
|
|
|
- //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
|
|
|
- SizedBox(
|
|
|
- width: ScreenUtil.getInstance().setWidth(500),
|
|
|
- child:TextField(
|
|
|
- keyboardType: TextInputType.number,
|
|
|
- textAlign: TextAlign.end,
|
|
|
- decoration: InputDecoration(
|
|
|
- border: InputBorder.none
|
|
|
- ),
|
|
|
- ),
|
|
|
+ height: ScreenUtil.getInstance().setHeight(89),
|
|
|
+ child: Center(
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: < Widget > [
|
|
|
+ Expanded(
|
|
|
+ flex: 0,
|
|
|
+ child: Text('${key}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.end,
|
|
|
+ children: < Widget > [
|
|
|
+ //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
|
|
|
+ SizedBox(
|
|
|
+ width: ScreenUtil.getInstance().setWidth(500),
|
|
|
+ child: TextField(
|
|
|
+ keyboardType: TextInputType.number,
|
|
|
+ textAlign: TextAlign.end,
|
|
|
+ decoration: InputDecoration(
|
|
|
+ border: InputBorder.none
|
|
|
),
|
|
|
-
|
|
|
- Icon(Icons.keyboard_arrow_right,color:Color.fromRGBO(199,199,204,1) ,)
|
|
|
- ],
|
|
|
- )
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- )
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+
|
|
|
+ Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
)
|
|
|
+ )
|
|
|
);
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
Widget _descWidget(String str) {
|
|
|
return
|
|
|
Container(
|
|
|
@@ -294,4 +347,11 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
},
|
|
|
);
|
|
|
}
|
|
|
-}
|
|
|
+ Future getCity(context) async {
|
|
|
+ Result result = await CityPickers.showCityPicker(
|
|
|
+ context: context,
|
|
|
+ );
|
|
|
+ return result;
|
|
|
+}
|
|
|
+}
|
|
|
+
|