|
|
|
|
@ -6,6 +6,7 @@ import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:imei_plugin/imei_plugin.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import '../../config/shared_pref_kay.dart';
|
|
|
|
|
import '../../config/size_config.dart';
|
|
|
|
|
import '../../models/user_model.dart';
|
|
|
|
|
import '../../providers/auth_provider.dart';
|
|
|
|
|
@ -67,22 +68,8 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
|
buildSizedBox(),
|
|
|
|
|
TextFormField(
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
// style: TextStyle(fontSize: 30),
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
prefixIcon: Image.asset('assets/images/user_id_icon.png'),
|
|
|
|
|
hintText: 'Enter ID',
|
|
|
|
|
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
|
),
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
|
|
|
|
borderSide:
|
|
|
|
|
BorderSide(color: Theme.of(context).primaryColor),
|
|
|
|
|
)
|
|
|
|
|
//BorderRadius.all(Radius.circular(20));
|
|
|
|
|
),
|
|
|
|
|
decoration: buildInputDecoration(
|
|
|
|
|
context, 'Enter ID', 'assets/images/user_id_icon.png'),
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty) {
|
|
|
|
|
return 'Please enter your ID';
|
|
|
|
|
@ -96,22 +83,8 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
|
buildSizedBox(),
|
|
|
|
|
TextFormField(
|
|
|
|
|
obscureText: true,
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
prefixIcon: Image.asset('assets/images/password_icon.png'),
|
|
|
|
|
hintText: 'Enter Password',
|
|
|
|
|
hintStyle:
|
|
|
|
|
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
|
),
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
|
|
|
|
borderSide:
|
|
|
|
|
BorderSide(color: Theme.of(context).primaryColor),
|
|
|
|
|
)
|
|
|
|
|
//BorderRadius.all(Radius.circular(20));
|
|
|
|
|
),
|
|
|
|
|
decoration: buildInputDecoration(context, 'Enter Password',
|
|
|
|
|
'assets/images/password_icon.png'),
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty) {
|
|
|
|
|
return 'Please enter your Password';
|
|
|
|
|
@ -130,22 +103,8 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
|
},
|
|
|
|
|
showCursor: false,
|
|
|
|
|
readOnly: true,
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
prefixIcon: Image.asset('assets/images/password_icon.png'),
|
|
|
|
|
hintText: 'Select your porject',
|
|
|
|
|
hintStyle:
|
|
|
|
|
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
|
),
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
|
|
|
|
borderSide:
|
|
|
|
|
BorderSide(color: Theme.of(context).primaryColor),
|
|
|
|
|
)
|
|
|
|
|
//BorderRadius.all(Radius.circular(20));
|
|
|
|
|
),
|
|
|
|
|
decoration: buildInputDecoration(context, 'Select your porject',
|
|
|
|
|
'assets/images/password_icon.png'),
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty) {
|
|
|
|
|
return 'Please enter your porject';
|
|
|
|
|
@ -207,6 +166,28 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*@author: Elham Rababah
|
|
|
|
|
*@Date:20/4/2020
|
|
|
|
|
*@param: context, hint, asset
|
|
|
|
|
*@return: InputDecoration
|
|
|
|
|
*@desc: decorate input feilds
|
|
|
|
|
*/
|
|
|
|
|
InputDecoration buildInputDecoration(BuildContext context, hint, asset) {
|
|
|
|
|
return InputDecoration(
|
|
|
|
|
prefixIcon: Image.asset(asset),
|
|
|
|
|
hintText: hint,
|
|
|
|
|
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
|
),
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
|
|
|
|
borderSide: BorderSide(color: Theme.of(context).primaryColor),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SizedBox buildSizedBox() {
|
|
|
|
|
return SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
@ -223,6 +204,9 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
// insertDeviceImei(res, authProv);
|
|
|
|
|
saveObjToString('loggedUser', res);
|
|
|
|
|
sharedPref.setString(TOKEN, res['LogInTokenID']);
|
|
|
|
|
print("token" + res['LogInTokenID']);
|
|
|
|
|
|
|
|
|
|
Navigator.of(context).pushNamed(VERIFICATION_METHODS);
|
|
|
|
|
} else {
|
|
|
|
|
// handel error
|
|
|
|
|
|