|
...
|
...
|
@@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:one_key/app.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/utils/log_util.dart';
|
|
|
|
import 'package:one_key/utils/navigator_util.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
...
|
...
|
@@ -35,9 +36,19 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver{ |
|
|
|
@override
|
|
|
|
void initState(){
|
|
|
|
// TODO: implement initState
|
|
|
|
WidgetsBinding.instance.addObserver(this);
|
|
|
|
super.initState();
|
|
|
|
isLogin();
|
|
|
|
WidgetsBinding.instance.addObserver(this);
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_){
|
|
|
|
final UserModel userModel=Provider.of<UserModel>(context,listen: false);
|
|
|
|
if(userModel!=null&&userModel.user!=null){
|
|
|
|
Future.delayed(Duration(milliseconds: 50),(){
|
|
|
|
_sellerCodeController.text=userModel.user.sellercode;
|
|
|
|
_accountController.text=userModel.user.account;
|
|
|
|
FocusScope.of(context).requestFocus(_pwdFocusNode);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
handlePostFrame(_){
|
|
...
|
...
|
@@ -94,14 +105,6 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver{ |
|
|
|
App.statusBarHeight=MediaQuery.of(context).padding.top;
|
|
|
|
App.bottomBarHeight=MediaQuery.of(context).padding.bottom;
|
|
|
|
|
|
|
|
final UserModel userModel=Provider.of<UserModel>(context);
|
|
|
|
if(userModel!=null&&userModel.user!=null){
|
|
|
|
// _sellerCodeController.text=userModel.user.sellercode;
|
|
|
|
_accountController.text=userModel.user.account;
|
|
|
|
|
|
|
|
_sellerCodeController=TextEditingController.fromValue(TextEditingValue(text:userModel.user.sellercode,selection: TextSelection.fromPosition(TextPosition(affinity: TextAffinity.downstream,offset: userModel.user.sellercode.length))));
|
|
|
|
}
|
|
|
|
|
|
|
|
final double prefixIconWidth=ScreenUtil().setWidth(24);
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
...
|
...
|
@@ -140,7 +143,7 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver{ |
|
|
|
hintText: "请输入6位商户编码",
|
|
|
|
hintStyle: TextStyle(color: MyColours.color_c1c1c1,fontSize: ScreenUtil().setSp(26)),
|
|
|
|
border: InputBorder.none,
|
|
|
|
contentPadding: EdgeInsets.all(10)
|
|
|
|
contentPadding: EdgeInsets.symmetric(vertical: ScreenUtil().setHeight(30),horizontal: ScreenUtil().setWidth(10))
|
|
|
|
),
|
|
|
|
onChanged: (_){
|
|
|
|
setActivate();
|
|
...
|
...
|
@@ -175,7 +178,7 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver{ |
|
|
|
hintText: "请输入4位工号",
|
|
|
|
hintStyle: TextStyle(color: MyColours.color_c1c1c1,fontSize: ScreenUtil().setSp(26)),
|
|
|
|
border: InputBorder.none,
|
|
|
|
contentPadding: EdgeInsets.all(10)
|
|
|
|
contentPadding: EdgeInsets.symmetric(vertical: ScreenUtil().setHeight(30),horizontal: ScreenUtil().setWidth(10))
|
|
|
|
),
|
|
|
|
onChanged: (_){
|
|
|
|
setActivate();
|
|
...
|
...
|
@@ -210,8 +213,8 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver{ |
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "请输入密码",
|
|
|
|
hintStyle: TextStyle(color: MyColours.color_c1c1c1,fontSize: ScreenUtil().setSp(26)),
|
|
|
|
border: InputBorder.none,
|
|
|
|
contentPadding: EdgeInsets.all(10)
|
|
|
|
border: InputBorder.none,
|
|
|
|
contentPadding: EdgeInsets.symmetric(vertical: ScreenUtil().setHeight(30),horizontal: ScreenUtil().setWidth(10))
|
|
|
|
),
|
|
|
|
onChanged: (_){
|
|
|
|
setActivate();
|
...
|
...
|
|