|
|
|
@ -428,10 +428,17 @@ class _LoginPageState extends State<LoginByName3> {
|
|
|
|
|
|
|
|
|
|
|
|
///构建历史账号ListView
|
|
|
|
///构建历史账号ListView
|
|
|
|
Widget _buildListView() {
|
|
|
|
Widget _buildListView() {
|
|
|
|
|
|
|
|
double _line_height = 110;
|
|
|
|
|
|
|
|
int _height = g_users.length * _line_height.toInt();
|
|
|
|
|
|
|
|
if (_height > 550) {
|
|
|
|
|
|
|
|
_height = 550;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (g_can_expand_ListView) {
|
|
|
|
if (g_can_expand_ListView) {
|
|
|
|
return Center(
|
|
|
|
return Center(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().screenWidth * 0.9,
|
|
|
|
width: ScreenUtil().screenWidth * 0.9,
|
|
|
|
|
|
|
|
// 模拟器:610越界,600刚好,550存放5个行刚好。S10,600越界
|
|
|
|
|
|
|
|
height: ScreenUtil().setHeight(_height),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
border: Border(
|
|
|
|
left: BorderSide(width: 1, color: Colors.black),
|
|
|
|
left: BorderSide(width: 1, color: Colors.black),
|
|
|
|
@ -444,65 +451,65 @@ class _LoginPageState extends State<LoginByName3> {
|
|
|
|
// // color: Colors.black,
|
|
|
|
// // color: Colors.black,
|
|
|
|
// // borderRadius: new BorderRadius.circular((20.0)),
|
|
|
|
// // borderRadius: new BorderRadius.circular((20.0)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
child: Column(
|
|
|
|
child: ListView.builder(
|
|
|
|
children: [
|
|
|
|
shrinkWrap: true,
|
|
|
|
ListView.builder(
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
UserAccount user = g_users[index];
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return GestureDetector(
|
|
|
|
UserAccount user = g_users[index];
|
|
|
|
child: Column(
|
|
|
|
return GestureDetector(
|
|
|
|
children: [
|
|
|
|
child: Column(
|
|
|
|
Container(
|
|
|
|
children: [
|
|
|
|
// height: ScreenUtil().setHeight(_line_height),
|
|
|
|
Container(
|
|
|
|
// color: Colors.grey[200],
|
|
|
|
// color: Colors.grey[200],
|
|
|
|
color: Colors.grey[200],
|
|
|
|
color: Colors.grey[200],
|
|
|
|
// padding: EdgeInsets.only(left: 8, top: 4, right: 8, bottom: 4),
|
|
|
|
padding: EdgeInsets.only(left: 8, top: 8, right: 8, bottom: 8),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
child: Column(
|
|
|
|
horizontal: ScreenUtil().setHeight(35),
|
|
|
|
children: [
|
|
|
|
vertical: ScreenUtil().setHeight(17)),
|
|
|
|
Row(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
children: <Widget>[
|
|
|
|
Row(
|
|
|
|
Text("${user.username}"),
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
GestureDetector(
|
|
|
|
children: <Widget>[
|
|
|
|
child: Padding(
|
|
|
|
Text("${(index + 1).toString()}、${user.username}"),
|
|
|
|
padding: EdgeInsets.all(0),
|
|
|
|
GestureDetector(
|
|
|
|
child: Icon(
|
|
|
|
child: Padding(
|
|
|
|
// Icons.remove_circle_outline,
|
|
|
|
padding: EdgeInsets.all(0),
|
|
|
|
Icons.highlight_off,
|
|
|
|
child: Icon(
|
|
|
|
color: Colors.grey,
|
|
|
|
// 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;
|
|
|
|
onTap: () {
|
|
|
|
g_userInfo.password = user.password;
|
|
|
|
setState(() {
|
|
|
|
g_can_expand_ListView = false;
|
|
|
|
g_userInfo.username = user.username;
|
|
|
|
});
|
|
|
|
g_userInfo.password = user.password;
|
|
|
|
},
|
|
|
|
g_can_expand_ListView = false;
|
|
|
|
);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
itemCount: g_users.length,
|
|
|
|
);
|
|
|
|
)
|
|
|
|
},
|
|
|
|
],
|
|
|
|
itemCount: g_users.length,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|