enter_store_address.dart 8.07 KB
// import 'package:flutter/material.dart';
// import 'package:flutter_screenutil/flutter_screenutil.dart';
// import 'package:one_key/provider/create_store_model.dart';
// import 'package:one_key/res/colors.dart';
// import 'package:one_key/route/navigator_util.dart';
// import 'package:one_key/utils/utils.dart';
// import 'package:one_key/widgets/round_button.dart';
// import 'package:one_key/widgets/system_app_bar.dart';
// import 'package:one_key/widgets/v_empty_view.dart';
// import 'package:permission_handler/permission_handler.dart';
// import 'package:provider/provider.dart';

// class EnterStoreAddressPage extends StatefulWidget {
//   EnterStoreAddressPageSim({Key key}) : super(key: key);

//   @override
//   _EnterStoreAddressPageState createState() => _EnterStoreAddressPageState();
// }

// class _EnterStoreAddressPageState extends State<EnterStoreAddressPage> {
//   String storeAddress = '请选择地图地址';
//   TextEditingController _controller = TextEditingController();

//   @override
//   void initState() {
//     // TODO: implement initState
//     super.initState();
//   }

//   @override
//   Widget build(BuildContext context) {
//     CreateStoreModel createStoreModel =
//         Provider.of<CreateStoreModel>(context, listen: false);
//     _controller.text = createStoreModel.storeInfo?.addressDetail;
//     if (createStoreModel.storeInfo?.address != null) {
//       storeAddress = createStoreModel.storeInfo.address;
//     }

//     return Scaffold(
//         backgroundColor: Colors.white,
//         appBar: SystemAppBar(
//           '',
//           leftTitle: '上一步',
//           onTap: () {
//             Navigator.pop(context);
//           },
//         ),
//         body: InkWell(
//             onTap: () {
//               FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
//             },
//             child: Container(
//                 padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(70),
//                     ScreenUtil().setWidth(60), ScreenUtil().setWidth(70), 0),
//                 child: SingleChildScrollView(
//                     // controller: _controller,
//                     child: Column(
//                         crossAxisAlignment: CrossAxisAlignment.start,
//                         children: [
//                       Text('您的店铺地址在哪?',
//                           style: TextStyle(
//                               color: MyColours.color_333333,
//                               fontSize: ScreenUtil().setSp(40),
//                               fontWeight: FontWeight.bold)),
//                       VEmptyView(100),
//                       InkWell(
//                         onTap: () {
//                           Utils.getPickPermission(context, () async {
//                             Map address =
//                                 await NavigatorUtil.goMapChoicePointPageSim(
//                                     context);
//                             if (address != null) {
//                               setState(() {
//                                 storeAddress = address['address'];
//                                 createStoreModel.storeInfo?.address =
//                                     storeAddress;
//                                 createStoreModel.storeInfo?.lat =
//                                     double.parse(address['lat'].toString());
//                                 createStoreModel.storeInfo?.lng =
//                                     double.parse(address['lng'].toString());
//                               });
//                             }
//                           }, Permission.location);
//                         },
//                         child: Container(
//                           alignment: Alignment.centerLeft,
//                           width: double.infinity,
//                           height: ScreenUtil().setWidth(104),
//                           decoration: BoxDecoration(
//                               borderRadius: BorderRadius.circular(
//                                   ScreenUtil().setWidth(10)),
//                               border: Border.all(
//                                   color: MyColours.color_bff6f7,
//                                   width: ScreenUtil().setWidth(2))),
//                           padding: EdgeInsets.symmetric(
//                             horizontal: ScreenUtil().setWidth(40),
//                           ),
//                           child: Text('${storeAddress}',
//                               style: TextStyle(
//                                 color: storeAddress == '请选择地图地址'
//                                     ? MyColours.color_999999
//                                     : MyColours.color_333333,
//                                 fontSize: ScreenUtil().setSp(28),
//                               )),
//                         ),
//                       ),
//                       // VEmptyView(20),
//                       // TextField(
//                       //   controller: _controller,
//                       //   // textAlignVertical: TextAlignVertical.bottom,
//                       //   maxLines: 1,
//                       //   // //光标颜色
//                       //   // cursorColor:
//                       //   //     widget.isSelect ? Colors.white : MyColours.color_199095,
//                       //   //输入文本的样式
//                       //   style: TextStyle(
//                       //     color: MyColours.color_333333,
//                       //     fontSize: ScreenUtil().setSp(28),
//                       //   ),
//                       //   // focusNode: _codeNode,
//                       //   decoration: InputDecoration(
//                       //     contentPadding: EdgeInsets.symmetric(
//                       //         vertical: ScreenUtil().setWidth(32),
//                       //         horizontal: ScreenUtil().setWidth(40)),
//                       //     border: OutlineInputBorder(),
//                       //     hintText: '请输入详细地址(选填)',
//                       //     hintStyle: TextStyle(
//                       //       color: MyColours.color_999999,
//                       //       fontSize: ScreenUtil().setSp(28),
//                       //     ),
//                       //     enabledBorder: OutlineInputBorder(
//                       //         borderSide: BorderSide(
//                       //             color: MyColours.color_bff6f7,
//                       //             width: ScreenUtil().setWidth(2))),
//                       //     focusedBorder: OutlineInputBorder(
//                       //         borderSide: BorderSide(
//                       //             color: MyColours.color_bff6f7,
//                       //             width: ScreenUtil().setWidth(2))),
//                       //   ),
//                       //   onChanged: (value) {
//                       //     createStoreModel.storeInfo.addressDetail = value;
//                       //   },
//                       //   onEditingComplete: () {
//                       //     FocusScope.of(context)
//                       //         .requestFocus(FocusNode()); //点击空白处隐藏键盘
//                       //   },
//                       //   keyboardType: TextInputType.text,
//                       // ),
//                       VEmptyView(160),
//                       RoundButton(
//                         text: '下一步',
//                         gradientStart: MyColours.color_199095,
//                         gradientEnd: MyColours.color_199095,
//                         // borderColor: MyColours.color_999999,
//                         radius: ScreenUtil().setWidth(20),
//                         fontSize: 28,
//                         isBold: false,
//                         onPressed: () {
//                           NavigatorUtil.goEnterStorePhonePageSim(context);
//                           // NavigatorUtil.goEnterStorePositionPageSim(context);
//                         },
//                       )
//                     ])))));
//     ;
//   }
// }