hyzp_ybqx-Commit097:优化。已经能够保存已登录的用户信息

master
WinUser01 4 years ago
parent d70a3cefd2
commit bfe8777199

@ -418,65 +418,81 @@ class _LoginPageState extends State<LoginByName3> {
///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: <Widget>[
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: <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);
//Expandfalse
//1
g_can_expand_ListView = g_users.isNotEmpty;
});
},
),
),
onTap: () {
setState(() {
g_users.remove(user);
SaveAccountPasswordManager.delUser(user);
//Expandfalse
//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();

Loading…
Cancel
Save