hyzp_ybqx-Commit097:优化。已经能够保存已登录的用户信息
This commit is contained in:
@@ -418,65 +418,81 @@ class _LoginPageState extends State<LoginByName3> {
|
|||||||
///构建历史账号ListView
|
///构建历史账号ListView
|
||||||
Widget _buildListView() {
|
Widget _buildListView() {
|
||||||
if (g_can_expand_ListView) {
|
if (g_can_expand_ListView) {
|
||||||
return Column(
|
return Center(
|
||||||
children: [
|
child: Container(
|
||||||
ListView.builder(
|
width: ScreenUtil().screenWidth * 0.9,
|
||||||
shrinkWrap: true,
|
decoration: BoxDecoration(
|
||||||
physics: BouncingScrollPhysics(),
|
border: Border(
|
||||||
itemBuilder: (context, index) {
|
left: BorderSide(width: 1, color: Colors.black),
|
||||||
UserAccount user = g_users[index];
|
right: BorderSide(width: 1, color: Colors.black),
|
||||||
return GestureDetector(
|
bottom: BorderSide(width: 1, color: Colors.black),
|
||||||
child: Column(
|
),
|
||||||
children: [
|
),
|
||||||
Container(
|
// decoration: new BoxDecoration(
|
||||||
width: ScreenUtil().screenWidth * 0.9,
|
// border: new Border.all(color: Colors.black, width: 0.5),
|
||||||
// color: Colors.grey[200],
|
// // color: Colors.black,
|
||||||
color: Colors.grey[200],
|
// // borderRadius: new BorderRadius.circular((20.0)),
|
||||||
padding: EdgeInsets.only(left: 8, top: 8, right: 8, bottom: 8),
|
// ),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
ListView.builder(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
shrinkWrap: true,
|
||||||
children: <Widget>[
|
physics: BouncingScrollPhysics(),
|
||||||
Text("${user.username}"),
|
itemBuilder: (context, index) {
|
||||||
GestureDetector(
|
UserAccount user = g_users[index];
|
||||||
child: Padding(
|
return GestureDetector(
|
||||||
padding: EdgeInsets.all(0),
|
child: Column(
|
||||||
child: Icon(
|
children: [
|
||||||
// Icons.remove_circle_outline,
|
Container(
|
||||||
Icons.highlight_off,
|
// color: Colors.grey[200],
|
||||||
color: Colors.grey,
|
color: Colors.grey[200],
|
||||||
|
padding: EdgeInsets.only(left: 8, top: 8, right: 8, bottom: 8),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: <Widget>[
|
||||||
|
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(() {
|
||||||
onTap: () {
|
g_userInfo.username = user.username;
|
||||||
setState(() {
|
g_userInfo.password = user.password;
|
||||||
g_userInfo.username = user.username;
|
});
|
||||||
g_userInfo.password = user.password;
|
},
|
||||||
});
|
);
|
||||||
},
|
},
|
||||||
);
|
itemCount: g_users.length,
|
||||||
},
|
)
|
||||||
itemCount: g_users.length,
|
],
|
||||||
)
|
),
|
||||||
],
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Container();
|
return Container();
|
||||||
|
|||||||
Reference in New Issue
Block a user