|
|
|
@ -1,5 +1,3 @@
|
|
|
|
import '../../providers/projects_provider.dart';
|
|
|
|
|
|
|
|
import '../../util/dr_app_toast_msg.dart';
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/rendering.dart';
|
|
|
|
import 'package:flutter/rendering.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
@ -7,13 +5,16 @@ import 'package:hexcolor/hexcolor.dart';
|
|
|
|
import 'package:imei_plugin/imei_plugin.dart';
|
|
|
|
import 'package:imei_plugin/imei_plugin.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import '../../config/size_config.dart';
|
|
|
|
import '../../models/user_model.dart';
|
|
|
|
import '../../models/user_model.dart';
|
|
|
|
import '../../providers/auth_provider.dart';
|
|
|
|
import '../../providers/auth_provider.dart';
|
|
|
|
|
|
|
|
import '../../providers/projects_provider.dart';
|
|
|
|
import '../../routes.dart';
|
|
|
|
import '../../routes.dart';
|
|
|
|
import '../../util/dr_app_shared_pref.dart';
|
|
|
|
import '../../util/dr_app_shared_pref.dart';
|
|
|
|
|
|
|
|
import '../../util/dr_app_toast_msg.dart';
|
|
|
|
|
|
|
|
|
|
|
|
DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
|
|
|
|
DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
|
|
|
|
DrAppToastMsg toastMsg = DrAppToastMsg();
|
|
|
|
DrAppToastMsg toastMsg = DrAppToastMsg();
|
|
|
|
|
|
|
|
|
|
|
|
class LoginForm extends StatefulWidget with DrAppToastMsg {
|
|
|
|
class LoginForm extends StatefulWidget with DrAppToastMsg {
|
|
|
|
LoginForm({
|
|
|
|
LoginForm({
|
|
|
|
@ -71,9 +72,8 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
decoration: InputDecoration(
|
|
|
|
decoration: InputDecoration(
|
|
|
|
prefixIcon: Image.asset('assets/images/user_id_icon.png'),
|
|
|
|
prefixIcon: Image.asset('assets/images/user_id_icon.png'),
|
|
|
|
hintText: 'Enter ID',
|
|
|
|
hintText: 'Enter ID',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
hintStyle:
|
|
|
|
fontSize:
|
|
|
|
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
|
|
|
isSmallScreen ? 14 : constraints.maxWidth * 0.024),
|
|
|
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
@ -104,10 +104,8 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
prefixIcon:
|
|
|
|
prefixIcon:
|
|
|
|
Image.asset('assets/images/password_icon.png'),
|
|
|
|
Image.asset('assets/images/password_icon.png'),
|
|
|
|
hintText: 'Enter Password',
|
|
|
|
hintText: 'Enter Password',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
hintStyle:
|
|
|
|
fontSize: isSmallScreen
|
|
|
|
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
|
|
|
? 14
|
|
|
|
|
|
|
|
: constraints.maxWidth * 0.024),
|
|
|
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
@ -140,10 +138,8 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
prefixIcon:
|
|
|
|
prefixIcon:
|
|
|
|
Image.asset('assets/images/hospital_icon.png'),
|
|
|
|
Image.asset('assets/images/hospital_icon.png'),
|
|
|
|
// hintText: 'Enter Password',
|
|
|
|
// hintText: 'Enter Password',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
hintStyle:
|
|
|
|
fontSize: isSmallScreen
|
|
|
|
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
|
|
|
? 14
|
|
|
|
|
|
|
|
: constraints.maxWidth * 0.024),
|
|
|
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
@ -189,9 +185,7 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
onChanged: (bool newValue) {}),
|
|
|
|
onChanged: (bool newValue) {}),
|
|
|
|
Text("Remember me",
|
|
|
|
Text("Remember me",
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: isSmallScreen
|
|
|
|
fontSize: 2 * SizeConfig.textMultiplier)),
|
|
|
|
? 18
|
|
|
|
|
|
|
|
: constraints.maxWidth * 0.018)),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -208,16 +202,14 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
BorderSide(width: 0.5, color: Hexcolor('#CCCCCC'))),
|
|
|
|
BorderSide(width: 0.5, color: Hexcolor('#CCCCCC'))),
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
height: 50,
|
|
|
|
height: 5*SizeConfig.heightMultiplier,
|
|
|
|
width: constraints.maxWidth * 0.30,
|
|
|
|
width: constraints.maxWidth * 0.30,
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Text('LOGIN',
|
|
|
|
Text('LOGIN',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: isSmallScreen
|
|
|
|
fontSize: SizeConfig.isMobilePortrait?2*SizeConfig.textMultiplier: 2.3*SizeConfig.textMultiplier)),
|
|
|
|
? 15
|
|
|
|
|
|
|
|
: constraints.maxWidth * 0.020)),
|
|
|
|
|
|
|
|
Image.asset('assets/images/login_btn_arrow_icon.png')
|
|
|
|
Image.asset('assets/images/login_btn_arrow_icon.png')
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -310,7 +302,7 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> setSharedPref(key, value) async {
|
|
|
|
Future<void> setSharedPref(key, value) async {
|
|
|
|
sharedPref.setString(key, value).then(( success) {
|
|
|
|
sharedPref.setString(key, value).then((success) {
|
|
|
|
print("sharedPref.setString" + success.toString());
|
|
|
|
print("sharedPref.setString" + success.toString());
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|