From bfe8777199a122fabc8fef56c1a7b917798bec72 Mon Sep 17 00:00:00 2001 From: WinUser01 Date: Wed, 26 Jan 2022 02:03:00 +0800 Subject: [PATCH] =?UTF-8?q?hyzp=5Fybqx-Commit097=EF=BC=9A=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=82=E5=B7=B2=E7=BB=8F=E8=83=BD=E5=A4=9F=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E5=B7=B2=E7=99=BB=E5=BD=95=E7=9A=84=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/Login/LoginByName3.dart | 122 +++++++++++++++++------------- 1 file changed, 69 insertions(+), 53 deletions(-) diff --git a/lib/pages/Login/LoginByName3.dart b/lib/pages/Login/LoginByName3.dart index 8c90a48..71bd0ed 100644 --- a/lib/pages/Login/LoginByName3.dart +++ b/lib/pages/Login/LoginByName3.dart @@ -418,65 +418,81 @@ class _LoginPageState extends State { ///构建历史账号ListView Widget _buildListView() { if (g_can_expand_ListView) { - return Column( - children: [ - ListView.builder( - shrinkWrap: true, - physics: BouncingScrollPhysics(), - itemBuilder: (context, index) { - UserAccount user = g_users[index]; - return GestureDetector( - child: Column( - children: [ - Container( - width: ScreenUtil().screenWidth * 0.9, - // color: Colors.grey[200], - color: Colors.grey[200], - padding: EdgeInsets.only(left: 8, top: 8, right: 8, bottom: 8), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text("${user.username}"), - GestureDetector( - child: Padding( - padding: EdgeInsets.all(0), - child: Icon( - // Icons.remove_circle_outline, - Icons.highlight_off, - color: Colors.grey, + return Center( + child: Container( + width: ScreenUtil().screenWidth * 0.9, + decoration: BoxDecoration( + border: Border( + left: BorderSide(width: 1, color: Colors.black), + right: BorderSide(width: 1, color: Colors.black), + bottom: BorderSide(width: 1, color: Colors.black), + ), + ), + // decoration: new BoxDecoration( + // border: new Border.all(color: Colors.black, width: 0.5), + // // color: Colors.black, + // // borderRadius: new BorderRadius.circular((20.0)), + // ), + child: Column( + children: [ + ListView.builder( + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, index) { + UserAccount user = g_users[index]; + return GestureDetector( + child: Column( + children: [ + Container( + // color: Colors.grey[200], + color: Colors.grey[200], + padding: EdgeInsets.only(left: 8, top: 8, right: 8, bottom: 8), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text("${user.username}"), + GestureDetector( + child: Padding( + padding: EdgeInsets.all(0), + child: Icon( + // Icons.remove_circle_outline, + Icons.highlight_off, + color: Colors.grey, + ), + ), + onTap: () { + setState(() { + g_users.remove(user); + SaveAccountPasswordManager.delUser(user); + //处理最后一个数据,假如最后一个被删掉,将Expand置为false + //如果个数大于1个或者唯一一个账号跟当前账号不一样才弹出历史账号 + g_can_expand_ListView = g_users.isNotEmpty; + }); + }, ), - ), - onTap: () { - setState(() { - g_users.remove(user); - SaveAccountPasswordManager.delUser(user); - //处理最后一个数据,假如最后一个被删掉,将Expand置为false - //如果个数大于1个或者唯一一个账号跟当前账号不一样才弹出历史账号 - g_can_expand_ListView = g_users.isNotEmpty; - }); - }, + ], ), + Divider(height: 1.0, color: Colors.black), ], ), - Divider(height: 1.0, color: Colors.black), - ], - ), + ), + ], ), - ], - ), - onTap: () { - setState(() { - g_userInfo.username = user.username; - g_userInfo.password = user.password; - }); + onTap: () { + setState(() { + g_userInfo.username = user.username; + g_userInfo.password = user.password; + }); + }, + ); }, - ); - }, - itemCount: g_users.length, - ) - ], + itemCount: g_users.length, + ) + ], + ), + ), ); } return Container();