hyzp_ybqx-Commit094:优化。但还不能保存已登录的用户

master
WinUser01 4 years ago
parent e28e645e13
commit c5e1a014b0

@ -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);
//Expandfalse
//1
_can_expand_ListView = g_users.isNotEmpty;
g_can_expand_ListView = g_users.isNotEmpty;
});
},
),

@ -130,10 +130,15 @@ class _JdTextState extends State<JdText> {
child: IconButton(
padding: EdgeInsets.only(bottom: 0.0),
iconSize: 40,
icon: Icon(
Icons.arrow_drop_down,
color: g_users.isNotEmpty ? Colors.blueAccent : Colors.grey,
),
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,
),
onPressed: widget.onEndBtn),
);
break;

Loading…
Cancel
Save