html添加删除编辑收货地址,39 Flutter仿京东商城项目 收货地址列表、增加 修改收货地址布局、弹出省市区选择器...

import 'package:flutter/material.dart';

import'package:flutter_jdshop/services/ScreenAdapter.dart';

import'package:flutter_jdshop/widget/JdButton.dart';

import'package:flutter_jdshop/widget/JdText.dart';

import'package:city_pickers/city_pickers.dart';classAddressAddPage extends StatefulWidget {

AddressAddPage({Key key}) : super(key: key);

_AddressAddPageState createState()=>_AddressAddPageState();

}class _AddressAddPageState extends State{

String area= '';

@override

Widget build(BuildContext context) {returnScaffold(

appBar: AppBar(

title: Text('增加收货地址'),

),

body: Container(

child: ListView(

children:[

JdText(

text:"收货人姓名",

),

SizedBox(height:10),

JdText(

text:"收货人电话",

),

SizedBox(height:10),

Container(

padding: EdgeInsets.only(left:5),

height: ScreenAdapter.height(68),

decoration: BoxDecoration(

border: Border(

bottom: BorderSide(width:1, color: Colors.black12))),

child: InkWell(

child: Row(

children:[

Icon(Icons.add_location),this.area.length > 0

? Text("${this.area}",

style: TextStyle(color: Colors.black54))

: Text("省/市/区",

style: TextStyle(color: Colors.black54))

],

),

onTap: ()async{

Result result= awaitCityPickers.showCityPicker(

context: context,

cancelWidget:

Text('取消', style: TextStyle(color: Colors.black54)),

confirmWidget:

Text("确定", style: TextStyle(color: Colors.blue)));

setState(() {this.area =

"${result.provinceName}/${result.cityName}/${result.areaName}";

});

},

),

),

SizedBox(height:10),

JdText(

text:"详细地址",

maxLines:4,

height:200,

),

SizedBox(height:10),

RaisedButton(

child: Text("弹出省市区"),

onPressed: ()async{

Result result= awaitCityPickers.showCityPicker(

context: context,

cancelWidget:

Text('取消', style: TextStyle(color: Colors.black54)),

confirmWidget:

Text("确定", style: TextStyle(color: Colors.blue)));

},

),

SizedBox(height:40),

JdButton(

text:"增加",

color: Colors.red,

)

],

),

));

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值