send_express_page.dart 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. import 'package:city_pickers/city_pickers.dart';
  4. import 'package:flutter_picker/flutter_picker.dart';
  5. class SendExpressPage extends StatefulWidget {
  6. final Widget child;
  7. SendExpressPage({
  8. Key key,
  9. this.child
  10. }): super(key: key);
  11. _SendExpressPageState createState() => _SendExpressPageState();
  12. }
  13. class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeepAliveClientMixin {
  14. ScrollController _scrollController = ScrollController();
  15. //组件自用字段-----------------------------
  16. GlobalKey _sendPhoneKey = GlobalKey();
  17. GlobalKey _getPhoneKey = GlobalKey();
  18. double tipWidth = 0;
  19. double tipHeight = 0;
  20. double tipPosX = 0;
  21. double tipPosY = 0;
  22. bool tipStatus = true;
  23. //请求字段-------------------------
  24. int sendCompanyId; //寄件公司Id
  25. String sendCompanyName; //寄件公司名称 不能为空
  26. String sendCompanyPhone; //寄件公司电话 不能为空
  27. String sendCompanyCode; //寄件公司编码 不能为空
  28. String sendCompanyProvinceName; //寄件公司省名称 不能为空
  29. String sendCompanyProvinceCode; //寄件公司省编码 不能为空
  30. String sendCompanyCityName; //寄件公司市名称 不能为空
  31. String sendCompanyCityCode; //寄件公司市编码 不能为空
  32. String sendCompanyAreaName; //寄件公司区名称 不能为空
  33. String sendCompanyAreaCode; //寄件公司区编码 不能为空
  34. String sendCompanyAddress; //寄件公司详细地址,不能为空
  35. int receiptCompanyId; //收件公司id
  36. String receiptCompanyPhone; //收件公司电话 不能为空
  37. String receiptCompanyName; //收件公司名称 不能为空
  38. String receiptCompanyProvinceName; //收件公司省名称 不能为空
  39. String receiptCompanyProvinceCode; //收件公司省编码 不能为空
  40. String receiptCompanyCityName; //收件公司市名称 不能为空
  41. String receiptCompanyCityCode; //收件公市编码 不能为空
  42. String receiptCompanyAreaName; //收件公区名称 不能为空
  43. String receiptCompanyAreaCode; //收件公司区编码 不能为空
  44. String receiptCompanyAddress; //收件公司地址详情 不能为空
  45. String goods; //商品名称不能为空
  46. int goodsQuantity; //商品数量 不能为空
  47. int goodsPackingId; //商品包装ID
  48. int goodsCategoryId; //商品包装类别ID
  49. int goodsPaymentMethod; //付款方式
  50. double goodsWeight; //商品重量
  51. double goodsPriceProtection; //商品保价
  52. double goodsAgencyFund; //商品代收款
  53. String memo; //备注
  54. String sendPCA = ' ';//Text组件内容必须有空格,否则报null
  55. String getPCA = ' ';
  56. @override
  57. void initState() {
  58. super.initState();
  59. _scrollController.addListener(() {
  60. if (!tipStatus) {
  61. setState(() {
  62. tipStatus = true;
  63. });
  64. }
  65. print('滚动了');
  66. if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {}
  67. });
  68. }
  69. @override
  70. bool get wantKeepAlive => true;
  71. @override
  72. Widget build(BuildContext context) {
  73. return Container(
  74. child: Scaffold(
  75. appBar: AppBar(
  76. title: Text('发件', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(36)), ),
  77. centerTitle: true,
  78. backgroundColor: Color.fromRGBO(64, 98, 254, 1),
  79. ),
  80. body:
  81. Stack(
  82. children: < Widget > [
  83. Container(
  84. color: Color.fromRGBO(246, 246, 254, 1),
  85. padding: EdgeInsets.fromLTRB(0, ScreenUtil.getInstance().setHeight(20), 0, ScreenUtil.getInstance().setHeight(20)),
  86. child: ListView(
  87. controller: _scrollController,
  88. children: < Widget > [
  89. _sendInfo(context),
  90. _getInfo(context),
  91. _itemInfoWidget(),
  92. _submitBtn()
  93. ],
  94. ),
  95. ),
  96. Positioned(
  97. top: tipPosY,
  98. left: tipPosX,
  99. child: Offstage(
  100. offstage: tipStatus,
  101. child: Container(
  102. width: tipWidth,
  103. height: ScreenUtil.getInstance().setHeight(450),
  104. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  105. decoration: BoxDecoration(
  106. color: Color.fromRGBO(244, 248, 251, 1),
  107. ),
  108. child: ListView(
  109. children: < Widget > [
  110. _tipItem(),
  111. _tipItem(),
  112. ],
  113. ),
  114. ),
  115. )
  116. )
  117. ],
  118. ),
  119. resizeToAvoidBottomPadding: false //键盘弹出,页面不跟随向上滑动,防止出现溢出错误
  120. ),
  121. );
  122. }
  123. Widget _sendInfo(BuildContext context) {
  124. return Container(
  125. color: Colors.white,
  126. margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
  127. child: Column(
  128. children: < Widget > [
  129. _titleWidget('lib/images/icon_send.png', '发件信息'),
  130. _underLine(),
  131. _inputWiget('电话', 'sendPhone'),
  132. _contentWiget('企业编码', 'send', true),
  133. _contentWiget('企业名称', 'send', true),
  134. _cityWiget('城市/区域', context, 'send'),
  135. _lastContentWiget('详细地址', 'send')
  136. ],
  137. )
  138. );
  139. }
  140. Widget _getInfo(BuildContext context) {
  141. return Container(
  142. color: Colors.white,
  143. margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
  144. child: Column(
  145. children: < Widget > [
  146. _titleWidget('lib/images/icon_shoujian.png', '收件信息'),
  147. _underLine(),
  148. _inputWiget('电话', 'getPhone'),
  149. //_contentWiget('企业编码', 'get', true),
  150. _contentWiget('企业名称', 'get', true),
  151. _cityWiget('城市/区域', context, 'get'),
  152. _lastContentWiget('详细地址', 'get')
  153. ],
  154. )
  155. );
  156. }
  157. Widget _itemInfoWidget() {
  158. return Container(
  159. child: Container(
  160. color: Colors.white,
  161. child: Column(
  162. crossAxisAlignment: CrossAxisAlignment.start,
  163. children: < Widget > [
  164. _titleWidget('lib/images/icon_huowu.png', "货物信息"),
  165. _underLine(),
  166. _contentWiget("货物名称", 'goods', true),
  167. _contentWiget("数量", 'goods'),
  168. _contentWiget("运费", 'goods'),
  169. _contentWiget("代收", 'goods'),
  170. _contentWiget("保价", 'goods'),
  171. _contentWiget("重量", 'goods'),
  172. _packageType(),
  173. _descWidget()
  174. ],
  175. ),
  176. )
  177. );
  178. }
  179. Widget _titleWidget(String iconUrl, String str) {
  180. return Container(
  181. height: ScreenUtil.getInstance().setHeight(90),
  182. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  183. child: Center(
  184. child: Row(
  185. mainAxisAlignment: MainAxisAlignment.start,
  186. children: < Widget > [
  187. Padding(
  188. padding: EdgeInsets.only(right: ScreenUtil.getInstance().setHeight(20)),
  189. child: Image.asset(
  190. iconUrl,
  191. width: ScreenUtil.getInstance().setWidth(40),
  192. height: ScreenUtil.getInstance().setHeight(40),
  193. )
  194. ),
  195. Text(str, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(32)), )
  196. ],
  197. ),
  198. ),
  199. );
  200. }
  201. Widget _underLine() {
  202. return Container(
  203. color: Color.fromRGBO(223, 223, 223, 1),
  204. height: ScreenUtil.getInstance().setHeight(1),
  205. );
  206. }
  207. Widget _inputWiget(String key, String tab) {
  208. return Padding(
  209. key: tab == 'sendPhone' ? _sendPhoneKey : _getPhoneKey,
  210. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  211. child: Column(
  212. children: < Widget > [
  213. SizedBox(
  214. height: ScreenUtil.getInstance().setHeight(89),
  215. child: Center(
  216. child: Row(
  217. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  218. children: < Widget > [
  219. Expanded(
  220. flex: 0,
  221. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  222. ),
  223. Expanded(
  224. child: Row(
  225. mainAxisAlignment: MainAxisAlignment.end,
  226. children: < Widget > [
  227. //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
  228. SizedBox(
  229. width: ScreenUtil.getInstance().setWidth(500),
  230. child: TextField(
  231. keyboardType: TextInputType.number,
  232. textAlign: TextAlign.end,
  233. decoration: InputDecoration(
  234. border: InputBorder.none
  235. ),
  236. onChanged: ((value) {
  237. if (tab == 'sendPhone') {
  238. if (value.length >= 4) {
  239. RenderObject sendPhoneObj = _sendPhoneKey.currentContext.findRenderObject();
  240. setState(() {
  241. tipWidth = sendPhoneObj.paintBounds.size.width;
  242. tipHeight = sendPhoneObj.paintBounds.size.height;
  243. tipPosX = sendPhoneObj.getTransformTo(null).getTranslation().x;
  244. tipPosY = sendPhoneObj.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
  245. tipStatus = false;
  246. });
  247. } else {
  248. setState(() {
  249. tipStatus = true;
  250. });
  251. }
  252. // print(tipWidth);
  253. // print(tipHeight);
  254. // print(tipPosX);
  255. // print(tipPosY);
  256. } else if (tab == 'getPhone') {
  257. if (value.length >= 4) {
  258. RenderObject sendPhoneObj = _getPhoneKey.currentContext.findRenderObject();
  259. setState(() {
  260. tipWidth = sendPhoneObj.paintBounds.size.width;
  261. tipHeight = sendPhoneObj.paintBounds.size.height;
  262. tipPosX = sendPhoneObj.getTransformTo(null).getTranslation().x;
  263. tipPosY = sendPhoneObj.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
  264. tipStatus = false;
  265. });
  266. } else {
  267. setState(() {
  268. tipStatus = true;
  269. });
  270. }
  271. // print(tipWidth);
  272. // print(tipHeight);
  273. // print(tipPosX);
  274. // print(tipPosY);
  275. }
  276. }),
  277. onEditingComplete: () {
  278. setState(() {
  279. FocusScope.of(context).requestFocus(FocusNode());
  280. tipStatus = true;
  281. });
  282. },
  283. ),
  284. ),
  285. Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  286. ],
  287. )
  288. )
  289. ],
  290. ),
  291. )
  292. ),
  293. Expanded(
  294. flex: 0,
  295. child: _underLine()
  296. )
  297. ],
  298. )
  299. );
  300. }
  301. Widget _contentWiget(String key, String type, [bool keyboardType = false]) { //false是数字键盘
  302. return Padding(
  303. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  304. child: Column(
  305. children: < Widget > [
  306. SizedBox(
  307. height: ScreenUtil.getInstance().setHeight(89),
  308. child: Center(
  309. child: Row(
  310. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  311. children: < Widget > [
  312. Expanded(
  313. flex: 0,
  314. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  315. ),
  316. Expanded(
  317. child: Row(
  318. mainAxisAlignment: MainAxisAlignment.end,
  319. children: < Widget > [
  320. SizedBox(
  321. width: ScreenUtil.getInstance().setWidth(500),
  322. child: TextField(
  323. keyboardType: keyboardType ? TextInputType.text : TextInputType.number,
  324. textAlign: TextAlign.end,
  325. decoration: InputDecoration(
  326. border: InputBorder.none
  327. ),
  328. onChanged: (value) {
  329. if (type == 'send') {
  330. if (key == '企业编码') {
  331. setState(() {
  332. sendCompanyCode = value;
  333. });
  334. } else if (key == '企业名称') {
  335. setState(() {
  336. sendCompanyName = value;
  337. });
  338. }
  339. } else if (type == 'get') {
  340. if (key == '企业编码') {
  341. setState(() {
  342. sendCompanyCode = value;
  343. });
  344. } else if (key == '企业名称') {
  345. setState(() {
  346. receiptCompanyName = value;
  347. });
  348. }
  349. } else {
  350. if (key == '货物名称') {
  351. goods = value;
  352. } else if (key == '数量') {
  353. goodsQuantity = int.parse(value);
  354. } else if (key == '运费') {
  355. } else if (key == '代收') {
  356. goodsAgencyFund = double.parse(value);
  357. } else if (key == '保价') {
  358. goodsPriceProtection = double.parse(value);
  359. } else if (key == '重量') {
  360. goodsWeight = double.parse(value);
  361. }
  362. }
  363. },
  364. ),
  365. ),
  366. Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  367. ],
  368. )
  369. )
  370. ],
  371. ),
  372. )
  373. ),
  374. Expanded(
  375. flex: 0,
  376. child: _underLine()
  377. )
  378. ],
  379. )
  380. );
  381. }
  382. Widget _cityWiget(String key, BuildContext context, String type) {
  383. return
  384. GestureDetector(
  385. child: Padding(
  386. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  387. child: Column(
  388. children: < Widget > [
  389. SizedBox(
  390. height: ScreenUtil.getInstance().setHeight(89),
  391. child: Center(
  392. child: Row(
  393. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  394. children: < Widget > [
  395. Expanded(
  396. flex: 0,
  397. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  398. ),
  399. Expanded(
  400. child: Row(
  401. mainAxisAlignment: MainAxisAlignment.end,
  402. children: < Widget > [
  403. //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
  404. SizedBox(
  405. width: ScreenUtil.getInstance().setWidth(500),
  406. child: Text(type == 'send' ? sendPCA : getPCA, textAlign: TextAlign.end, overflow: TextOverflow.ellipsis, )
  407. ),
  408. Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  409. ],
  410. )
  411. )
  412. ],
  413. ),
  414. )
  415. ),
  416. Expanded(
  417. flex: 0,
  418. child: _underLine()
  419. )
  420. ],
  421. )
  422. ),
  423. onTap: () {
  424. getCity(context).then((resp) {
  425. if (resp == null) {
  426. return;
  427. }
  428. print(resp.toString());
  429. setState(() {
  430. if (type == 'send') {
  431. sendPCA = resp.provinceName + ' ' + resp.cityName + ' ' + ' ' + resp.areaName;
  432. sendCompanyProvinceName = resp.provinceName;
  433. sendCompanyProvinceCode = resp.provinceId;
  434. sendCompanyCityName = resp.cityName;
  435. sendCompanyCityCode = resp.cityId;
  436. sendCompanyAreaName = resp.areaName;
  437. sendCompanyAreaCode = resp.areaId;
  438. } else {
  439. getPCA = resp.provinceName + ' ' + resp.cityName + ' ' + ' ' + resp.areaName;
  440. receiptCompanyProvinceName = resp.provinceName;
  441. receiptCompanyProvinceCode = resp.provinceId;
  442. receiptCompanyCityName = resp.cityName;
  443. receiptCompanyCityCode = resp.cityId;
  444. receiptCompanyAreaName = resp.areaName;
  445. receiptCompanyAreaCode = resp.areaId;
  446. }
  447. });
  448. //print(value);
  449. });
  450. },
  451. );
  452. }
  453. Widget _lastContentWiget(String key, String type) {
  454. return Padding(
  455. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  456. child: SizedBox(
  457. height: ScreenUtil.getInstance().setHeight(89),
  458. child: Center(
  459. child: Row(
  460. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  461. children: < Widget > [
  462. Expanded(
  463. flex: 0,
  464. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  465. ),
  466. Expanded(
  467. child: Row(
  468. mainAxisAlignment: MainAxisAlignment.end,
  469. children: < Widget > [
  470. //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
  471. SizedBox(
  472. width: ScreenUtil.getInstance().setWidth(500),
  473. child: TextField(
  474. //keyboardType: TextInputType.number,
  475. textAlign: TextAlign.end,
  476. decoration: InputDecoration(
  477. border: InputBorder.none
  478. ),
  479. onChanged: (value) {
  480. if (type == 'send') {
  481. setState(() {
  482. sendCompanyAddress = value;
  483. });
  484. } else {
  485. setState(() {
  486. receiptCompanyAddress = value;
  487. });
  488. }
  489. },
  490. ),
  491. ),
  492. Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  493. ],
  494. )
  495. )
  496. ],
  497. ),
  498. )
  499. )
  500. );
  501. }
  502. Widget _descWidget() {
  503. return
  504. Container(
  505. padding: EdgeInsets.all(ScreenUtil.getInstance().setWidth(30)),
  506. //child: Text(str, maxLines: 100, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  507. child: TextField(
  508. maxLines: 3,
  509. decoration: InputDecoration(
  510. border: InputBorder.none,
  511. hintText: "请输入备注内容"
  512. ),
  513. onChanged: (value) {
  514. setState(() {
  515. memo = value;
  516. });
  517. },
  518. ),
  519. );
  520. }
  521. Widget _submitBtn() {
  522. return GestureDetector(
  523. child: Container(
  524. margin: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(50), ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(40)),
  525. height: ScreenUtil.getInstance().setHeight(88),
  526. decoration: BoxDecoration(
  527. borderRadius: BorderRadius.all(Radius.circular(4)),
  528. color: Color.fromRGBO(37, 102, 242, 1),
  529. ),
  530. child: Center(
  531. child: Text("提交", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(32), color: Colors.white), ),
  532. ),
  533. ),
  534. onTap: () {
  535. print('提交');
  536. },
  537. );
  538. }
  539. Future getCity(context) async {
  540. Result result = await CityPickers.showCityPicker(
  541. context: context,
  542. );
  543. return result;
  544. }
  545. Widget _tipItem() {
  546. return Container(
  547. child: Column(
  548. children: < Widget > [
  549. Container(
  550. height: ScreenUtil.getInstance().setHeight(89),
  551. child: Center(
  552. child: Row(
  553. mainAxisAlignment: MainAxisAlignment.start,
  554. children: < Widget > [
  555. Padding(
  556. padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(50)),
  557. child: Text("15901462275", style: TextStyle(
  558. fontSize: ScreenUtil.getInstance().setSp(28),
  559. color: Color.fromRGBO(74, 74, 74, 1)
  560. ), )
  561. ),
  562. SizedBox(
  563. width: ScreenUtil.getInstance().setWidth(185),
  564. child: Text('WX11042',
  565. textAlign: TextAlign.left,
  566. style: TextStyle(
  567. fontSize: ScreenUtil.getInstance().setSp(28),
  568. color: Color.fromRGBO(155, 155, 155, 1)
  569. ), ),
  570. ),
  571. Text('天华盛业',
  572. textAlign: TextAlign.left,
  573. overflow: TextOverflow.ellipsis,
  574. style: TextStyle(
  575. fontSize: ScreenUtil.getInstance().setSp(28),
  576. color: Color.fromRGBO(155, 155, 155, 1)
  577. ),
  578. )
  579. ],
  580. ),
  581. ),
  582. ),
  583. _underLine()
  584. ],
  585. ),
  586. );
  587. }
  588. Widget _packageType() {
  589. return Padding(
  590. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  591. child: Column(
  592. children: < Widget > [
  593. InkWell(
  594. child: SizedBox(
  595. height: ScreenUtil.getInstance().setHeight(89),
  596. child: Center(
  597. child: Row(
  598. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  599. children: < Widget > [
  600. Expanded(
  601. flex: 0,
  602. child: Text('包装类型', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  603. ),
  604. Expanded(
  605. child: Row(
  606. mainAxisAlignment: MainAxisAlignment.end,
  607. children: < Widget > [
  608. //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
  609. SizedBox(
  610. width: ScreenUtil.getInstance().setWidth(500),
  611. child: Text('纸箱', textAlign: TextAlign.end, )
  612. ),
  613. Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  614. ],
  615. )
  616. )
  617. ],
  618. ),
  619. )
  620. ),
  621. onTap: () {
  622. showPickerModal(context);
  623. },
  624. ),
  625. Expanded(
  626. flex: 0,
  627. child: _underLine()
  628. )
  629. ],
  630. )
  631. );
  632. }
  633. showPickerModal(BuildContext context) {
  634. new Picker(
  635. adapter: PickerDataAdapter < String > (pickerdata: ['纸箱', '木箱']),
  636. height: ScreenUtil.getInstance().setHeight(450),
  637. confirmText: '确定',
  638. confirmTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(64, 98, 254, 1)),
  639. cancelText: '取消',
  640. cancelTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(153, 153, 153, 1)),
  641. headercolor: Color.fromRGBO(245, 245, 245, 1),
  642. itemExtent: ScreenUtil.getInstance().setHeight(80),
  643. textStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(42, 42, 42, 1)),
  644. changeToFirst: true,
  645. hideHeader: false,
  646. onConfirm: (Picker picker, List value) {
  647. // setState(() {
  648. // _siteName = stationObj.data[value[0]].name;
  649. // });
  650. // setKey('stationId', stationObj.data[value[0]].id.toString());
  651. }
  652. ).showModal(this.context); //_scaffoldKey.currentState);
  653. }
  654. }