no auth ui modifications

merge-update-with-lab-changes
Sikander Saleem 5 years ago
parent 907d90b987
commit 53e4815866

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 259 KiB

Before

Width:  |  Height:  |  Size: 467 B

After

Width:  |  Height:  |  Size: 467 B

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 838 B

After

Width:  |  Height:  |  Size: 838 B

@ -9,8 +9,7 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_mod
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as list;
as list;
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -26,6 +25,7 @@ import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -50,15 +50,12 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
var userID; var userID;
TabController _tabController; TabController _tabController;
int _tabIndex = 0; int _tabIndex = 0;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>(); AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
AppointmentRateViewModel appointmentRateViewModel =
locator<AppointmentRateViewModel>();
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
AuthenticatedUser user; AuthenticatedUser user;
VitalSignService _vitalSignService = locator<VitalSignService>(); VitalSignService _vitalSignService = locator<VitalSignService>();
PharmacyModuleViewModel pharmacyModuleViewModel = PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
locator<PharmacyModuleViewModel>();
var isVaiable = false; var isVaiable = false;
@override @override
@ -73,24 +70,33 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget build(BuildContext context) { Widget build(BuildContext context) {
imagesInfo.add( imagesInfo.add(
ImagesInfo( ImagesInfo(
imageEn: imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'),
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'),
); );
imagesInfo.add( imagesInfo.add(
ImagesInfo( ImagesInfo(
imageEn: imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'),
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'),
); );
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
if (!projectViewModel.isLogin) {
Navigator.push(
context,
MaterialPageRoute(
builder: (cxt) => NotAutPage(
title: TranslationBase.of(context).myFamilyFiles,
description: TranslationBase.of(context).familyInfo,
infoList: [],
imagesInfo: [],
icon: "assets/images/new/bottom_nav/family_files.svg",
)));
return Container();
}
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).myFamilyFiles, appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: widget.isAppbarVisible, isShowAppBar: widget.isAppbarVisible,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
icon: "assets/images/new/bottom_nav/family_files.svg",
description: TranslationBase.of(context).familyInfo, description: TranslationBase.of(context).familyInfo,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
@ -105,9 +111,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: BackdropFilter( child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Container( child: Container(
color: Theme.of(context) color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8),
.scaffoldBackgroundColor
.withOpacity(0.8),
height: 70.0, height: 70.0,
), ),
), ),
@ -119,9 +123,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
width: MediaQuery.of(context).size.width * 0.92, // 0.9, width: MediaQuery.of(context).size.width * 0.92, // 0.9,
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.9), //width: 0.7
color: Theme.of(context).dividerColor,
width: 0.9), //width: 0.7
), ),
color: Colors.white), color: Colors.white),
child: Center( child: Center(
@ -134,8 +136,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
indicatorColor: Theme.of(context).primaryColor, indicatorColor: Theme.of(context).primaryColor,
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0),
EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0),
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( Container(
@ -165,10 +166,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
? TabBarView( ? TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: [ children: [myFamilyDetails(context), myFamilyRequest(context)],
myFamilyDetails(context),
myFamilyRequest(context)
],
) )
: Container(child: AppText('Loading..')), : Container(child: AppText('Loading..')),
) )
@ -221,32 +219,21 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
flex: 4, flex: 4,
child: FutureBuilder( child: FutureBuilder(
future: getFamilyFiles(), // async work future: getFamilyFiles(), // async work
builder: (BuildContext context, builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding( return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....'));
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding( return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
padding: EdgeInsets.all(10),
child: Text(
TranslationBase.of(context).noDataAvailable));
else else
return Padding( return Padding(
padding: EdgeInsets.only(top: 50), padding: EdgeInsets.only(top: 50),
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(flex: 3, child: Text(TranslationBase.of(context).request)),
flex: 3,
child: Text(
TranslationBase.of(context).request)),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text( child: Text(
@ -261,26 +248,20 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: snapshot children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) {
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return result.status == 3 return result.status == 3
? Padding( ? Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(flex: 3, child: Text(result.patientName)),
flex: 3,
child: Text(
result.patientName)),
Expanded( Expanded(
flex: 2, flex: 2,
child: IconButton( child: IconButton(
icon: Icon(Icons.group), icon: Icon(Icons.group),
color: Colors.black, color: Colors.black,
onPressed: () { onPressed: () {
switchUser( switchUser(result, context);
result, context);
}, },
)), )),
Expanded( Expanded(
@ -291,8 +272,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
color: Colors.black, color: Colors.black,
), ),
onPressed: () { onPressed: () {
deleteFamily( deleteFamily(result, context);
result, context);
}, },
)), )),
], ],
@ -314,10 +294,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).addFamilyMember, TranslationBase.of(context).addFamilyMember,
() => { () => {Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER_TYPE)},
Navigator.of(context)
.pushNamed(ADD_FAMILY_MEMBER_TYPE)
},
color: Colors.grey[900], color: Colors.grey[900],
textColor: Colors.white, textColor: Colors.white,
)) ))
@ -349,19 +326,13 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: <Widget>[ children: <Widget>[
FutureBuilder( FutureBuilder(
future: getUserViewRequest(), // async work future: getUserViewRequest(), // async work
builder: (BuildContext context, builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding( return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....'));
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding( return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
padding: EdgeInsets.all(10),
child: Text(TranslationBase.of(context)
.noDataAvailable));
else else
return Column( return Column(
children: [ children: [
@ -391,30 +362,19 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
// )), // )),
Column(children: [ Column(children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 10, right: 10),
left: 10, right: 10),
child: Row(children: [ child: Row(children: [
Expanded( Expanded(flex: 3, child: AppText('Name')),
flex: 3, child: AppText('Name')), Expanded(flex: 1, child: AppText('Allow')),
Expanded( Expanded(flex: 1, child: AppText('Reject')),
flex: 1, child: AppText('Allow')),
Expanded(
flex: 1,
child: AppText('Reject')),
])), ])),
Column( Column(
children: familyFileProvider children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
.allSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding( return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(flex: 3, child: Text(result.patientName)),
flex: 3,
child:
Text(result.patientName)),
Expanded( Expanded(
flex: 1, flex: 1,
child: IconButton( child: IconButton(
@ -423,10 +383,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
color: Colors.black, color: Colors.black,
), ),
onPressed: () { onPressed: () {
acceptRemoveRequest( acceptRemoveRequest(result.iD, 3, context);
result.iD,
3,
context);
}, },
)), )),
Expanded( Expanded(
@ -437,10 +394,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
color: Colors.black, color: Colors.black,
), ),
onPressed: () { onPressed: () {
acceptRemoveRequest( acceptRemoveRequest(result.iD, 4, context);
result.iD,
4,
context);
}, },
)) ))
], ],
@ -463,55 +417,32 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: <Widget>[ children: <Widget>[
FutureBuilder( FutureBuilder(
future: getSentRequest(), // async work future: getSentRequest(), // async work
builder: (BuildContext context, builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding( return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....'));
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding( return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
padding: EdgeInsets.all(10),
child: Text(TranslationBase.of(context)
.noDataAvailable));
else else
return Container( return Container(
height: SizeConfig.screenHeight * .3, height: SizeConfig.screenHeight * .3,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
Padding( Padding(padding: EdgeInsets.only(left: 10, right: 10), child: Row(children: [Expanded(flex: 3, child: AppText(TranslationBase.of(context).theName))])),
padding: EdgeInsets.only(
left: 10, right: 10),
child: Row(children: [
Expanded(
flex: 3,
child: AppText(
TranslationBase.of(context)
.theName))
])),
Column( Column(
children: snapshot children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) {
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding( return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(flex: 3, child: Text(result.patientName)),
flex: 3,
child: Text(
result.patientName)),
Expanded( Expanded(
flex: 2, flex: 2,
child: AppText( child: AppText(
result.statusDescription, result.statusDescription,
color: result.status == 3 color: result.status == 3 ? Colors.green : Colors.red,
? Colors.green
: Colors.red,
)), )),
], ],
)); ));
@ -532,19 +463,13 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: <Widget>[ children: <Widget>[
FutureBuilder( FutureBuilder(
future: getUserViewRequest(), // async work future: getUserViewRequest(), // async work
builder: (BuildContext context, builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding( return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....'));
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding( return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
padding: EdgeInsets.all(10),
child: Text(TranslationBase.of(context)
.noDataAvailable));
else else
return Column( return Column(
children: [ children: [
@ -573,27 +498,18 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
// )), // )),
Column(children: [ Column(children: [
Padding( Padding(
padding: padding: EdgeInsets.only(left: 10, right: 10),
EdgeInsets.only(left: 10, right: 10),
child: Row(children: [ child: Row(children: [
Expanded( Expanded(flex: 3, child: AppText('Name')),
flex: 3, child: AppText('Name')), Expanded(flex: 1, child: AppText('Delete')),
Expanded(
flex: 1, child: AppText('Delete')),
])), ])),
Column( Column(
children: familyFileProvider children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
.allSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding( return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(flex: 3, child: AppText(result.patientName)),
flex: 3,
child: AppText(
result.patientName)),
Expanded( Expanded(
flex: 1, flex: 1,
child: IconButton( child: IconButton(
@ -602,8 +518,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
color: Colors.black, color: Colors.black,
), ),
onPressed: () { onPressed: () {
deactivateRequest( deactivateRequest(result.iD, 5, context);
result.iD, 5, context);
}, },
)), )),
], ],
@ -635,8 +550,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if (user != null) { if (user != null) {
if (await sharedPref.getObject(FAMILY_FILE) != null) { if (await sharedPref.getObject(FAMILY_FILE) != null) {
// print(await sharedPref.getObject(FAMILY_FILE)); // print(await sharedPref.getObject(FAMILY_FILE));
return Future.value(GetAllSharedRecordsByStatusResponse.fromJson( return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE)));
await sharedPref.getObject(FAMILY_FILE)));
} else { } else {
return familyFileProvider.getSharedRecordByStatus(); return familyFileProvider.getSharedRecordByStatus();
} }
@ -659,10 +573,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
confirmMessage: TranslationBase.of(context).removeFamilyMember, confirmMessage: TranslationBase.of(context).removeFamilyMember,
okText: TranslationBase.of(context).confirm, okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => { okFunction: () => {ConfirmDialog.closeAlertDialog(context), removeFamily(family, context)},
ConfirmDialog.closeAlertDialog(context),
removeFamily(family, context)
},
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
} }
@ -673,10 +584,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request['ID'] = this.userID; request['ID'] = this.userID;
request['IsActive'] = false; request['IsActive'] = false;
this this.familyFileProvider.deativateActivateMemberFile(request).then((value) => refreshFamily(context));
.familyFileProvider
.deativateActivateMemberFile(request)
.then((value) => refreshFamily(context));
} }
refreshFamily(context) { refreshFamily(context) {
@ -694,12 +602,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
// .then((value) => loginAfter(value, context)); // .then((value) => loginAfter(value, context));
// Utils.showProgressDialog(context); // Utils.showProgressDialog(context);
this this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser).then((value) => loginAfter(value, context)).catchError((err) {
.familyFileProvider
.silentLoggin(user is AuthenticatedUser ? null : user,
mainUser: user is AuthenticatedUser)
.then((value) => loginAfter(value, context))
.catchError((err) {
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -709,8 +612,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
loginAfter(result, context) async { loginAfter(result, context) async {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
var currentLang = await sharedPref.getString(APP_LANGUAGE); var currentLang = await sharedPref.getString(APP_LANGUAGE);
Provider.of<ProjectViewModel>(context, listen: false) Provider.of<ProjectViewModel>(context, listen: false).setPrivilege(privilegeList: result, isLoginChild: true);
.setPrivilege(privilegeList: result, isLoginChild: true);
result = list.CheckActivationCode.fromJson(result); result = list.CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE); var familyFile = await sharedPref.getObject(FAMILY_FILE);
@ -729,14 +631,11 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID);
await authenticatedUserObject.getUser(getUser: true); await authenticatedUserObject.getUser(getUser: true);
Provider.of<ProjectViewModel>(context, listen: false).user = Provider.of<ProjectViewModel>(context, listen: false).user = authenticatedUserObject.user;
authenticatedUserObject.user; Provider.of<ProjectViewModel>(context, listen: false).setUser(authenticatedUserObject.user);
Provider.of<ProjectViewModel>(context, listen: false)
.setUser(authenticatedUserObject.user);
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
if (pharmacyModuleViewModel.error.isNotEmpty) if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser();
await pharmacyModuleViewModel.createUser();
}); });
appointmentRateViewModel appointmentRateViewModel
@ -775,8 +674,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request["ID"] = ID; request["ID"] = ID;
request["Status"] = status; request["Status"] = status;
this.familyFileProvider.deactivateFamily(request).then((value) => this.familyFileProvider.deactivateFamily(request).then((value) => {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)});
{GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)});
} }
acceptRemoveRequest(ID, status, context) { acceptRemoveRequest(ID, status, context) {
@ -784,17 +682,14 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request["ID"] = ID; request["ID"] = ID;
request["Status"] = status; request["Status"] = status;
this.familyFileProvider.acceptRejectFamily(request).then((value) => this.familyFileProvider.acceptRejectFamily(request).then((value) => {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)});
{GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)});
} }
checkUserData() async { checkUserData() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
var data2 = AuthenticatedUser.fromJson( var data2 = AuthenticatedUser.fromJson(await this.sharedPref.getObject(MAIN_USER));
await this.sharedPref.getObject(MAIN_USER));
print(data2); print(data2);
setState(() { setState(() {
this.user = data; this.user = data;

@ -80,6 +80,7 @@ class _ToDoState extends State<ToDo> {
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
isShowAppBar: widget.isShowAppBar, isShowAppBar: widget.isShowAppBar,
isShowDecPage: true, isShowDecPage: true,
icon: "assets/images/new/bottom_nav/todo.svg",
description: TranslationBase.of(context).infoTodo, description: TranslationBase.of(context).infoTodo,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(

@ -16,8 +16,7 @@ import 'package:diplomaticquarterapp/pages/landing/home_page_2.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family;
as family;
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
@ -63,8 +62,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
var themeNotifier; var themeNotifier;
///inject the user data ///inject the user data
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
final authService = new AuthProvider(); final authService = new AuthProvider();
@ -72,10 +70,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
var familyFileProvider = family.FamilyFilesProvider(); var familyFileProvider = family.FamilyFilesProvider();
void _requestIOSPermissions() { void _requestIOSPermissions() {
flutterLocalNotificationsPlugin flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
alert: true, alert: true,
badge: true, badge: true,
sound: true, sound: true,
@ -86,6 +81,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
LocationUtils locationUtils; LocationUtils locationUtils;
_changeCurrentTab(int tab) { _changeCurrentTab(int tab) {
if (tab == 3) {}
setState(() { setState(() {
currentTab = tab; currentTab = tab;
if (tab != 0) if (tab != 0)
@ -107,8 +103,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
print(route.settings.name); print(route.settings.name);
} }
//setState(() { //setState(() {
print("didChangeAppLifecycleState"); print("didChangeAppLifecycleState");
print('state = $state'); print('state = $state');
@ -118,12 +112,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (LandingPage.isOpenCallPage) { if (LandingPage.isOpenCallPage) {
if (!isPageNavigated) { if (!isPageNavigated) {
isPageNavigated = true; isPageNavigated = true;
Navigator.push( Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
context,
MaterialPageRoute(
builder: (context) => IncomingCall(
incomingCallData: LandingPage.incomingCallData)))
.then((value) {
isPageNavigated = false; isPageNavigated = false;
}); });
} }
@ -157,16 +146,12 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController = PageController(keepPage: true); pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
locationUtils = locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
new LocationUtils(isShowConfirmDialog: true, context: context); WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
WidgetsBinding.instance
.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
// HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani]
HMGNetworkConnectivity(context, () { HMGNetworkConnectivity(context, () {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
PlatformBridge() PlatformBridge().connectHMGGuestWifi().then((value) => {GifLoaderDialogUtils.hideDialog(context)});
.connectHMGGuestWifi()
.then((value) => {GifLoaderDialogUtils.hideDialog(context)});
}).checkAndConnectIfNoInternet(); }).checkAndConnectIfNoInternet();
if (Platform.isIOS) { if (Platform.isIOS) {
@ -192,7 +177,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// if (results[Permission.calendar].isGranted) ; // if (results[Permission.calendar].isGranted) ;
}); });
requestPermissions(); requestPermissions();
// }); // });
// //
@ -313,16 +297,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// ); // );
} }
showDialogs(String message) { showDialogs(String message) {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {});
confirmMessage: message,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {},
cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
} }
@ -347,8 +324,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return permissionResults; return permissionResults;
} }
static Future<dynamic> myBackgroundMessageHandler( static Future<dynamic> myBackgroundMessageHandler(Map<String, dynamic> message) async {
Map<String, dynamic> message) async {
Map<String, dynamic> myMap = new Map<String, dynamic>.from(message['data']); Map<String, dynamic> myMap = new Map<String, dynamic>.from(message['data']);
if (message.containsKey('data')) { if (message.containsKey('data')) {
print("myBackgroundMessageHandler Inside"); print("myBackgroundMessageHandler Inside");
@ -383,8 +359,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
void doIt() { void doIt() {
getUserInformation().then((value) { getUserInformation().then((value) {
if (value != null) if (value != null) projectViewModel.platformBridge().registerHmgGeofences();
projectViewModel.platformBridge().registerHmgGeofences();
}); });
} }
@ -406,9 +381,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
Navigator.of(context).pushNamed(CONFIRM_LOGIN); Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) {
.selectDeviceImei(DEVICE_TOKEN)
.then((SelectDeviceIMEIRES value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) { if (value != null) {
setUserValues(value); setUserValues(value);
@ -429,21 +402,12 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
getNotificationCount(token) async { getNotificationCount(token) async {
if (await sharedPref.getObject(USER_PROFILE) != null) { if (await sharedPref.getObject(USER_PROFILE) != null) {
var data = var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) { if (data != null) {
authService authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {print(res)});
.registeredAuthenticatedUser(data, token, 0, 0)
.then((res) => {print(res)});
authService.getDashboard().then((value) => { authService.getDashboard().then((value) => {
setState(() { setState(() {
notificationCount = value['List_PatientDashboard'][0] notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
['UnreadPatientNotificationCount'] >
99
? '99+'
: value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.toString();
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
}) })
@ -461,16 +425,11 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
textTheme: TextTheme( textTheme: TextTheme(
headline6: TextStyle( headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold),
color: Theme.of(context).textTheme.headline1.color,
fontWeight: FontWeight.bold),
), ),
title: Text( title: Text(
getText(currentTab).toUpperCase(), getText(currentTab).toUpperCase(),
style: TextStyle( style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
fontWeight: FontWeight.bold,
color: Theme.of(context).textTheme.headline1.color,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
// bold: true, // bold: true,
// color: Colors.white, // color: Colors.white,
), ),
@ -565,14 +524,13 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
index: currentTab, index: currentTab,
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: floatingActionButton: (projectViewModel.havePrivilege(34) && currentTab == 0)
(projectViewModel.havePrivilege(34) && currentTab == 0) ? FloatingButton(
? FloatingButton( elevation: true,
elevation: true, onTap: () {
onTap: () { _changeCurrentTab(2);
_changeCurrentTab(2); })
}) : null);
: null);
} }
triggerRobot() { triggerRobot() {
@ -597,22 +555,15 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
void checkUserStatus(token) async { void checkUserStatus(token) async {
authService authService.selectDeviceImei(token).then((SelectDeviceIMEIRES value) => setUserValues(value));
.selectDeviceImei(token)
.then((SelectDeviceIMEIRES value) => setUserValues(value));
if (projectViewModel.isLoading == true) { if (projectViewModel.isLoading == true) {
var data = var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) { if (data != null) {
authService authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {print(res)});
.registeredAuthenticatedUser(data, token, 0, 0)
.then((res) => {print(res)});
authService.getDashboard().then((value) => { authService.getDashboard().then((value) => {
setState(() { setState(() {
if (value != null) { if (value != null) {
notificationCount = value['List_PatientDashboard'][0] notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
['UnreadPatientNotificationCount']
.toString();
} }
}) })
}); });

@ -58,8 +58,8 @@ class AppScaffold extends StatelessWidget {
final List<Widget> appBarIcons; final List<Widget> appBarIcons;
final List<ImagesInfo> imagesInfo; final List<ImagesInfo> imagesInfo;
final bool isHelp; final bool isHelp;
AuthenticatedUserObject authenticatedUserObject = final String icon;
locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AppBarWidget appBar; AppBarWidget appBar;
AppScaffold( AppScaffold(
@ -84,6 +84,7 @@ class AppScaffold extends StatelessWidget {
this.appBarIcons, this.appBarIcons,
this.infoList, this.infoList,
this.isHelp = false, this.isHelp = false,
this.icon,
this.showHomeAppBarIcon = true, this.showHomeAppBarIcon = true,
this.imagesInfo}); this.imagesInfo});
@ -96,8 +97,7 @@ class AppScaffold extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.context = context; AppGlobal.context = context;
return Scaffold( return Scaffold(
backgroundColor: backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar appBar: isShowAppBar
? appBar = AppBarWidget( ? appBar = AppBarWidget(
appBarTitle: appBarTitle, appBarTitle: appBarTitle,
@ -114,21 +114,20 @@ class AppScaffold extends StatelessWidget {
body: SafeArea( body: SafeArea(
top: true, top: true,
bottom: true, bottom: true,
child: child: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin && isShowDecPage)
(!Provider.of<ProjectViewModel>(context, listen: false).isLogin && ? NotAutPage(
isShowDecPage) title: title ?? appBarTitle,
? NotAutPage( description: description,
title: title ?? appBarTitle, infoList: infoList,
description: description, imagesInfo: imagesInfo,
infoList: infoList, icon: icon,
imagesInfo: imagesInfo, )
: baseViewModel != null
? NetworkBaseView(
child: buildBodyWidget(context),
baseViewModel: baseViewModel,
) )
: baseViewModel != null : buildBodyWidget(context),
? NetworkBaseView(
child: buildBodyWidget(context),
baseViewModel: baseViewModel,
)
: buildBodyWidget(context),
), ),
); );
} }
@ -138,14 +137,12 @@ class AppScaffold extends StatelessWidget {
} }
buildBodyWidget(context) { buildBodyWidget(context) {
return Stack( return Stack(children: <Widget>[body, isHelp == true ? RobotIcon() : Container()]);
children: <Widget>[body, isHelp == true ? RobotIcon() : Container()]);
} }
} }
class AppBarWidget extends StatefulWidget with PreferredSizeWidget { class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
final AuthenticatedUserObject authenticatedUserObject = final AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
final String appBarTitle; final String appBarTitle;
final bool showHomeAppBarIcon; final bool showHomeAppBarIcon;
@ -193,22 +190,12 @@ class AppBarWidgetState extends State<AppBarWidget> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppBar( return AppBar(
elevation: 0, elevation: 0,
backgroundColor: widget.isPharmacy backgroundColor: widget.isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color,
? Colors.green
: Theme.of(context).appBarTheme.color,
textTheme: TextTheme( textTheme: TextTheme(
headline6: TextStyle( headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold),
color: Theme.of(context).textTheme.headline1.color,
fontWeight: FontWeight.bold),
), ),
title: Text( title: Text(widget.authenticatedUserObject.isLogin || !widget.isShowDecPage ? widget.appBarTitle.toUpperCase() : TranslationBase.of(context).serviceInformationTitle,
widget.authenticatedUserObject.isLogin || !widget.isShowDecPage style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
? widget.appBarTitle.toUpperCase()
: TranslationBase.of(context).serviceInformationTitle,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Theme.of(context).textTheme.headline1.color,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return ArrowBack(); return ArrowBack();
@ -218,9 +205,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
actions: <Widget>[ actions: <Widget>[
(widget.isPharmacy && widget.showPharmacyCart) (widget.isPharmacy && widget.showPharmacyCart)
? IconButton( ? IconButton(
icon: Badge( icon: Badge(badgeContent: Text(badgeText), child: Icon(Icons.shopping_cart)),
badgeContent: Text(badgeText),
child: Icon(Icons.shopping_cart)),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
Navigator.of(context).popUntil(ModalRoute.withName('/')); Navigator.of(context).popUntil(ModalRoute.withName('/'));
@ -232,10 +217,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
position: BadgePosition.topStart(top: -15, start: -10), position: BadgePosition.topStart(top: -15, start: -10),
badgeContent: Text( badgeContent: Text(
badgeText, badgeText,
style: TextStyle( style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal),
fontSize: 9,
color: Colors.white,
fontWeight: FontWeight.normal),
), ),
child: Icon(Icons.shopping_cart)), child: Icon(Icons.shopping_cart)),
color: Colors.white, color: Colors.white,
@ -249,10 +231,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
icon: Icon(FontAwesomeIcons.home), icon: Icon(FontAwesomeIcons.home),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> r) => false);
// Cart Click Event // Cart Click Event
if (_onCartClick != null) _onCartClick(); if (_onCartClick != null) _onCartClick();
@ -316,18 +295,11 @@ class _RobotIcon extends State<RobotIcon> {
], ],
), ),
child: TyperAnimatedTextKit( child: TyperAnimatedTextKit(
text: Provider.of<ProjectViewModel>(context, text: Provider.of<ProjectViewModel>(context, listen: false).isArabic == true
listen: false)
.isArabic ==
true
? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي."
: "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", : "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.",
textLength: Provider.of<ProjectViewModel>(context, textLength: Provider.of<ProjectViewModel>(context, listen: false).isArabic == true
listen: false) ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي.".length
.isArabic ==
true
? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي."
.length
: "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file." : "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file."
.length)) .length))
: Container(), : Container(),

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../splashPage.dart'; import '../../splashPage.dart';
@ -19,12 +20,9 @@ class NotAutPage extends StatefulWidget {
final String description; final String description;
final List<String> infoList; final List<String> infoList;
final List<ImagesInfo> imagesInfo; final List<ImagesInfo> imagesInfo;
final String icon;
NotAutPage( NotAutPage({@required this.title, @required this.description, this.infoList, this.imagesInfo, this.icon});
{@required this.title,
@required this.description,
this.infoList,
this.imagesInfo});
@override @override
_NotAutPageState createState() => _NotAutPageState(); _NotAutPageState createState() => _NotAutPageState();
@ -34,6 +32,70 @@ class _NotAutPageState extends State<NotAutPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Scaffold(
backgroundColor: Color(0xfff8f8f8),
resizeToAvoidBottomPadding: false,
appBar: AppBar(
backgroundColor: Colors.transparent,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Color(0xff2B353E),
onPressed: () => Navigator.pop(context),
),
),
body: Padding(
padding: EdgeInsets.only(bottom: 20, left: 21, right: 21),
child: Column(children: [
Expanded(
child: ListView(
padding: EdgeInsets.zero,
physics: BouncingScrollPhysics(),
children: [
SizedBox(height: 12),
if (widget.icon != null)
Align(
alignment: Alignment.centerLeft,
child: SvgPicture.asset(
widget.icon,
height: 35,
width: 35,
),
),
SizedBox(height: 16),
Text(
widget.title,
style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24),
),
Text(
widget.description,
style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14),
),
],
),
),
SizedBox(
height: 43,
width: double.infinity,
child: FlatButton(
onPressed: () {
loginCheck(context);
},
child: Text(
TranslationBase.of(context).loginregister,
style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48),
),
// color: Color(0xffD02127),
color: Color(0xffD02127),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
),
),
]),
),
);
return Scaffold( return Scaffold(
body: SingleChildScrollView( body: SingleChildScrollView(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
@ -71,9 +133,7 @@ class _NotAutPageState extends State<NotAutPage> {
Container( Container(
width: 40, width: 40,
height: 40, height: 40,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(20), color: Theme.of(context).primaryColor),
borderRadius: BorderRadius.circular(20),
color: Theme.of(context).primaryColor),
child: Center( child: Center(
child: Texts( child: Texts(
'${index + 1}', '${index + 1}',
@ -102,26 +162,17 @@ class _NotAutPageState extends State<NotAutPage> {
child: SizedBox( child: SizedBox(
height: MediaQuery.of(context).size.height * 0.55, height: MediaQuery.of(context).size.height * 0.55,
width: MediaQuery.of(context).size.width * 0.50, width: MediaQuery.of(context).size.width * 0.50,
child: Image.asset(projectViewModel.isArabic child: Image.asset(projectViewModel.isArabic ? 'assets/images/Wifi-AR.png' : 'assets/images/wifi-EN.png'),
? 'assets/images/Wifi-AR.png'
: 'assets/images/wifi-EN.png'),
), ),
), ),
if (projectViewModel.isInternetConnection && if (projectViewModel.isInternetConnection && widget.imagesInfo != null)
widget.imagesInfo != null)
CarouselSlider( CarouselSlider(
items: widget.imagesInfo.map((image) { items: widget.imagesInfo.map((image) {
return Builder( return Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return SizedBox( return SizedBox(
width: MediaQuery.of(context).size.width * 0.50, width: MediaQuery.of(context).size.width * 0.50,
child: image.isAsset child: image.isAsset ? Image.asset(projectViewModel.isArabic ? image.imageAr : image.imageEn) : Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn));
? Image.asset(projectViewModel.isArabic
? image.imageAr
: image.imageEn)
: Image.network(projectViewModel.isArabic
? image.imageAr
: image.imageEn));
}, },
); );
}).toList(), }).toList(),

@ -222,6 +222,7 @@ flutter:
- assets/images/pharmacy_module/payment/ - assets/images/pharmacy_module/payment/
- assets/images/pharmacy_module/lakum/ - assets/images/pharmacy_module/lakum/
- assets/images/new/ - assets/images/new/
- assets/images/new/bottom_nav/
- assets/images/new/services/ - assets/images/new/services/
fonts: fonts:

Loading…
Cancel
Save