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<CameraDescription> cameras;
List<UserAccount> g_users = new List(); // List<UserAccount> g_users = new List(); //
bool g_can_expand_ListView = false; //
UserInfo g_userInfo = UserInfo(mapUserInfoRet: { UserInfo g_userInfo = UserInfo(mapUserInfoRet: {
"ret": 200, "ret": 200,
"data": { "data": {

@ -40,7 +40,7 @@ class _LoginPageState extends State<LoginByName3> {
bool bRemmberPW = false; bool bRemmberPW = false;
GlobalKey _globalKey = new GlobalKey(); // GlobalKey _globalKey = new GlobalKey(); //
bool _can_expand_ListView = false; // // bool g_can_expand_ListView = false; //
// List<UserAccount> g_users = new List(); // // List<UserAccount> g_users = new List(); //
@override @override
@ -256,7 +256,7 @@ class _LoginPageState extends State<LoginByName3> {
if (g_users.isNotEmpty) { if (g_users.isNotEmpty) {
//1 //1
// _can_expand_ListView = !_can_expand_ListView; // _can_expand_ListView = !_can_expand_ListView;
_can_expand_ListView = false; g_can_expand_ListView = false;
} }
setState(() {}); setState(() {});
} }
@ -286,17 +286,17 @@ class _LoginPageState extends State<LoginByName3> {
if (g_users.isNotEmpty) { if (g_users.isNotEmpty) {
//1 //1
setState(() { setState(() {
_can_expand_ListView = !_can_expand_ListView; g_can_expand_ListView = !g_can_expand_ListView;
}); });
} }
}, },
onEndBtn2: () { onEndBtn2: () {
// FocusManager.instance.primaryFocus.unfocus(); // Flutter // FocusManager.instance.primaryFocus.unfocus(); // Flutter
// //
print('xx2'); // print('xx2');
if (g_users.isNotEmpty) { if (g_users.isNotEmpty) {
//1 //1
_can_expand_ListView = false; g_can_expand_ListView = false;
} }
setState(() {}); setState(() {});
}, },
@ -424,7 +424,7 @@ class _LoginPageState extends State<LoginByName3> {
///ListView ///ListView
Widget _buildListView() { Widget _buildListView() {
if (_can_expand_ListView) { if (g_can_expand_ListView) {
return Column( return Column(
children: [ children: [
ListView.builder( ListView.builder(
@ -460,7 +460,7 @@ class _LoginPageState extends State<LoginByName3> {
SaveAccountPasswordManager.delUser(user); SaveAccountPasswordManager.delUser(user);
//Expandfalse //Expandfalse
//1 //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( child: IconButton(
padding: EdgeInsets.only(bottom: 0.0), padding: EdgeInsets.only(bottom: 0.0),
iconSize: 40, iconSize: 40,
icon: Icon( icon: g_can_expand_ListView
? Icon(
Icons.arrow_drop_up,
color: Colors.blueAccent,
)
: Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
color: g_users.isNotEmpty ? Colors.blueAccent : Colors.grey, color: g_users.isNotEmpty ? Colors.blueAccent : Colors.grey,
), ),

Loading…
Cancel
Save