Merge branch 'master' into 'develop'

# Conflicts:
#   lib/routes.dart
merge-requests/6/head
ibrahim albitar 6 years ago
commit 31c4692594

4
.gitignore vendored

@ -18,7 +18,7 @@
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
.vscode/
# Flutter/Dart/Pub related
**/doc/api/
@ -35,3 +35,5 @@ lib/generated_plugin_registrant.dart
# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
.vscode/settings.json
.vscode/settings.json

@ -0,0 +1,16 @@
{
"commentBox.styles": {
"defaultStyle": {
"commentStartToken": "/* \n *@author: Elham Rababah \n *@Date:13/4/1993 \n *@param: \n *@return:\n *@desc: ",
"commentEndToken": "\n */",
"leftEdgeToken": " * ",
"rightEdgeToken": "",
"topEdgeToken": "",
"bottomEdgeToken": "",
"topRightToken": "",
"bottomLeftToken": "",
"capitalize": false,
"textAlignment": "left"
}}
}

@ -5,6 +5,8 @@ class SizeConfig {
static double _blockWidth = 0;
static double _blockHeight = 0;
static double realScreenWidth;
static double realScreenHeight;
static double screenWidth;
static double screenHeight;
static double textMultiplier;
@ -17,33 +19,40 @@ class SizeConfig {
static bool isMobile = false;
void init(BoxConstraints constraints, Orientation orientation) {
realScreenHeight = constraints.maxHeight;
realScreenWidth = constraints.maxWidth;
screenHeight = constraints.maxHeight;
screenWidth = constraints.maxWidth;
_blockWidth = screenWidth / 100;
_blockHeight = screenHeight / 100;
if(constraints.maxWidth<= MAX_SMALL_SCREEN){
if (constraints.maxWidth <= MAX_SMALL_SCREEN) {
isMobile = true;
}
if (orientation == Orientation.portrait) {
isPortrait = true;
if (screenWidth < 450) {
if (realScreenWidth < 450) {
isMobilePortrait = true;
}
textMultiplier = _blockHeight;
imageSizeMultiplier = _blockWidth;
// textMultiplier = _blockHeight;
// imageSizeMultiplier = _blockWidth;
screenHeight = realScreenHeight;
screenWidth = realScreenWidth;
} else {
isPortrait = false;
isMobilePortrait = false;
textMultiplier = _blockWidth;
imageSizeMultiplier = _blockHeight;
// textMultiplier = _blockWidth;
// imageSizeMultiplier = _blockHeight;
screenHeight = realScreenWidth;
screenWidth = realScreenHeight;
}
_blockWidth = screenWidth / 100;
_blockHeight = screenHeight / 100;
textMultiplier = _blockHeight;
imageSizeMultiplier = _blockWidth;
heightMultiplier = _blockHeight;
widthMultiplier = _blockWidth;
print('screenWidth $screenWidth');
print('screenHeight $screenHeight');
print('realScreenWidth $realScreenWidth');
print('realScreenHeight $realScreenHeight');
print('textMultiplier $textMultiplier');
print('imageSizeMultiplier $imageSizeMultiplier');
print('heightMultiplier$heightMultiplier');

@ -1 +1,7 @@
enum loginType { knownUser, unknownUser, changePassword, verifyPassword }
enum loginType {
knownUser,
unknownUser,
changePassword,
verifyPassword,
verificationMethods
}

@ -31,7 +31,7 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.blue,
primaryColor: Hexcolor('#B8382C'),
buttonColor: Hexcolor('#B8382C'),
fontFamily: 'WorkSans'),
fontFamily: 'WorkSans',),
initialRoute: INIT_ROUTE,
routes: routes,
),

@ -1,7 +1,8 @@
import 'package:doctor_app_flutter/screens/settings/settings_screen.dart';
import './screens/QR_reader_screen.dart';
import './screens/auth/change_password_screen.dart';
import './screens/auth/login_screen.dart';
import './screens/auth/verification_methods_screen.dart';
import './screens/auth/verify_account_screen.dart';
import './screens/blood_bank_screen.dart';
import './screens/doctor_reply_screen.dart';
import './screens/dashboard_screen.dart';
@ -9,14 +10,14 @@ import './screens/medicine/medicine_search_screen.dart';
import './screens/my_schedule_screen.dart';
import './screens/patients/patient_search_screen.dart';
import './screens/patients/patients_list_screen.dart';
import './screens/auth/change_password_screen.dart';
import './screens/auth/verify_account_screen.dart';
import './screens/settings/settings_screen.dart';
const String INIT_ROUTE = LOGIN;
const String HOME = '/';
const String LOGIN = 'login';
const String CHANGE_PASSWORD = 'change-password';
const String VERIFY_ACCOUNT = 'verify-account';
const String VERIFICATION_METHODS ='verification-methods';
const String MY_SCHEDULE = 'my-schedule';
const String QR_READER = 'qr-reader';
const String PATIENT_SEARCH = 'patients/patient-search';
@ -39,4 +40,5 @@ var routes = {
SETTINGS: (_) => SettingsScreen(),
CHANGE_PASSWORD: (_) => ChangePasswordScreen(),
VERIFY_ACCOUNT: (_) => VerifyAccountScreen(),
VERIFICATION_METHODS:(_)=> VerificationMethodsScreen(),
};

@ -2,24 +2,26 @@ import 'package:doctor_app_flutter/lookups/auth_lookup.dart';
import 'package:doctor_app_flutter/widgets/auth/auth_header.dart';
import 'package:flutter/material.dart';
import '../../widgets/auth/change_password.dart';
class ChangePasswordScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
// return Container()];
return Scaffold(
backgroundColor: Colors.white,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.changePassword),
ChangePassword(),
],
),
body: SafeArea(
child: ListView(children: <Widget>[
Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.changePassword),
ChangePassword(),
],
),
));
),
]),
));
}
}

@ -11,12 +11,12 @@ import '../../widgets/auth/login_form.dart';
import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class Loginsreen extends StatefulWidget {
@override
_LoginsreenState createState() => _LoginsreenState();
}
class _LoginsreenState extends State<Loginsreen> {
Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
@ -25,7 +25,7 @@ class _LoginsreenState extends State<Loginsreen> {
Future<String> platformImeiFuture;
Future<void> getSharedPref() async {
sharedPref.getString('platformImei').then((imei){
sharedPref.getString('platformImei').then((imei) {
platformImei = imei;
});
}
@ -42,45 +42,46 @@ class _LoginsreenState extends State<Loginsreen> {
Widget build(BuildContext context) {
getSharedPref();
return Scaffold(
backgroundColor: Colors.white,
body: SingleChildScrollView(
child: FutureBuilder(
future: platformImeiFuture,
builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return DrAppCircularProgressIndeicator();
default:
if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
} else {
return Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 0, 0),
alignment: Alignment.topLeft,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
(platformImei == null)
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
body: SafeArea(
child: ListView(children: <Widget>[
FutureBuilder(
future: platformImeiFuture,
builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return DrAppCircularProgressIndeicator();
default:
if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
} else {
return Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 0, 0),
alignment: Alignment.topLeft,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
(platformImei == null)
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.knownUser),
LoginForm(),
],
)
: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.unknownUser),
KnownUserLogin(),
],
),
]));
}
}
}),
LoginForm(),
],
)
: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.unknownUser),
KnownUserLogin(),
],
),
]));
}
}
}),
]),
),
);
}

@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
import '../../lookups/auth_lookup.dart';
import '../../widgets/auth/auth_header.dart';
import '../../widgets/auth/verification_methods.dart';
/*
*@author: Elham Rababah
*@Date:4/7/2020
*@param:
*@return:
*@desc: Verification Methods screen
*/
class VerificationMethodsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
// return Container()];
return Scaffold(
body: ListView(children: <Widget>[
Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.verificationMethods),
VerificationMethods(),
],
),
),
]));
}
}

@ -1,24 +1,27 @@
import 'package:doctor_app_flutter/lookups/auth_lookup.dart';
import 'package:doctor_app_flutter/widgets/auth/auth_header.dart';
import 'package:flutter/material.dart';
import '../../lookups/auth_lookup.dart';
import '../../widgets/auth/auth_header.dart';
import '../../widgets/auth/verfiy_account.dart';
class VerifyAccountScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
// return Container()];
return Scaffold(
backgroundColor: Colors.white,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.verifyPassword),
// ChangePassword(),
],
),
body: SafeArea(
child: ListView(children: <Widget>[
Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.verifyPassword),
VerifyAccount(),
],
),
));
),
]),
));
}
}

@ -0,0 +1,59 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
/*
*@author: Elham Rababah
*@Date:12/4/2020
*@param:
*@return:
*@desc: This class will contian some Function will help developer
*/
class Helpers {
/*
*@author: Elham Rababah
*@Date:12/4/2020
*@param: context, items, decKey, onSelectFun
*@return: Container Widget
*@desc: showCupertinoPicker its a general function to show cupertino picker
*/
showCupertinoPicker(context, items, decKey, onSelectFun) {
showModalBottomSheet(
context: context,
builder: (BuildContext builder) {
return Container(
height: SizeConfig.realScreenHeight * .3,
child: buildPickerItems(context, items, decKey, onSelectFun));
});
}
/*
*@author: Elham Rababah
*@Date:12/4/2020
*@param: context, List items, decKey, onSelectFun
*@return: Container widget
*@desc: buildPickerIterm this function will build the items of the cupertino
*/
buildPickerItems(context, List items, decKey, onSelectFun) {
return Container(
child: CupertinoPicker(
magnification: 1.5,
// backgroundColor: Colors.black87,
children: items.map((item) {
return Text(
'${item["$decKey"]}',
style:
TextStyle(color: Theme.of(context).primaryColor, fontSize: 20),
);
}).toList(),
itemExtent: 25, //height of each item
looping: true,
onSelectedItemChanged: (int index) {
// selectitem =index;
onSelectFun(index);
},
),
);
}
}

@ -13,8 +13,8 @@ class AuthHeader extends StatelessWidget {
var screen = Container(
margin: SizeConfig.isMobile
? null
: EdgeInsetsDirectional.fromSTEB(SizeConfig.screenWidth * 0.30,
SizeConfig.screenWidth * 0.1, 0, 0),
: EdgeInsetsDirectional.fromSTEB(SizeConfig.realScreenWidth * 0.30,
SizeConfig.realScreenWidth * 0.1, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
@ -25,19 +25,13 @@ class AuthHeader extends StatelessWidget {
margin: SizeConfig.isMobile
? EdgeInsetsDirectional.fromSTEB(0, 50, 0, 0)
: EdgeInsetsDirectional.fromSTEB(
SizeConfig.screenWidth * 0.13, 0, 0, 0),
SizeConfig.realScreenWidth * 0.13, 0, 0, 0),
child: buildImageLogo(),
),
SizedBox(
height: 10,
),
Container(
margin: SizeConfig.isMobile
? null
: EdgeInsetsDirectional.fromSTEB(
SizeConfig.screenWidth * 0.13, 0, 0, 0),
child: buildTextUnderLogo(context),
)
buildTextUnderLogo(context),
],
),
Column(
@ -74,70 +68,97 @@ class AuthHeader extends StatelessWidget {
if (userType == loginType.unknownUser) {
img = 'assets/images/welcome_login_icon.png';
}
if (userType == loginType.verifyPassword ||
userType == loginType.verificationMethods) {
img = 'assets/images/verified_icon.png';
}
return Image.asset(
img,
fit: BoxFit.cover,
height: SizeConfig.isMobile ? null : SizeConfig.screenWidth * 0.09,
height: SizeConfig.isMobile ? null : SizeConfig.realScreenWidth * 0.09,
);
}
Widget buildTextUnderLogo(context) {
Widget finalWid;
double textFontSize =
SizeConfig.isMobile ? 30 : SizeConfig.textMultiplier * 3;
EdgeInsetsDirectional containerMargin;
if (userType == loginType.knownUser || userType == loginType.unknownUser) {
return Text(
finalWid = Text(
"LOGIN",
style: TextStyle(
fontSize: SizeConfig.isMobile ? 30 : SizeConfig.screenWidth * 0.035,
fontWeight: FontWeight.w800),
style: TextStyle(fontSize: textFontSize, fontWeight: FontWeight.w800),
);
} else {
String text1;
String text2;
if (userType == loginType.changePassword) {
text1 = 'Change';
text1 = 'Change ';
text2 = 'Password!';
}
if (userType == loginType.verifyPassword) {
text1 = 'verify';
text1 = 'Verify ';
text2 = 'Your Account!';
}
if (userType == loginType.verificationMethods) {
text1 = 'Choose ';
text2 = 'Verification';
}
List<Widget> childrens = <Widget>[
Text(
text1,
style: TextStyle(fontSize: textFontSize, fontWeight: FontWeight.w800),
),
Text(
text2,
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: textFontSize,
fontWeight: FontWeight.w800),
)
];
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
text1,
style: TextStyle(
fontSize:
SizeConfig.isMobile ? 30 : SizeConfig.screenWidth * 0.035,
fontWeight: FontWeight.w800),
),
Text(
text2,
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize:
SizeConfig.isMobile ? 30 : SizeConfig.screenWidth * 0.035,
fontWeight: FontWeight.w800),
)
],
);
if (!SizeConfig.isMobile) {
finalWid = Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: childrens,
);
} else {
finalWid = Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: childrens,
);
}
}
if (!SizeConfig.isMobile) {
double start = SizeConfig.realScreenWidth * 0.13;
if (loginType.verifyPassword == userType ||
loginType.changePassword == userType ||
userType == loginType.verificationMethods) {
start = 0;
}
containerMargin = EdgeInsetsDirectional.fromSTEB(start, 0, 0, 0);
}
return Container(margin: containerMargin, child: finalWid);
}
Container buildDrAppContainer(BuildContext context) {
if (userType == loginType.changePassword || userType == loginType.verifyPassword ) {
if (userType == loginType.changePassword ||
userType == loginType.verifyPassword ||
userType == loginType.verificationMethods) {
return Container();
}
return Container(
margin: SizeConfig.isMobile
? null
: EdgeInsetsDirectional.fromSTEB(
SizeConfig.screenWidth * 0.13, 0, 0, 0),
SizeConfig.realScreenWidth * 0.13, 0, 0, 0),
child: Text(
"Doctor App",
style: TextStyle(
fontSize: SizeConfig.isMobile ? 26 : SizeConfig.screenWidth * 0.030,
fontSize: SizeConfig.isMobile ? 26 : SizeConfig.realScreenWidth * 0.030,
fontWeight: FontWeight.w800,
color: Theme.of(context).primaryColor),
),
@ -145,14 +166,16 @@ class AuthHeader extends StatelessWidget {
}
Text buildDrSulText(BuildContext context) {
if (userType == loginType.changePassword || userType == loginType.verifyPassword ) {
if (userType == loginType.changePassword ||
userType == loginType.verifyPassword ||
userType == loginType.verificationMethods) {
return Text('');
}
return Text(
'Dr Sulaiman Al Habib',
style: TextStyle(
fontWeight: FontWeight.w800,
fontSize: SizeConfig.isMobile ? 24 : SizeConfig.screenWidth * 0.029,
fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029,
color: Theme.of(context).primaryColor,
),
);
@ -163,13 +186,15 @@ class AuthHeader extends StatelessWidget {
if (userType == loginType.unknownUser) {
text = 'Welcome Back to ';
}
if (userType == loginType.changePassword || userType == loginType.verifyPassword ) {
if (userType == loginType.changePassword ||
userType == loginType.verifyPassword ||
userType == loginType.verificationMethods) {
return Text('');
}
return Text(
text,
style: TextStyle(
fontSize: SizeConfig.isMobile ? 24 : SizeConfig.screenWidth * 0.029),
fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029),
);
}
}

@ -15,7 +15,7 @@ class ChangePassword extends StatelessWidget {
return Form(
key: changePassFormKey,
child: Container(
width: SizeConfig.widthMultiplier * 90,
width: SizeConfig.realScreenWidth * 0.90,
child:
Column(crossAxisAlignment: CrossAxisAlignment.start, children: <
Widget>[

@ -128,14 +128,16 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
['MemberName'],
style: TextStyle(
color: Hexcolor('515A5D'),
fontSize: 2.5 *SizeConfig.textMultiplier,
fontSize:
2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w800),
),
Text(
'ENT Spec',
style: TextStyle(
color: Hexcolor('515A5D'),
fontSize: 1.5 *SizeConfig.textMultiplier),
fontSize:
1.5 * SizeConfig.textMultiplier),
)
],
),
@ -193,7 +195,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
// textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 2.5 *SizeConfig.textMultiplier),
fontSize: 2.5 * SizeConfig.textMultiplier),
),
),
),
@ -219,7 +221,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
"More verification Options".toUpperCase(),
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 2.5 *SizeConfig.textMultiplier),
fontSize: 2.5 * SizeConfig.textMultiplier),
)),
),
SizedBox(
@ -231,7 +233,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
}
navigateToMoreOption() {
Navigator.of(context).pushNamed('routeName');
Navigator.of(context).pushNamed(VERIFICATION_METHODS);
}
_authenticate() {

@ -1,3 +1,5 @@
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
@ -15,7 +17,7 @@ import '../../util/dr_app_toast_msg.dart';
DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
DrAppToastMsg toastMsg = DrAppToastMsg();
Helpers helpers = Helpers();
class LoginForm extends StatefulWidget with DrAppToastMsg {
LoginForm({
Key key,
@ -27,6 +29,7 @@ class LoginForm extends StatefulWidget with DrAppToastMsg {
class _LoginFormState extends State<LoginForm> {
final loginFormKey = GlobalKey<FormState>();
var projectIdController = TextEditingController();
String _platformImei = 'Unknown';
String uniqueId = "Unknown";
var projectsList = [];
@ -57,13 +60,14 @@ class _LoginFormState extends State<LoginForm> {
return Form(
key: loginFormKey,
child: Container(
width: SizeConfig.widthMultiplier * 90,
width: SizeConfig.realScreenWidth * 0.90,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
buildSizedBox(),
TextFormField(
keyboardType: TextInputType.number,
// style: TextStyle(fontSize: 30),
decoration: InputDecoration(
prefixIcon: Image.asset('assets/images/user_id_icon.png'),
hintText: 'Enter ID',
@ -118,14 +122,17 @@ class _LoginFormState extends State<LoginForm> {
userInfo.Password = value;
}),
buildSizedBox(),
DropdownButtonFormField(
value: userInfo.ProjectID,
isExpanded: false,
TextFormField(
controller: projectIdController,
onTap: () {
helpers.showCupertinoPicker(
context,projectsList, 'Desciption', onSelectProject);
},
showCursor: false,
readOnly: true,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(10),
isDense: true,
prefixIcon: Image.asset('assets/images/hospital_icon.png'),
// hintText: 'Enter Password',
prefixIcon: Image.asset('assets/images/password_icon.png'),
hintText: 'Select your porject',
hintStyle:
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder(
@ -140,25 +147,13 @@ class _LoginFormState extends State<LoginForm> {
//BorderRadius.all(Radius.circular(20));
),
validator: (value) {
print(value);
if (value == null) {
return 'Please select your project';
if (value.isEmpty) {
return 'Please enter your porject';
}
return null;
},
items: projectsList.map((item) {
return DropdownMenuItem(
child: Text(
'${item['Desciption']}',
),
value: item['ID'],
);
}).toList(),
onChanged: (value) {
print(value);
setState(() {
userInfo.ProjectID = value;
});
onSaved: (value) {
userInfo.Password = value;
}),
buildSizedBox(),
Row(
@ -180,7 +175,9 @@ class _LoginFormState extends State<LoginForm> {
),
RaisedButton(
onPressed: () {
login(context, authProv);
Navigator.of(context).pushNamed(VERIFICATION_METHODS);
// login(context, authProv);
},
textColor: Colors.white,
elevation: 0.0,
@ -191,7 +188,7 @@ class _LoginFormState extends State<LoginForm> {
child: Container(
padding: const EdgeInsets.all(10.0),
height: 50,
width: SizeConfig.widthMultiplier * 30,
width: SizeConfig.realScreenWidth * 0.30,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
@ -259,7 +256,7 @@ class _LoginFormState extends State<LoginForm> {
if (res['MessageStatus'] == 1) {
setSharedPref('platformImei', _platformImei);
saveObjToString('loggedUser', preRes);
Navigator.of(context).pushNamed(HOME);
Navigator.of(context).pushNamed(VERIFICATION_METHODS);
// save imei on shared preferance
} else {
// handel error
@ -331,4 +328,12 @@ class _LoginFormState extends State<LoginForm> {
saveObjToString(String key, value) async {
sharedPref.setObj(key, value);
}
onSelectProject(index) {
setState(() {
userInfo.ProjectID = projectsList[index]["ID"];
projectIdController.text = projectsList[index]['Desciption'];
});
}
}

@ -0,0 +1,169 @@
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../config/size_config.dart';
import '../../routes.dart';
class VerifyAccount extends StatelessWidget {
final verifyAccountForm = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
return Form(
key: verifyAccountForm,
child: Container(
width: SizeConfig.realScreenWidth * 0.90,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
buildSizedBox(30),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Container(
width:SizeConfig.realScreenWidth*0.20,
child: TextFormField(
decoration: InputDecoration(
// ts/images/password_icon.png
contentPadding:
EdgeInsets.only(top: 30, bottom: 30),
enabledBorder: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(
color: Theme.of(context).primaryColor),
)),
onChanged: (_) {},
)),
Container(
width:SizeConfig.realScreenWidth*0.20,
child: TextFormField(
decoration: InputDecoration(
// ts/images/password_icon.png
contentPadding:
EdgeInsets.only(top: 30, bottom: 30),
enabledBorder: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(
color: Theme.of(context).primaryColor),
)),
onChanged: (_) {},
)),
Container(
width:SizeConfig.realScreenWidth*0.20,
child: TextFormField(
decoration: InputDecoration(
// ts/images/password_icon.png
contentPadding:
EdgeInsets.only(top: 30, bottom: 30),
enabledBorder: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(
color: Theme.of(context).primaryColor),
)),
onChanged: (_) {},
)),
Container(
width:SizeConfig.realScreenWidth*0.20,
child: TextFormField(
decoration: InputDecoration(
// ts/images/password_icon.png
contentPadding:
EdgeInsets.only(top: 30, bottom: 30),
enabledBorder: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(
color: Theme.of(context).primaryColor),
)),
onChanged: (_) {},
))
],
),
// buildSizedBox(40),
buildSizedBox(20),
buildText(),
// buildSizedBox(10.0),
// Text()
buildSizedBox(40),
// buildSizedBox(),
RaisedButton(
onPressed: () {
Navigator.of(context).pushNamed(HOME);
},
elevation: 0.0,
child: Container(
width: double.infinity,
height: 50,
child: Center(
child: Text(
'Verfiy'.toUpperCase(),
// textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 3 * SizeConfig.textMultiplier),
),
),
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side:
BorderSide(width: 0.5, color: Hexcolor('#CCCCCC'))),
),
buildSizedBox(20),
Center(
child: Text(
"Resend in 4.20",
style: TextStyle(
fontSize: 3.0 * SizeConfig.textMultiplier,
),
),
),
buildSizedBox(10),
])));
}
RichText buildText() {
var text = RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 3.0 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[
new TextSpan(text: 'You will receive a '),
new TextSpan(
text: 'Login Code ',
style: TextStyle(fontWeight: FontWeight.w700)),
new TextSpan(text: 'By SMS, Please enter the code')
]));
return text;
}
SizedBox buildSizedBox([double height = 20]) {
return SizedBox(
height: height,
);
}
}

@ -0,0 +1,126 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
/*
*@author: Elham Rababah
*@Date:4/7/2020
*@param:
*@return:
*@desc: Verification Methods widget
*/
class VerificationMethods extends StatelessWidget {
MainAxisAlignment spaceBetweenMethods =MainAxisAlignment.spaceBetween;
@override
Widget build(BuildContext context) {
// if(!SizeConfig.isMobile) {
// spaceBetweenMethods = MainAxisAlignment.spaceAround;
// }
return Container(
width: SizeConfig.realScreenWidth * 0.90,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"Please choose one of the Following option to verify",
style: TextStyle(
fontSize: 3.5 * SizeConfig.textMultiplier,
),
),
SizedBox(
height: 40,
),
Container(
width: SizeConfig.realScreenWidth * 80,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment: spaceBetweenMethods,
children: <Widget>[
buildVerificationMethod(context,
'assets/images/verification_fingerprint_icon.png',
'Fingerprint',
() {}),
buildVerificationMethod(context,
'assets/images/verification_faceid_icon.png',
'Face ID',
() {}),
],
),
SizedBox(
height: 40,
),
Row(
mainAxisAlignment: spaceBetweenMethods,
children: <Widget>[
buildVerificationMethod(context,
'assets/images/verification_whatsapp_icon.png',
'WhatsApp',
() {}),
buildVerificationMethod(context,
'assets/images/verification_sms_icon.png',
'SMS',
() {}),
],
)
],
),
),
SizedBox(
height: SizeConfig.heightMultiplier * 2,
)
],
),
);
}
/*
*@author: Elham Rababah
*@Date:07/4/2020
*@param: url , dec, fun
*@return: InkWell widget
*@desc: Build Verification Method
*/
InkWell buildVerificationMethod(context,url, dec, fun) {
return InkWell(
onTap: (){
Navigator.of(context).pushNamed(VERIFY_ACCOUNT);
},
child: Container(
// height: SizeConfig.heightMultiplier *2,
height: SizeConfig.heightMultiplier * 19,
width: SizeConfig.widthMultiplier * 37,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 1,
color: Hexcolor(
'#CCCCCC') // <--- border width here
),
borderRadius: BorderRadius.all(Radius.circular(10))),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsetsDirectional.only(
top: SizeConfig.heightMultiplier * 0.5),
child: Image.asset(
url,
height: SizeConfig.heightMultiplier * 10,
fit: BoxFit.cover,
),
),
SizedBox(
height: 10,
),
Text(dec, style: TextStyle(fontSize:SizeConfig.textMultiplier*2 ),)
],
),
),
);
}
}

@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
version: "2.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "0.39.4"
version: "0.39.5"
archive:
dependency: transitive
description:
@ -84,7 +84,7 @@ packages:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.3"
version: "1.3.4"
build_runner:
dependency: "direct dev"
description:
@ -182,7 +182,7 @@ packages:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.3"
version: "1.3.4"
fixnum:
dependency: transitive
description:
@ -316,7 +316,7 @@ packages:
name: io
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.3"
version: "0.3.4"
js:
dependency: transitive
description:
@ -387,13 +387,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
package_resolver:
dependency: transitive
description:
name: package_resolver
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.10"
path:
dependency: transitive
description:

@ -69,8 +69,13 @@ flutter:
- assets/images/verification_faceid_lg_icon.png
- assets/images/verification_sms_lg_icon.png
- assets/images/verification_whatsapp_lg_icon.png
- assets/images/verification_fingerprint_icon.png
- assets/images/verification_faceid_icon.png
- assets/images/verification_sms_icon.png
- assets/images/verification_whatsapp_icon.png
- assets/images/close_icon.png
- assets/images/welcome_login_icon.png
- assets/images/verified_icon.png
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see

Loading…
Cancel
Save