便民电话部分重写

hmxc
小赖 4 years ago
parent 44cb268444
commit 10d89c668b

@ -39,47 +39,45 @@ class _ConvenientPhonePageState extends State<ConvenientPhonePage> {
} }
Widget _buildTile(ConvenientPhoneModel model) { Widget _buildTile(ConvenientPhoneModel model) {
return Material( return Column(
child: Column( children: [
children: [ Row(
Row( crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ model.name.text.black.size(32.sp).make(),
model.name.text.black.size(32.sp).make(), 12.w.heightBox,
12.w.heightBox, model.tel.text.color(Color(0xFF999999)).size(28.sp).make(),
model.tel.text.color(Color(0xFF999999)).size(28.sp).make(), ],
], ).expand(),
).expand(), IconButton(
IconButton( icon: Image.asset(
icon: Image.asset( R.ASSETS_ICONS_PHONE_PNG,
R.ASSETS_ICONS_PHONE_PNG, width: 40.w,
width: 40.w, height: 40.w,
height: 40.w, ),
), onPressed: () async {
onPressed: () async { bool result = await Get.dialog(CupertinoAlertDialog(
bool result = await Get.dialog(CupertinoAlertDialog( title: model.tel.text.isIntrinsic.make(),
title: model.tel.text.isIntrinsic.make(), actions: [
actions: [ CupertinoDialogAction(
CupertinoDialogAction( child: '取消'.text.isIntrinsic.make(),
child: '取消'.text.isIntrinsic.make(), onPressed: () => Get.back(),
onPressed: () => Get.back(), ),
), CupertinoDialogAction(
CupertinoDialogAction( child: '确定'.text.isIntrinsic.make(),
child: '确定'.text.isIntrinsic.make(), onPressed: () => Get.back(result: true),
onPressed: () => Get.back(result: true), ),
), ],
], ));
)); if (result == true) launch('tel:${model.tel}');
if (result == true) launch('tel:${model.tel}'); },
}, )
) ],
], ),
), ],
],
),
); );
} }
@ -134,27 +132,25 @@ class _ConvenientPhonePageState extends State<ConvenientPhonePage> {
}, },
builder: (items) { builder: (items) {
return ListView.separated( return ListView.separated(
padding: padding:
EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return _buildTile(items[index]); return _buildTile(items[index]);
}, },
separatorBuilder: (context, index) { separatorBuilder: (context, index) {
return Padding( return Divider(
padding: EdgeInsets.symmetric(vertical: 20.w), thickness: 1.w,
child: Divider( height: 40.w,
thickness: 1.w, color: Color(0xFFD8D8D8),
height: 1.w, );
color: Color(0xFFD8D8D8), },
), itemCount: items.length,
); );
},
itemCount: items.length);
}, },
), ),
), ),
], ],
), ).material(color: Colors.white),
); );
} }
} }

Loading…
Cancel
Save