hyzp_ybqx-Commit094:优化。但还不能保存已登录的用户
This commit is contained in:
@@ -223,6 +223,7 @@ int faceRegUserID = -1; //人脸注册时所需用户ID,-1 非法
|
||||
|
||||
List<CameraDescription> cameras;
|
||||
List<UserAccount> g_users = new List(); //历史账号
|
||||
bool g_can_expand_ListView = false; //是否能够打开历史账号
|
||||
UserInfo g_userInfo = UserInfo(mapUserInfoRet: {
|
||||
"ret": 200,
|
||||
"data": {
|
||||
|
||||
@@ -40,7 +40,7 @@ class _LoginPageState extends State<LoginByName3> {
|
||||
bool bRemmberPW = false;
|
||||
|
||||
GlobalKey _globalKey = new GlobalKey(); //用来标记控件
|
||||
bool _can_expand_ListView = false; //是否能够打开历史账号
|
||||
// bool g_can_expand_ListView = false; //是否能够打开历史账号
|
||||
// List<UserAccount> g_users = new List(); //历史账号
|
||||
|
||||
@override
|
||||
@@ -256,7 +256,7 @@ class _LoginPageState extends State<LoginByName3> {
|
||||
if (g_users.isNotEmpty) {
|
||||
//如果个数大于1个或者唯一一个账号跟当前账号不一样才弹出历史账号
|
||||
// _can_expand_ListView = !_can_expand_ListView;
|
||||
_can_expand_ListView = false;
|
||||
g_can_expand_ListView = false;
|
||||
}
|
||||
setState(() {});
|
||||
}
|
||||
@@ -286,17 +286,17 @@ class _LoginPageState extends State<LoginByName3> {
|
||||
if (g_users.isNotEmpty) {
|
||||
//如果个数大于1个或者唯一一个账号跟当前账号不一样才弹出历史账号
|
||||
setState(() {
|
||||
_can_expand_ListView = !_can_expand_ListView;
|
||||
g_can_expand_ListView = !g_can_expand_ListView;
|
||||
});
|
||||
}
|
||||
},
|
||||
onEndBtn2: () {
|
||||
// FocusManager.instance.primaryFocus.unfocus(); // 【Flutter 实战】全局点击空白处隐藏键盘
|
||||
// 全局点击空白处隐藏账号输入框
|
||||
print('xx2');
|
||||
// print('xx2');
|
||||
if (g_users.isNotEmpty) {
|
||||
//如果个数大于1个或者唯一一个账号跟当前账号不一样才弹出历史账号
|
||||
_can_expand_ListView = false;
|
||||
g_can_expand_ListView = false;
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
@@ -424,7 +424,7 @@ class _LoginPageState extends State<LoginByName3> {
|
||||
|
||||
///构建历史账号ListView
|
||||
Widget _buildListView() {
|
||||
if (_can_expand_ListView) {
|
||||
if (g_can_expand_ListView) {
|
||||
return Column(
|
||||
children: [
|
||||
ListView.builder(
|
||||
@@ -460,7 +460,7 @@ class _LoginPageState extends State<LoginByName3> {
|
||||
SaveAccountPasswordManager.delUser(user);
|
||||
//处理最后一个数据,假如最后一个被删掉,将Expand置为false
|
||||
//如果个数大于1个或者唯一一个账号跟当前账号不一样才弹出历史账号
|
||||
_can_expand_ListView = g_users.isNotEmpty;
|
||||
g_can_expand_ListView = g_users.isNotEmpty;
|
||||
});
|
||||
},
|
||||
),
|
||||
|
||||
@@ -130,7 +130,12 @@ class _JdTextState extends State<JdText> {
|
||||
child: IconButton(
|
||||
padding: EdgeInsets.only(bottom: 0.0),
|
||||
iconSize: 40,
|
||||
icon: Icon(
|
||||
icon: g_can_expand_ListView
|
||||
? Icon(
|
||||
Icons.arrow_drop_up,
|
||||
color: Colors.blueAccent,
|
||||
)
|
||||
: Icon(
|
||||
Icons.arrow_drop_down,
|
||||
color: g_users.isNotEmpty ? Colors.blueAccent : Colors.grey,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user