Finish login Functionality

merge-requests/11/merge
Elham Rababah 6 years ago
parent 8a8dd6457d
commit 7e50545dd1

@ -6,6 +6,8 @@ const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://uat.hmgwebservices.com/Services'; const BASE_URL = 'https://uat.hmgwebservices.com/Services';
const GET_PROJECT = '/Lists.svc/REST/GetProject'; const GET_PROJECT = '/Lists.svc/REST/GetProject';
const LOGIN = "/Authentication.svc/REST/CheckDriverAuthentication";
class AppGlobal { class AppGlobal {

@ -11,6 +11,28 @@ const Map<String, Map<String, String>> localizedValues = {
'services': {'en': 'SERVICES', 'ar': 'الخدمات'}, 'services': {'en': 'SERVICES', 'ar': 'الخدمات'},
'mySchedule': {'en': 'My Schedule', 'ar': 'جدولي'}, 'mySchedule': {'en': 'My Schedule', 'ar': 'جدولي'},
'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'},
'booking':{'en': 'Booking','ar':'حجز'} 'booking':{'en': 'Booking','ar':'حجز'},
'enterId': {'en': 'User Name', 'ar': 'اسم المستخدم'},
'pleaseEnterYourID': {
'en': 'Please enter your ',
'ar': 'الرجاء ادخال اسم المستخدم'
},
'enterPassword': {'en': 'Password', 'ar': 'كلمه السر'},
'pleaseEnterPassword': {
'en': 'Please Enter Your Password',
'ar': 'الرجاء ادخال كلمه السر'
},
'enterCredentialsMsg': {
'en': 'Please insert username and password to login',
'ar': 'الرجاء إدخال اسم المستخدم وكلمة المرور لتسجيل الدخول'
},
'forgotPassword': {
'en': 'Forgot Password?',
'ar': 'هل نسيت كلمة المرور ؟'
},
'login': {
'en': 'Login',
'ar': 'تسجيل الدخول'
}
}; };

@ -1,282 +1,64 @@
class AuthenticatedUser { class AuthenticatedUser {
String setupID; int iD;
int patientType; int userID;
int patientID; String password;
String firstName; String userName;
String middleName; int roleID;
String lastName; String name;
String firstNameN; bool active;
String middleNameN; String createdOn;
String lastNameN;
int relationshipID;
int gender;
String dateofBirth;
dynamic dateofBirthN;
String nationalityID;
dynamic phoneResi;
dynamic phoneOffice;
String mobileNumber;
dynamic faxNumber;
String emailAddress;
dynamic bloodGroup;
dynamic rHFactor;
bool isEmailAlertRequired;
bool isSMSAlertRequired;
String preferredLanguage;
bool isPrivilegedMember;
dynamic memberID;
dynamic expiryDate;
dynamic isHmgEmployee;
dynamic employeeID;
dynamic emergencyContactName;
dynamic emergencyContactNo;
int patientPayType;
dynamic dHCCPatientRefID;
bool isPatientDummy;
int status;
dynamic isStatusCleared;
int patientIdentificationType;
String patientIdentificationNo;
int projectID;
int infoSourceID;
dynamic address;
int age;
String ageDesc;
int areaID;
int createdBy; int createdBy;
String genderDescription; Null editedOn;
dynamic iR; Null editedBy;
dynamic iSOCityID; String mobileNumber;
dynamic iSOCountryID; int realRoleID;
List<ListPrivilege> listPrivilege;
dynamic marital;
int outSA;
dynamic pOBox;
bool receiveHealthSummaryReport;
int sourceType;
dynamic strDateofBirth;
dynamic tempAddress;
dynamic zipCode;
// dynamic patientPayType;
// dynamic patientType;
// dynamic status;
AuthenticatedUser({ AuthenticatedUser(
this.setupID, {this.iD,
this.patientType, this.userID,
this.patientID, this.password,
this.firstName, this.userName,
this.middleName, this.roleID,
this.lastName, this.name,
this.firstNameN, this.active,
this.middleNameN, this.createdOn,
this.lastNameN, this.createdBy,
this.relationshipID, this.editedOn,
this.gender, this.editedBy,
this.dateofBirth, this.mobileNumber,
this.dateofBirthN, this.realRoleID});
this.nationalityID,
this.phoneResi,
this.phoneOffice,
this.mobileNumber,
this.faxNumber,
this.emailAddress,
this.bloodGroup,
this.rHFactor,
this.isEmailAlertRequired,
this.isSMSAlertRequired,
this.preferredLanguage,
this.isPrivilegedMember,
this.memberID,
this.expiryDate,
this.isHmgEmployee,
this.employeeID,
this.emergencyContactName,
this.emergencyContactNo,
this.patientPayType,
this.dHCCPatientRefID,
this.isPatientDummy,
this.status,
this.isStatusCleared,
this.patientIdentificationType,
this.patientIdentificationNo,
this.projectID,
this.infoSourceID,
this.address,
this.age,
this.ageDesc,
this.areaID,
this.createdBy,
this.genderDescription,
this.iR,
this.iSOCityID,
this.iSOCountryID,
this.listPrivilege,
this.marital,
this.outSA,
this.pOBox,
this.receiveHealthSummaryReport,
this.sourceType,
this.strDateofBirth,
this.tempAddress,
this.zipCode,
});
AuthenticatedUser.fromJson(Map<String, dynamic> json) { AuthenticatedUser.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
patientType = json['PatientType'];
patientID = json['PatientID'];
firstName = json['FirstName'];
middleName = json['MiddleName'];
lastName = json['LastName'];
firstNameN = json['FirstNameN'];
middleNameN = json['MiddleNameN'];
lastNameN = json['LastNameN'];
relationshipID = json['RelationshipID'];
gender = json['Gender'];
dateofBirth = json['DateofBirth'];
dateofBirthN = json['DateofBirthN'];
nationalityID = json['NationalityID'];
phoneResi = json['PhoneResi'];
phoneOffice = json['PhoneOffice'];
mobileNumber = json['MobileNumber'];
faxNumber = json['FaxNumber'];
emailAddress = json['EmailAddress'];
bloodGroup = json['BloodGroup'];
rHFactor = json['RHFactor'];
isEmailAlertRequired = json['IsEmailAlertRequired'];
isSMSAlertRequired = json['IsSMSAlertRequired'];
preferredLanguage = json['PreferredLanguage'];
isPrivilegedMember = json['IsPrivilegedMember'];
memberID = json['MemberID'];
expiryDate = json['ExpiryDate'];
isHmgEmployee = json['IsHmgEmployee'];
employeeID = json['EmployeeID'];
emergencyContactName = json['EmergencyContactName'];
emergencyContactNo = json['EmergencyContactNo'];
patientPayType = json['PatientPayType'];
dHCCPatientRefID = json['DHCCPatientRefID'];
isPatientDummy = json['IsPatientDummy'];
status = json['Status'];
isStatusCleared = json['IsStatusCleared'];
patientIdentificationType = json['PatientIdentificationType'];
patientIdentificationNo = json['PatientIdentificationNo'];
projectID = json['ProjectID'];
infoSourceID = json['InfoSourceID'];
address = json['Address'];
age = json['Age'];
ageDesc = json['AgeDesc'];
areaID = json['AreaID'];
createdBy = json['CreatedBy'];
genderDescription = json['GenderDescription'];
iR = json['IR'];
iSOCityID = json['ISOCityID'];
iSOCountryID = json['ISOCountryID'];
if (json['ListPrivilege'] != null) {
listPrivilege = new List<ListPrivilege>();
json['ListPrivilege'].forEach((v) {
listPrivilege.add(new ListPrivilege.fromJson(v));
});
}
marital = json['Marital'];
outSA = json['OutSA'];
pOBox = json['POBox'];
receiveHealthSummaryReport = json['ReceiveHealthSummaryReport'];
sourceType = json['SourceType'];
strDateofBirth = json['StrDateofBirth'];
tempAddress = json['TempAddress'];
zipCode = json['ZipCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['PatientType'] = this.patientType;
data['PatientID'] = this.patientID;
data['FirstName'] = this.firstName;
data['MiddleName'] = this.middleName;
data['LastName'] = this.lastName;
data['FirstNameN'] = this.firstNameN;
data['MiddleNameN'] = this.middleNameN;
data['LastNameN'] = this.lastNameN;
data['RelationshipID'] = this.relationshipID;
data['Gender'] = this.gender;
data['DateofBirth'] = this.dateofBirth;
data['DateofBirthN'] = this.dateofBirthN;
data['NationalityID'] = this.nationalityID;
data['PhoneResi'] = this.phoneResi;
data['PhoneOffice'] = this.phoneOffice;
data['MobileNumber'] = this.mobileNumber;
data['FaxNumber'] = this.faxNumber;
data['EmailAddress'] = this.emailAddress;
data['BloodGroup'] = this.bloodGroup;
data['RHFactor'] = this.rHFactor;
data['IsEmailAlertRequired'] = this.isEmailAlertRequired;
data['IsSMSAlertRequired'] = this.isSMSAlertRequired;
data['PreferredLanguage'] = this.preferredLanguage;
data['IsPrivilegedMember'] = this.isPrivilegedMember;
data['MemberID'] = this.memberID;
data['ExpiryDate'] = this.expiryDate;
data['IsHmgEmployee'] = this.isHmgEmployee;
data['EmployeeID'] = this.employeeID;
data['EmergencyContactName'] = this.emergencyContactName;
data['EmergencyContactNo'] = this.emergencyContactNo;
data['PatientPayType'] = this.patientPayType;
data['DHCCPatientRefID'] = this.dHCCPatientRefID;
data['IsPatientDummy'] = this.isPatientDummy;
data['Status'] = this.status;
data['IsStatusCleared'] = this.isStatusCleared;
data['PatientIdentificationType'] = this.patientIdentificationType;
data['PatientIdentificationNo'] = this.patientIdentificationNo;
data['ProjectID'] = this.projectID;
data['InfoSourceID'] = this.infoSourceID;
data['Address'] = this.address;
data['Age'] = this.age;
data['AgeDesc'] = this.ageDesc;
data['AreaID'] = this.areaID;
data['CreatedBy'] = this.createdBy;
data['GenderDescription'] = this.genderDescription;
data['IR'] = this.iR;
data['ISOCityID'] = this.iSOCityID;
data['ISOCountryID'] = this.iSOCountryID;
if (this.listPrivilege != null) {
data['ListPrivilege'] =
this.listPrivilege.map((v) => v.toJson()).toList();
}
data['Marital'] = this.marital;
data['OutSA'] = this.outSA;
data['POBox'] = this.pOBox;
data['ReceiveHealthSummaryReport'] = this.receiveHealthSummaryReport;
data['SourceType'] = this.sourceType;
data['StrDateofBirth'] = this.strDateofBirth;
data['TempAddress'] = this.tempAddress;
data['ZipCode'] = this.zipCode;
return data;
}
}
class ListPrivilege {
int iD;
String serviceName;
bool previlege;
dynamic region;
ListPrivilege({this.iD, this.serviceName, this.previlege, this.region});
ListPrivilege.fromJson(Map<String, dynamic> json) {
iD = json['ID']; iD = json['ID'];
serviceName = json['ServiceName']; userID = json['UserID'];
previlege = json['Previlege']; password = json['password'];
region = json['Region']; userName = json['UserName'];
roleID = json['RoleID'];
name = json['Name'];
active = json['Active'];
createdOn = json['CreatedOn'];
createdBy = json['CreatedBy'];
editedOn = json['EditedOn'];
editedBy = json['EditedBy'];
mobileNumber = json['MobileNumber'];
realRoleID = json['RealRoleID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['ID'] = this.iD; data['ID'] = this.iD;
data['ServiceName'] = this.serviceName; data['UserID'] = this.userID;
data['Previlege'] = this.previlege; data['password'] = this.password;
data['Region'] = this.region; data['UserName'] = this.userName;
data['RoleID'] = this.roleID;
data['Name'] = this.name;
data['Active'] = this.active;
data['CreatedOn'] = this.createdOn;
data['CreatedBy'] = this.createdBy;
data['EditedOn'] = this.editedOn;
data['EditedBy'] = this.editedBy;
data['MobileNumber'] = this.mobileNumber;
data['RealRoleID'] = this.realRoleID;
return data; return data;
} }
} }

@ -0,0 +1,18 @@
class LoginRequest {
int userID;
String password;
LoginRequest({this.userID, this.password});
LoginRequest.fromJson(Map<String, dynamic> json) {
userID = json['UserID'];
password = json['Password'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['UserID'] = this.userID;
data['Password'] = this.password;
return data;
}
}

@ -1,29 +1,35 @@
import 'package:driverapp/config/config.dart';
import 'package:driverapp/core/model/authentication/authenticated_user.dart';
import 'package:driverapp/core/model/authentication/login_request.dart';
import 'package:driverapp/core/service/base_service.dart'; import 'package:driverapp/core/service/base_service.dart';
import 'package:flutter/cupertino.dart';
class AuthenticationService extends BaseService { class AuthenticationService extends BaseService {
String selectedClinicName; String selectedClinicName;
bool isLogin = false; bool isLogin = false;
bool isLoading = true; bool isLoading = true;
AuthenticatedUser authenticatedUser;
String token;
AuthenticationService() { AuthenticationService() {
// getUserAuthentication(); // getUserAuthentication();
} }
// void getUserAuthentication() async { login(LoginRequest loginRequest) async {
// if (profile != null) { hasError = false;
//// doctorProfile = new DoctorProfileModel.fromJson(profile); try {
// isLoading = false; await baseAppClient.post(LOGIN,
// isLogin = true; onSuccess: (dynamic response, int statusCode) {
// } else { authenticatedUser =
// isLoading = false; AuthenticatedUser.fromJson(response['PatientER_DriverFile']);
// isLogin = false; token = response['LogInTokenID'];
// } }, onFailure: (String error, int statusCode) {
// notifyListeners(); hasError = true;
// } super.error = error;
}, body: loginRequest.toJson());
} catch (error) {
hasError = true;
super.error = error;
throw error;
}
}
} }

@ -1,5 +1,8 @@
import 'package:driverapp/config/shared_pref_kay.dart';
import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/model/authentication/login_request.dart';
import 'package:driverapp/core/service/authentication_service.dart'; import 'package:driverapp/core/service/authentication_service.dart';
import 'package:driverapp/core/service/client/base_app_client.dart';
import 'package:driverapp/core/viewModels/base_view_model.dart'; import 'package:driverapp/core/viewModels/base_view_model.dart';
import '../../locator.dart'; import '../../locator.dart';
@ -21,10 +24,17 @@ class AuthenticationViewModel extends BaseViewModel {
} }
} }
login({String userName,String password}){ login(LoginRequest loginRequest) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
// call api await _authenticationService.login(loginRequest);
// if() if (_authenticationService.hasError) {
// setState(viewState) error = _authenticationService.error;
setState(ViewState.ErrorLocal);
} else {
sharedPref.setObject(
USER_PROFILE, _authenticationService.authenticatedUser);
sharedPref.setString(TOKEN, _authenticationService.token);
setState(ViewState.Idle);
}
} }
} }

@ -1,21 +1,34 @@
import 'package:driverapp/app-icons/driver_app_icons.dart'; import 'package:driverapp/app-icons/driver_app_icons.dart';
import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/model/authentication/login_request.dart';
import 'package:driverapp/core/viewModels/authentication_view_model.dart'; import 'package:driverapp/core/viewModels/authentication_view_model.dart';
import 'package:driverapp/core/viewModels/project_view_model.dart';
import 'package:driverapp/pages/base/base_view.dart'; import 'package:driverapp/pages/base/base_view.dart';
import 'package:driverapp/pages/landing/landing_page.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:driverapp/uitl/utils.dart';
import 'package:driverapp/widgets/buttons/secondary_button.dart'; import 'package:driverapp/widgets/buttons/secondary_button.dart';
import 'package:driverapp/widgets/data_display/circle-container.dart';
import 'package:driverapp/widgets/input/text_field.dart'; import 'package:driverapp/widgets/input/text_field.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart';
class LoginPage extends StatelessWidget { class LoginPage extends StatelessWidget {
LoginRequest loginRequest = LoginRequest();
final loginFormKey = GlobalKey<FormState>();
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AnimatedSwitcher( return AnimatedSwitcher(
duration: Duration(microseconds: 350), duration: Duration(microseconds: 350),
child: BaseView<AuthenticationViewModel>( child: BaseView<AuthenticationViewModel>(
builder: (_, model, widget) => Scaffold( builder: (_, model, widget) => Scaffold(
//baseViewModel: model, //baseViewModel: model,
body: Center( body: Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -37,8 +50,12 @@ class LoginPage extends StatelessWidget {
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
), ),
margin: EdgeInsets.only( margin: EdgeInsets.only(
right: right: projectViewModel.isArabic
MediaQuery.of(context).size.width * 0.15), ? 0
: MediaQuery.of(context).size.width * 0.15,
left: !projectViewModel.isArabic
? 0
: MediaQuery.of(context).size.width * 0.15),
), ),
], ],
), ),
@ -72,80 +89,127 @@ class LoginPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
CircleContainer( CircleContainer(
child: Text( onTap: () => projectViewModel.changeLanguage('en'),
"English", child: Text(
style: TextStyle( TranslationBase.of(context).lanEnglish,
fontSize: 12, color: Colors.white), style: TextStyle(
), fontSize: 12,
color: Theme.of(context).primaryColor, borderWidth: 0,borderColor: Colors.transparent,), color: projectViewModel.isArabic
? Colors.black
: Colors.white),
),
color: projectViewModel.isArabic
? Colors.transparent
: Theme.of(context).primaryColor,
borderWidth: projectViewModel.isArabic ? 3 : 0,
borderColor: projectViewModel.isArabic
? Theme.of(context).primaryColor
: Colors.transparent,
),
SizedBox( SizedBox(
width: 20, width: 20,
), ),
CircleContainer( CircleContainer(
onTap: () =>
projectViewModel.changeLanguage('ar'),
child: Text( child: Text(
"Arabic", TranslationBase.of(context).lanArabic,
style: TextStyle( style: TextStyle(
fontSize: 12, color: Colors.black), fontSize: 12,
color: !projectViewModel.isArabic
? Colors.black
: Colors.white),
), ),
color: Colors.transparent, borderColor: Theme.of(context).primaryColor,borderWidth: 3,), color: !projectViewModel.isArabic
? Colors.transparent
: Theme.of(context).primaryColor,
borderWidth: !projectViewModel.isArabic ? 3 : 0,
borderColor: !projectViewModel.isArabic
? Theme.of(context).primaryColor
: Colors.transparent),
], ],
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Column( Form(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, key: loginFormKey,
children: <Widget>[ child: Column(
Padding( mainAxisAlignment: MainAxisAlignment.spaceEvenly,
padding: const EdgeInsets.symmetric(horizontal: 20), children: <Widget>[
child: Row( Padding(
padding:
const EdgeInsets.symmetric(horizontal: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Text(
TranslationBase.of(context).enterCredentialsMsg,
style: TextStyle(
fontSize: 13, color: Colors.grey),
),
SizedBox(
height: 10,
)
],
),
),
SizedBox(
height: 10,
),
Container(
child: TextFields(
onChanged: (value) => {},
hintText: TranslationBase.of(context).enterId,
validator: (value) {
if (value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterYourID;
}
return null;
},
onSaved: (value) {
loginRequest.userID = int.parse(value.trim());
},
),
),
SizedBox(
height: 20,
),
Container(
child: TextFields(
borderRadiusValue: 6,
onChanged: (value) => {},
hintText:
TranslationBase.of(context).enterPassword,
validator: (value) {
if (value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterPassword;
}
return null;
},
onSaved: (value) {
loginRequest.password = value;
},
),
),
SizedBox(
height: 25,
),
Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Text( Text(
"Please insert username and password to login", TranslationBase.of(context).forgotPassword,
style: TextStyle( style: TextStyle(
fontSize: 13, color: Colors.grey), fontSize: 14,
color: Theme.of(context).primaryColor),
), ),
SizedBox(
height: 10,
)
], ],
), ),
), ],
SizedBox( ),
height: 10,
),
Container(
child: TextFields(
onChanged: (value) => {},
hintText: "User Name",
),
),
SizedBox(
height: 20,
),
Container(
child: TextFields(
borderRadiusValue: 6,
onChanged: (value) => {},
hintText: "Password",
),
),
SizedBox(
height: 25,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Text(
"Forgot Password?",
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColor),
),
],
),
],
), ),
], ],
), ),
@ -164,7 +228,14 @@ class LoginPage extends StatelessWidget {
height: MediaQuery.of(context).size.height * 0.12, height: MediaQuery.of(context).size.height * 0.12,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SecondaryButton(label: "Login"), SecondaryButton(
label: TranslationBase.of(context).login,
onTap: () {
login(model, context);
},
disabled: model.state == ViewState.BusyLocal,
loading: model.state == ViewState.BusyLocal,
),
SizedBox( SizedBox(
height: 30, height: 30,
) )
@ -174,32 +245,19 @@ class LoginPage extends StatelessWidget {
), ),
); );
} }
}
class CircleContainer extends StatelessWidget {
const CircleContainer(
{this.child,
this.color = Colors.white,
this.borderColor,
this.borderWidth = 2.0});
final Widget child; login(AuthenticationViewModel model, BuildContext context) async {
final Color color; if (loginFormKey.currentState.validate()) {
final Color borderColor; loginFormKey.currentState.save();
final double borderWidth; await model.login(loginRequest);
if (model.state == ViewState.ErrorLocal) {
@override Utils.showErrorToast(model.error);
Widget build(BuildContext context) { // Show error
return Container( } else {
child: Center(child: child), Navigator.push(
decoration: BoxDecoration( context, MaterialPageRoute(builder: (context) => LandingPage()));
shape: BoxShape.circle, }
color: color, }
border: Border.all(
color: borderColor ?? Hexcolor("#707070"),
width: borderWidth)),
height: 60,
width: 60,
);
} }
} }

@ -39,6 +39,19 @@ class TranslationBase {
String get logout => localizedValues['logout'][locale.languageCode]; String get logout => localizedValues['logout'][locale.languageCode];
String get booking => localizedValues['booking'][locale.languageCode]; String get booking => localizedValues['booking'][locale.languageCode];
String get enterId => localizedValues['enterId'][locale.languageCode];
String get pleaseEnterYourID =>
localizedValues['pleaseEnterYourID'][locale.languageCode];
String get enterPassword =>
localizedValues['enterPassword'][locale.languageCode];
String get pleaseEnterPassword =>
localizedValues['pleaseEnterPassword'][locale.languageCode];
String get english => localizedValues['english'][locale.languageCode];
String get arabic => localizedValues['arabic'][locale.languageCode];
String get enterCredentialsMsg => localizedValues['enterCredentialsMsg'][locale.languageCode];
String get forgotPassword => localizedValues['forgotPassword'][locale.languageCode];
String get login => localizedValues['login'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -0,0 +1,34 @@
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class CircleContainer extends StatelessWidget {
const CircleContainer(
{this.child,
this.color = Colors.white,
this.borderColor,
this.borderWidth = 2.0,
this.onTap});
final Widget child;
final Color color;
final Color borderColor;
final double borderWidth;
final Function onTap;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
child: Container(
child: Center(child: child),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: color,
border: Border.all(
color: borderColor ?? Hexcolor("#707070"), width: borderWidth)),
height: 60,
width: 60,
),
);
}
}
Loading…
Cancel
Save