|
@@ -15,6 +15,36 @@ class SendExpressPage extends StatefulWidget {
|
|
|
|
|
|
|
|
class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeepAliveClientMixin {
|
|
class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeepAliveClientMixin {
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ ScrollController _scrollController = ScrollController();
|
|
|
|
|
+ GlobalKey _sendPhoneKey = GlobalKey();
|
|
|
|
|
+ GlobalKey _getPhoneKey = GlobalKey();
|
|
|
|
|
+
|
|
|
|
|
+ String _sendPhoneStr = '';
|
|
|
|
|
+ String _getPhoneStr = '';
|
|
|
|
|
+
|
|
|
|
|
+ double tipWidth = 0;
|
|
|
|
|
+ double tipHeight = 0;
|
|
|
|
|
+ double tipPosX = 0;
|
|
|
|
|
+ double tipPosY = 0;
|
|
|
|
|
+
|
|
|
|
|
+ bool tipStatus = true;
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ void initState() {
|
|
|
|
|
+ // TODO: implement initState
|
|
|
|
|
+ super.initState();
|
|
|
|
|
+ _scrollController.addListener(() {
|
|
|
|
|
+ if (!tipStatus) {
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ tipStatus = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ print('滚动了');
|
|
|
|
|
+ if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {}
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@override
|
|
@override
|
|
|
bool get wantKeepAlive => true;
|
|
bool get wantKeepAlive => true;
|
|
|
|
|
|
|
@@ -54,6 +84,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
@override
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
return Container(
|
|
return Container(
|
|
|
|
|
+
|
|
|
child: Scaffold(
|
|
child: Scaffold(
|
|
|
appBar: AppBar(
|
|
appBar: AppBar(
|
|
|
title: Text('发件', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(36)), ),
|
|
title: Text('发件', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(36)), ),
|
|
@@ -68,24 +99,61 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
// },
|
|
// },
|
|
|
// ),
|
|
// ),
|
|
|
),
|
|
),
|
|
|
- body: Container(
|
|
|
|
|
- color: Color.fromRGBO(246, 246, 254, 1),
|
|
|
|
|
- padding: EdgeInsets.fromLTRB(0, ScreenUtil.getInstance().setHeight(20), 0, ScreenUtil.getInstance().setHeight(20)),
|
|
|
|
|
- child: ListView(
|
|
|
|
|
- children: < Widget > [
|
|
|
|
|
- _sendInfo(sendInfo,context),
|
|
|
|
|
- _getInfo(getInfo),
|
|
|
|
|
- _itemInfoWidget(_itemInfo),
|
|
|
|
|
- _submitBtn()
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ body:
|
|
|
|
|
+ Stack(
|
|
|
|
|
+ children: < Widget > [
|
|
|
|
|
+ Container(
|
|
|
|
|
+ color: Color.fromRGBO(246, 246, 254, 1),
|
|
|
|
|
+ padding: EdgeInsets.fromLTRB(0, ScreenUtil.getInstance().setHeight(20), 0, ScreenUtil.getInstance().setHeight(20)),
|
|
|
|
|
+ child: ListView(
|
|
|
|
|
+ controller: _scrollController,
|
|
|
|
|
+ children: < Widget > [
|
|
|
|
|
+ _sendInfo(sendInfo, context),
|
|
|
|
|
+ _getInfo(getInfo),
|
|
|
|
|
+ _itemInfoWidget(_itemInfo),
|
|
|
|
|
+ _submitBtn()
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ Positioned(
|
|
|
|
|
+ top: tipPosY,
|
|
|
|
|
+ left: tipPosX,
|
|
|
|
|
+ child: Offstage(
|
|
|
|
|
+ offstage: tipStatus,
|
|
|
|
|
+ child: Container(
|
|
|
|
|
+ width: tipWidth,
|
|
|
|
|
+ height: ScreenUtil.getInstance().setHeight(450),
|
|
|
|
|
+ padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ color: Color.fromRGBO(244, 248, 251, 1),
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: ListView(
|
|
|
|
|
+ children: < Widget > [
|
|
|
|
|
+ _tipItem(),
|
|
|
|
|
+ _tipItem(),
|
|
|
|
|
+ _tipItem(),
|
|
|
|
|
+ _tipItem(),
|
|
|
|
|
+ _tipItem(),
|
|
|
|
|
+ _tipItem(),
|
|
|
|
|
+ _tipItem(),
|
|
|
|
|
+ _tipItem(),
|
|
|
|
|
+ _tipItem(),
|
|
|
|
|
+ _tipItem(),
|
|
|
|
|
+ _tipItem(),
|
|
|
|
|
+ _tipItem(),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ ],
|
|
|
),
|
|
),
|
|
|
resizeToAvoidBottomPadding: false //键盘弹出,页面不跟随向上滑动,防止出现溢出错误
|
|
resizeToAvoidBottomPadding: false //键盘弹出,页面不跟随向上滑动,防止出现溢出错误
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Widget _sendInfo(Map str,BuildContext context) {
|
|
|
|
|
|
|
+ Widget _sendInfo(Map str, BuildContext context) {
|
|
|
return Container(
|
|
return Container(
|
|
|
color: Colors.white,
|
|
color: Colors.white,
|
|
|
margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
|
|
margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
|
|
@@ -93,10 +161,10 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
children: < Widget > [
|
|
children: < Widget > [
|
|
|
_titleWidget(str['icon'], str['title']),
|
|
_titleWidget(str['icon'], str['title']),
|
|
|
_underLine(),
|
|
_underLine(),
|
|
|
- _contentWiget('电话', str['phone']),
|
|
|
|
|
|
|
+ _inputWiget('电话', 'sendPhone'),
|
|
|
_contentWiget('企业编码', str['code']),
|
|
_contentWiget('企业编码', str['code']),
|
|
|
_contentWiget('企业名称', str['name']),
|
|
_contentWiget('企业名称', str['name']),
|
|
|
- _cityWiget('城市/区域', str['address'],context),
|
|
|
|
|
|
|
+ _cityWiget('城市/区域', str['address'], context),
|
|
|
_lastContentWiget('详细地址', str['addressDetail'])
|
|
_lastContentWiget('详细地址', str['addressDetail'])
|
|
|
],
|
|
],
|
|
|
)
|
|
)
|
|
@@ -112,8 +180,8 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
_titleWidget(str['icon'], str['title']),
|
|
_titleWidget(str['icon'], str['title']),
|
|
|
_underLine(),
|
|
_underLine(),
|
|
|
_contentWiget('企业名称', str['name']),
|
|
_contentWiget('企业名称', str['name']),
|
|
|
- _contentWiget('电话', str['phone']),
|
|
|
|
|
- _cityWiget('城市/区域', str['address'],context),
|
|
|
|
|
|
|
+ _inputWiget('电话', 'getPhone'),
|
|
|
|
|
+ _cityWiget('城市/区域', str['address'], context),
|
|
|
_lastContentWiget('详细地址', str['addressDetail'])
|
|
_lastContentWiget('详细地址', str['addressDetail'])
|
|
|
],
|
|
],
|
|
|
)
|
|
)
|
|
@@ -142,6 +210,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
Widget _titleWidget(String iconUrl, String str) {
|
|
Widget _titleWidget(String iconUrl, String str) {
|
|
|
return Container(
|
|
return Container(
|
|
|
height: ScreenUtil.getInstance().setHeight(90),
|
|
height: ScreenUtil.getInstance().setHeight(90),
|
|
@@ -172,6 +241,93 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ Widget _inputWiget(String key, String tab) {
|
|
|
|
|
+ return Padding(
|
|
|
|
|
+ key: tab == 'sendPhone' ? _sendPhoneKey : _getPhoneKey,
|
|
|
|
|
+ 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: TextField(
|
|
|
|
|
+ keyboardType: TextInputType.number,
|
|
|
|
|
+ textAlign: TextAlign.end,
|
|
|
|
|
+ decoration: InputDecoration(
|
|
|
|
|
+ border: InputBorder.none
|
|
|
|
|
+ ),
|
|
|
|
|
+ onChanged: ((value) {
|
|
|
|
|
+ print("onchange 了");
|
|
|
|
|
+ if (tab == 'sendPhone') {
|
|
|
|
|
+ RenderObject sendPhoneObj = _sendPhoneKey.currentContext.findRenderObject();
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ tipWidth = sendPhoneObj.paintBounds.size.width;
|
|
|
|
|
+ tipHeight = sendPhoneObj.paintBounds.size.height;
|
|
|
|
|
+ tipPosX = sendPhoneObj.getTransformTo(null).getTranslation().x;
|
|
|
|
|
+ tipPosY = sendPhoneObj.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
|
|
|
|
|
+ tipStatus = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ print(tipWidth);
|
|
|
|
|
+ print(tipHeight);
|
|
|
|
|
+ print(tipPosX);
|
|
|
|
|
+ print(tipPosY);
|
|
|
|
|
+ } else if (tab == 'getPhone') {
|
|
|
|
|
+ RenderObject sendPhoneObj = _getPhoneKey.currentContext.findRenderObject();
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ tipWidth = sendPhoneObj.paintBounds.size.width;
|
|
|
|
|
+ tipHeight = sendPhoneObj.paintBounds.size.height;
|
|
|
|
|
+ tipPosX = sendPhoneObj.getTransformTo(null).getTranslation().x;
|
|
|
|
|
+ tipPosY = sendPhoneObj.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
|
|
|
|
|
+ tipStatus = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ print(tipWidth);
|
|
|
|
|
+ print(tipHeight);
|
|
|
|
|
+ print(tipPosX);
|
|
|
|
|
+ print(tipPosY);
|
|
|
|
|
+ }
|
|
|
|
|
+ }),
|
|
|
|
|
+ onEditingComplete: () {
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ FocusScope.of(context).requestFocus(FocusNode());
|
|
|
|
|
+ tipStatus = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+
|
|
|
|
|
+ Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
|
|
|
|
|
+ ],
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ )
|
|
|
|
|
+ ),
|
|
|
|
|
+ Expanded(
|
|
|
|
|
+ flex: 0,
|
|
|
|
|
+ child: _underLine()
|
|
|
|
|
+ )
|
|
|
|
|
+ ],
|
|
|
|
|
+ )
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
Widget _contentWiget(String key, String value) {
|
|
Widget _contentWiget(String key, String value) {
|
|
|
return Padding(
|
|
return Padding(
|
|
|
padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
@@ -220,7 +376,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Widget _cityWiget(String key, String value,BuildContext context) {
|
|
|
|
|
|
|
+ Widget _cityWiget(String key, String value, BuildContext context) {
|
|
|
return
|
|
return
|
|
|
GestureDetector(
|
|
GestureDetector(
|
|
|
child: Padding(
|
|
child: Padding(
|
|
@@ -244,7 +400,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
//Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
|
|
//Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
|
|
|
SizedBox(
|
|
SizedBox(
|
|
|
width: ScreenUtil.getInstance().setWidth(500),
|
|
width: ScreenUtil.getInstance().setWidth(500),
|
|
|
- child: Text(value,textAlign: TextAlign.end,overflow: TextOverflow.ellipsis,)
|
|
|
|
|
|
|
+ child: Text(value, textAlign: TextAlign.end, overflow: TextOverflow.ellipsis, )
|
|
|
),
|
|
),
|
|
|
Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
|
|
Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
|
|
|
],
|
|
],
|
|
@@ -261,10 +417,13 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
],
|
|
],
|
|
|
)
|
|
)
|
|
|
),
|
|
),
|
|
|
- onTap: (){
|
|
|
|
|
- getCity(context).then((resp){
|
|
|
|
|
|
|
+ onTap: () {
|
|
|
|
|
+ getCity(context).then((resp) {
|
|
|
|
|
+ if (resp == null) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
setState(() {
|
|
setState(() {
|
|
|
- this.sendInfo['address'] = resp.provinceName+' '+resp.cityName+' '+' '+resp.areaName;
|
|
|
|
|
|
|
+ sendInfo['address'] = resp.provinceName + ' ' + resp.cityName + ' ' + ' ' + resp.areaName;
|
|
|
});
|
|
});
|
|
|
//print(value);
|
|
//print(value);
|
|
|
});
|
|
});
|
|
@@ -312,8 +471,6 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
Widget _descWidget(String str) {
|
|
Widget _descWidget(String str) {
|
|
|
return
|
|
return
|
|
|
Container(
|
|
Container(
|
|
@@ -347,11 +504,54 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
},
|
|
},
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
- Future getCity(context) async {
|
|
|
|
|
|
|
+ Future getCity(context) async {
|
|
|
Result result = await CityPickers.showCityPicker(
|
|
Result result = await CityPickers.showCityPicker(
|
|
|
context: context,
|
|
context: context,
|
|
|
);
|
|
);
|
|
|
return result;
|
|
return result;
|
|
|
-}
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ Widget _tipItem() {
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ child: Column(
|
|
|
|
|
+ children: < Widget > [
|
|
|
|
|
+ Container(
|
|
|
|
|
+ height: ScreenUtil.getInstance().setHeight(89),
|
|
|
|
|
+ child: Center(
|
|
|
|
|
+ child: Row(
|
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
+ children: < Widget > [
|
|
|
|
|
+ Padding(
|
|
|
|
|
+ padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(50)),
|
|
|
|
|
+ child: Text("15901462275", style: TextStyle(
|
|
|
|
|
+ fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
|
|
+ color: Color.fromRGBO(74, 74, 74, 1)
|
|
|
|
|
+ ), )
|
|
|
|
|
+ ),
|
|
|
|
|
+ SizedBox(
|
|
|
|
|
+ width: ScreenUtil.getInstance().setWidth(185),
|
|
|
|
|
+ child: Text('WX11042',
|
|
|
|
|
+ textAlign: TextAlign.left,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
|
|
+ color: Color.fromRGBO(155,155,155,1)
|
|
|
|
|
+ ),),
|
|
|
|
|
+ ),
|
|
|
|
|
+ Text('天华盛业',
|
|
|
|
|
+ textAlign: TextAlign.left,
|
|
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
|
|
+ color: Color.fromRGBO(155,155,155,1)
|
|
|
|
|
+ ),
|
|
|
|
|
+ )
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ _underLine()
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+}
|