From 10d89c668b6a7247c8cc4b37b338e63710be5d85 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Wed, 7 Apr 2021 14:42:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=BF=E6=B0=91=E7=94=B5=E8=AF=9D=E9=83=A8?= =?UTF-8?q?=E5=88=86=E9=87=8D=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../convenient_phone_page.dart | 112 +++++++++--------- 1 file changed, 54 insertions(+), 58 deletions(-) diff --git a/lib/pages/convenient_phone/convenient_phone_page.dart b/lib/pages/convenient_phone/convenient_phone_page.dart index 8fd8d1db..1db40f17 100644 --- a/lib/pages/convenient_phone/convenient_phone_page.dart +++ b/lib/pages/convenient_phone/convenient_phone_page.dart @@ -39,47 +39,45 @@ class _ConvenientPhonePageState extends State { } Widget _buildTile(ConvenientPhoneModel model) { - return Material( - child: Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - model.name.text.black.size(32.sp).make(), - 12.w.heightBox, - model.tel.text.color(Color(0xFF999999)).size(28.sp).make(), - ], - ).expand(), - IconButton( - icon: Image.asset( - R.ASSETS_ICONS_PHONE_PNG, - width: 40.w, - height: 40.w, - ), - onPressed: () async { - bool result = await Get.dialog(CupertinoAlertDialog( - title: model.tel.text.isIntrinsic.make(), - actions: [ - CupertinoDialogAction( - child: '取消'.text.isIntrinsic.make(), - onPressed: () => Get.back(), - ), - CupertinoDialogAction( - child: '确定'.text.isIntrinsic.make(), - onPressed: () => Get.back(result: true), - ), - ], - )); - if (result == true) launch('tel:${model.tel}'); - }, - ) - ], - ), - ], - ), + return Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + model.name.text.black.size(32.sp).make(), + 12.w.heightBox, + model.tel.text.color(Color(0xFF999999)).size(28.sp).make(), + ], + ).expand(), + IconButton( + icon: Image.asset( + R.ASSETS_ICONS_PHONE_PNG, + width: 40.w, + height: 40.w, + ), + onPressed: () async { + bool result = await Get.dialog(CupertinoAlertDialog( + title: model.tel.text.isIntrinsic.make(), + actions: [ + CupertinoDialogAction( + child: '取消'.text.isIntrinsic.make(), + onPressed: () => Get.back(), + ), + CupertinoDialogAction( + child: '确定'.text.isIntrinsic.make(), + onPressed: () => Get.back(result: true), + ), + ], + )); + if (result == true) launch('tel:${model.tel}'); + }, + ) + ], + ), + ], ); } @@ -134,27 +132,25 @@ class _ConvenientPhonePageState extends State { }, builder: (items) { return ListView.separated( - padding: - EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), - itemBuilder: (context, index) { - return _buildTile(items[index]); - }, - separatorBuilder: (context, index) { - return Padding( - padding: EdgeInsets.symmetric(vertical: 20.w), - child: Divider( - thickness: 1.w, - height: 1.w, - color: Color(0xFFD8D8D8), - ), - ); - }, - itemCount: items.length); + padding: + EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), + itemBuilder: (context, index) { + return _buildTile(items[index]); + }, + separatorBuilder: (context, index) { + return Divider( + thickness: 1.w, + height: 40.w, + color: Color(0xFFD8D8D8), + ); + }, + itemCount: items.length, + ); }, ), ), ], - ), + ).material(color: Colors.white), ); } }