@ -1,5 +1,6 @@
import ' dart:ui ' ;
import ' package:diplomaticquarterapp/config/shared_pref_kay.dart ' ;
import ' package:diplomaticquarterapp/config/size_config.dart ' ;
import ' package:diplomaticquarterapp/core/model/ImagesInfo.dart ' ;
import ' package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart ' ;
@ -7,19 +8,23 @@ import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dar
import ' package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart ' ;
import ' package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart ' ;
import ' package:diplomaticquarterapp/core/viewModels/project_view_model.dart ' ;
import ' package:diplomaticquarterapp/extensions/string_extensions.dart ' ;
import ' package:diplomaticquarterapp/locator.dart ' ;
import ' package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart ' ;
import ' package:diplomaticquarterapp/models/Authentication/authenticated_user.dart ' ;
import ' package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart ' as list ;
import ' package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart ' ;
import ' package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart ' ;
import ' package:diplomaticquarterapp/pages/landing/landing_page.dart ' ;
import ' package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart ' ;
import ' package:diplomaticquarterapp/routes.dart ' ;
import ' package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart ' ;
import ' package:diplomaticquarterapp/services/family_files/family_files_provider.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_shared_preferences.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_toast.dart ' ;
import ' package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/widgets/buttons/button.dart ' ;
import ' package:diplomaticquarterapp/uitl/utils_new.dart ' ;
import ' package:diplomaticquarterapp/widgets/buttons/defaultButton.dart ' ;
import ' package:diplomaticquarterapp/widgets/card/rounded_container.dart ' ;
import ' package:diplomaticquarterapp/widgets/data_display/text.dart ' ;
import ' package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart ' ;
@ -28,14 +33,13 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import ' package:diplomaticquarterapp/widgets/transitions/fade_page.dart ' ;
import ' package:flutter/cupertino.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:diplomaticquarterapp/config/shared_pref_kay.dart ' ;
import ' package:diplomaticquarterapp/routes.dart ' ;
import ' package:provider/provider.dart ' ;
import ' package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart ' ;
class MyFamily extends StatefulWidget {
final bool isAppbarVisible ;
MyFamily ( { this . isAppbarVisible = true } ) ;
@ override
_MyFamily createState ( ) = > _MyFamily ( ) ;
}
@ -55,6 +59,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
PharmacyModuleViewModel pharmacyModuleViewModel = locator < PharmacyModuleViewModel > ( ) ;
ToDoCountProviderModel toDoProvider ;
var isVaiable = false ;
bool isSwitchUser = false ;
@ override
void initState ( ) {
_tabController = new TabController ( length: 2 , vsync: this , initialIndex: 0 ) ;
@ -80,6 +86,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
appBarTitle: TranslationBase . of ( context ) . myFamilyFiles ,
isShowAppBar: widget . isAppbarVisible ,
imagesInfo: imagesInfo ,
showNewAppBar: true ,
showNewAppBarTitle: true ,
icon: " assets/images/new/bottom_nav/family_files.svg " ,
description: TranslationBase . of ( context ) . familyInfo ,
body: Scaffold (
@ -100,46 +108,64 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
/ / ) ,
/ / ) ,
/ / ) ,
/ / Center (
/ / child: Container (
/ / height: 60.0 ,
/ / / / margin: EdgeInsets . only ( top: 10.0 ) ,
/ / width: MediaQuery . of ( context ) . size . width * 0.92 , / / 0.9 ,
/ / decoration: BoxDecoration (
/ / border: Border (
/ / bottom: BorderSide ( color: Theme . of ( context ) . dividerColor , width: 0.9 ) , / / width: 0.7
/ / ) ,
/ / color: Colors . white ) ,
Center (
child: Container (
height: 60.0 ,
margin: EdgeInsets . only ( top: 10.0 ) ,
width: MediaQuery . of ( context ) . size . width * 0.92 , / / 0.9 ,
decoration: BoxDecoration (
border: Border (
bottom: BorderSide ( color: Theme . of ( context ) . dividerColor , width: 0.9 ) , / / width: 0.7
) ,
color: Colors . white ) ,
child: Center (
child: TabBar (
isScrollable: true ,
controller: _tabController ,
indicatorWeight: 5.0 ,
/ / indicatorSize: TabBarIndicatorSize . label ,
indicatorSize: TabBarIndicatorSize . tab ,
/ / indicatorColor: Theme . of ( context ) . primaryColor ,
/ / labelColor: Theme . of ( context ) . primaryColor ,
labelPadding: EdgeInsets . only ( top: 4.0 , left: 35.0 , right: 35.0 ) ,
unselectedLabelColor: Colors . grey [ 800 ] ,
tabs: [
Container (
width: MediaQuery . of ( context ) . size . width * 0.30 ,
child: Center (
child: AppText ( TranslationBase . of ( context ) . family ) ,
) ,
) ,
Container (
width: MediaQuery . of ( context ) . size . width * 0.30 ,
child: Center (
child: AppText ( TranslationBase . of ( context ) . request ) ,
) ,
) ,
] ,
) ,
child:
/ / TabBar (
/ / isScrollable: true ,
/ / controller: _tabController ,
/ / indicatorWeight: 5.0 ,
/ / indicatorSize: TabBarIndicatorSize . tab ,
/ / labelPadding: EdgeInsets . only ( top: 4.0 , left: 35.0 , right: 35.0 ) ,
/ / unselectedLabelColor: Colors . grey [ 800 ] ,
/ / tabs: [
/ / Container (
/ / width: MediaQuery . of ( context ) . size . width * 0.30 ,
/ / child: Center (
/ / child: AppText ( TranslationBase . of ( context ) . family ) ,
/ / ) ,
/ / ) ,
/ / Container (
/ / width: MediaQuery . of ( context ) . size . width * 0.30 ,
/ / child: Center (
/ / child: AppText ( TranslationBase . of ( context ) . request ) ,
/ / ) ,
/ / ) ,
/ / ] ,
/ / ) ,
TabBar (
controller: _tabController ,
indicatorWeight: 3.0 ,
indicatorSize: TabBarIndicatorSize . tab ,
labelColor: Color ( 0xff2B353E ) ,
unselectedLabelColor: Color ( 0xff575757 ) ,
labelPadding: EdgeInsets . only ( top: 15 , bottom: 13 , left: 20 , right: 20 ) ,
labelStyle: TextStyle (
fontFamily: projectViewModel . isArabic ? ' Cairo ' : ' Poppins ' ,
fontSize: 16 ,
fontWeight: FontWeight . w600 ,
letterSpacing: - 0.48 ,
) ,
unselectedLabelStyle: TextStyle (
fontFamily: projectViewModel . isArabic ? ' Cairo ' : ' Poppins ' ,
fontSize: 16 ,
fontWeight: FontWeight . w600 ,
letterSpacing: - 0.48 ,
) ,
tabs: [ Text ( TranslationBase . of ( context ) . family ) , Text ( TranslationBase . of ( context ) . request ) ] ,
) ,
) ,
/ / ) ,
/ / ) ,
] ,
) ,
) ,
@ -157,15 +183,14 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
] ,
) ,
bottomSheet: Container (
width: MediaQuery . of ( context ) . size . width ,
height: 70.0 ,
margin: EdgeInsets . only ( left: 15.0 , right: 15.0 , top: 10.0 ) ,
child: Button (
onTap: ( ) async {
color: Theme . of ( context ) . scaffoldBackgroundColor ,
width: double . infinity ,
padding: EdgeInsets . all ( 14 ) ,
child: DefaultButton (
TranslationBase . of ( context ) . addFamilyMember ,
( ) async {
Navigator . of ( context ) . pushNamed ( ADD_FAMILY_MEMBER_TYPE ) ;
} ,
label: TranslationBase . of ( context ) . addFamilyMember ,
backgroundColor: Colors . red [ 900 ] ,
) ,
) ,
) ,
@ -193,50 +218,105 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
return Padding (
padding: EdgeInsets . only ( top: 50 ) ,
child: Column ( children: < Widget > [
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: < Widget > [
Expanded (
flex: 3 ,
child: Texts (
TranslationBase . of ( context ) . request ,
textAlign: TextAlign . center ,
) ) ,
Expanded ( flex: 2 , child: Texts ( TranslationBase . of ( context ) . switchUser , textAlign: TextAlign . center ) ) ,
Expanded ( flex: 1 , child: Texts ( TranslationBase . of ( context ) . deleteView , textAlign: TextAlign . center ) ) ,
] ,
) ,
/ / Row (
/ / mainAxisAlignment: MainAxisAlignment . spaceBetween ,
/ / children: < Widget > [
/ / Expanded (
/ / flex: 3 ,
/ / child: Texts (
/ / TranslationBase . of ( context ) . request ,
/ / textAlign: TextAlign . center ,
/ / ) ) ,
/ / Expanded ( flex: 2 , child: Texts ( TranslationBase . of ( context ) . switchUser , textAlign: TextAlign . center ) ) ,
/ / Expanded ( flex: 1 , child: Texts ( TranslationBase . of ( context ) . deleteView , textAlign: TextAlign . center ) ) ,
/ / ] ,
/ / ) ,
Column (
mainAxisAlignment: MainAxisAlignment . start ,
children: snapshot . data . getAllSharedRecordsByStatusList . map < Widget > ( ( result ) {
return result . status = = 3
? Padding (
padding: EdgeInsets . all ( 10 ) ,
child: Row (
children: < Widget > [
Expanded ( flex: 3 , child: Text ( result . patientName ) ) ,
Expanded (
flex: 2 ,
child: IconButton (
icon: Icon ( Icons . group ) ,
color: Colors . black ,
onPressed: ( ) {
switchUser ( result , context ) ;
} ,
) ) ,
Expanded (
flex: 1 ,
child: IconButton (
icon: Icon (
Icons . delete ,
color: Colors . black ,
) ,
onPressed: ( ) {
deleteFamily ( result , context ) ;
} ,
) ) ,
] ,
) )
? Card (
margin: EdgeInsets . all ( 10 ) ,
shape: cardRadius ( 15 ) ,
color: result . gender = = 1 ? Color ( 0xff6EA8FF ) : Color ( 0xffFDA4B0 ) ,
elevation: 3 ,
child: Container (
/ / height: 130 ,
width: MediaQuery . of ( context ) . size . width ,
padding: EdgeInsets . all ( 10 ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
Texts (
result . patientName . toLowerCase ( ) . capitalizeFirstofEach ,
fontSize: 22 ,
fontWeight: FontWeight . bold ,
color: Colors . white ,
) ,
Texts ( TranslationBase . of ( context ) . fileNumber + ' : ' + result . responseID . toString ( ) , fontSize: 12 , color: Colors . white ) ,
Texts ( result . age . toString ( ) + ' ' + TranslationBase . of ( context ) . years + ' , ' + result . genderDescription , fontSize: 12 , color: Colors . white ) ,
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
Row (
children: [
CupertinoSwitch (
value: isSwitchUser ,
onChanged: ( value ) {
setState ( ( ) {
isSwitchUser = value ;
} ) ;
if ( isSwitchUser = = true ) switchUser ( result , context ) ;
} ,
) ,
Texts (
TranslationBase . of ( context ) . switchUser ,
color: Colors . white ,
fontSize: 12 ,
)
] ,
) ,
InkWell (
onTap: ( ) {
deleteFamily ( result , context ) ;
} ,
child: Row (
children: [
Texts (
TranslationBase . of ( context ) . delete ,
color: Colors . white ,
fontSize: 12 ,
) ,
Icon (
Icons . delete ,
color: Colors . white ,
) ,
] ,
) )
] ,
)
/ / Expanded (
/ / flex: 2 ,
/ / child: IconButton (
/ / icon: Icon ( Icons . group ) ,
/ / color: Colors . black ,
/ / onPressed: ( ) {
/ / switchUser ( result , context ) ;
/ / } ,
/ / ) ) ,
/ / Expanded (
/ / flex: 1 ,
/ / child: IconButton (
/ / icon: Icon (
/ / Icons . delete ,
/ / color: Colors . black ,
/ / ) ,
/ / onPressed: ( ) {
/ / deleteFamily ( result , context ) ;
/ / } ,
/ / ) ) ,
] ,
) ) )
: SizedBox ( ) ;
} ) . toList ( ) )
] ) ) ;
@ -281,7 +361,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: ExpansionTile (
title: Text (
TranslationBase . of ( context ) . userViewRequest ,
style: TextStyle ( fontSize: 1 8 .0, fontWeight: FontWeight . bold ) ,
style: TextStyle ( fontSize: 1 6 .0, fontWeight: FontWeight . bold , color: Colors . black ) ,
) ,
children: < Widget > [
FutureBuilder (
@ -294,51 +374,57 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if ( snapshot . hasError )
return Padding ( padding: EdgeInsets . all ( 10 ) , child: Text ( TranslationBase . of ( context ) . noDataAvailable ) ) ;
else
return Column (
children: [
Column ( children: [
Padding (
padding: EdgeInsets . only ( left: 10 , right: 10 ) ,
child: Row ( children: [
Expanded ( flex: 3 , child: AppText ( TranslationBase . of ( context ) . name ) ) ,
Expanded ( flex: 1 , child: AppText ( TranslationBase . of ( context ) . allow ) ) ,
Expanded ( flex: 1 , child: AppText ( TranslationBase . of ( context ) . reject ) ) ,
] ) ) ,
Column (
children: familyFileProvider . allSharedRecordsByStatusResponse . getAllSharedRecordsByStatusList . map < Widget > ( ( result ) {
return Padding (
padding: EdgeInsets . all ( 10 ) ,
child: Row (
children: < Widget > [
Expanded ( flex: 3 , child: Text ( result . patientName ) ) ,
Expanded (
flex: 1 ,
child: IconButton (
icon: Icon (
Icons . check_circle ,
color: Colors . black ,
) ,
onPressed: ( ) {
acceptRemoveRequest ( result . iD , 3 , context ) ;
} ,
) ) ,
Expanded (
flex: 1 ,
child: IconButton (
icon: Icon (
Icons . delete ,
color: Colors . black ,
) ,
onPressed: ( ) {
acceptRemoveRequest ( result . iD , 4 , context ) ;
} ,
) )
] ,
) ) ;
} ) . toList ( ) )
] )
] ,
) ;
return Container (
padding: EdgeInsets . all ( 15 ) ,
child: Card (
elevation: 3 ,
shape: cardRadius ( 8 ) ,
child: Column (
children: [
Column ( children: [
Padding (
padding: EdgeInsets . all ( 10 ) ,
child: Row ( children: [
Expanded ( flex: 3 , child: AppText ( TranslationBase . of ( context ) . name , fontWeight: FontWeight . w600 ) ) ,
Expanded ( flex: 1 , child: AppText ( TranslationBase . of ( context ) . allow , fontWeight: FontWeight . w600 ) ) ,
Expanded ( flex: 1 , child: AppText ( TranslationBase . of ( context ) . reject , fontWeight: FontWeight . w600 ) ) ,
] ) ) ,
Divider ( color: Colors . black , height: 1 ) ,
Column (
children: familyFileProvider . allSharedRecordsByStatusResponse . getAllSharedRecordsByStatusList . map < Widget > ( ( result ) {
return Container (
padding: EdgeInsets . all ( 10 ) ,
child: Row (
children: < Widget > [
Expanded ( flex: 3 , child: Text ( result . patientName ) ) ,
Expanded (
flex: 1 ,
child: IconButton (
icon: Icon (
Icons . check_circle ,
color: Colors . black ,
) ,
onPressed: ( ) {
acceptRemoveRequest ( result . iD , 3 , context ) ;
} ,
) ) ,
Expanded (
flex: 1 ,
child: IconButton (
icon: Icon (
Icons . delete ,
color: Colors . black ,
) ,
onPressed: ( ) {
acceptRemoveRequest ( result . iD , 4 , context ) ;
} ,
) )
] ,
) ) ;
} ) . toList ( ) )
] )
] ,
) ) ) ;
}
} )
] ,
@ -348,7 +434,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: ExpansionTile (
title: Text (
TranslationBase . of ( context ) . sentRequest ,
style: TextStyle ( fontSize: 1 8 .0, fontWeight: FontWeight . bold ) ,
style: TextStyle ( fontSize: 1 6 .0, fontWeight: FontWeight . bold , color: Colors . black ) ,
) ,
children: < Widget > [
FutureBuilder (
@ -362,30 +448,40 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
return Padding ( padding: EdgeInsets . all ( 10 ) , child: Text ( TranslationBase . of ( context ) . noDataAvailable ) ) ;
else
return Container (
padding: EdgeInsets . all ( 15 ) ,
height: SizeConfig . screenHeight * . 3 ,
child: SingleChildScrollView (
child: Column (
children: [
Padding ( padding: EdgeInsets . only ( left: 10 , right: 10 ) , child: Row ( children: [ Expanded ( flex: 3 , child: AppText ( TranslationBase . of ( context ) . theName ) ) ] ) ) ,
Column (
children: snapshot . data . getAllSharedRecordsByStatusList . map < Widget > ( ( result ) {
return Padding (
child: Card (
elevation: 3 ,
shape: cardRadius ( 8 ) ,
child: SingleChildScrollView (
child: Column (
children: [
Padding (
padding: EdgeInsets . all ( 10 ) ,
child: Row (
children: < Widget > [
Expanded ( flex: 3 , child: Text ( result . patientName ) ) ,
Expanded (
flex: 2 ,
child: AppText (
result . statusDescription ,
color: result . status = = 3 ? Colors . green : Colors . red ,
) ) ,
] ,
) ) ;
} ) . toList ( ) ,
)
] ,
) ) ) ;
child: Row ( children: [
Expanded ( flex: 3 , child: AppText ( TranslationBase . of ( context ) . theName , fontWeight: FontWeight . w600 ) ) ,
Expanded ( flex: 2 , child: AppText ( TranslationBase . of ( context ) . status , fontWeight: FontWeight . w600 ) )
] ) ) ,
Divider ( color: Colors . black , height: 1 ) ,
Column (
children: snapshot . data . getAllSharedRecordsByStatusList . map < Widget > ( ( result ) {
return Padding (
padding: EdgeInsets . all ( 10 ) ,
child: Row (
children: < Widget > [
Expanded ( flex: 3 , child: Text ( result . patientName ) ) ,
Expanded (
flex: 2 ,
child: AppText (
result . statusDescription ,
color: result . status = = 3 ? Colors . green : Colors . red ,
) ) ,
] ,
) ) ;
} ) . toList ( ) ,
)
] ,
) ) ) ) ;
}
} )
] ,
@ -394,7 +490,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: ExpansionTile (
title: Text (
TranslationBase . of ( context ) . userView ,
style: TextStyle ( fontSize: 1 8 .0, fontWeight: FontWeight . bold ) ,
style: TextStyle ( fontSize: 1 6 .0, fontWeight: FontWeight . bold , color: Colors . black ) ,
) ,
children: < Widget > [
FutureBuilder (
@ -407,39 +503,45 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if ( snapshot . hasError )
return Padding ( padding: EdgeInsets . all ( 10 ) , child: Text ( TranslationBase . of ( context ) . noDataAvailable ) ) ;
else
return Column (
children: [
Column ( children: [
Padding (
padding: EdgeInsets . only ( left: 10 , right: 10 ) ,
child: Row ( children: [
Expanded ( flex: 3 , child: AppText ( TranslationBase . of ( context ) . name ) ) ,
Expanded ( flex: 1 , child: AppText ( TranslationBase . of ( context ) . delete ) ) ,
] ) ) ,
Column (
children: familyFileProvider . allSharedRecordsByStatusResponse . getAllSharedRecordsByStatusList . map < Widget > ( ( result ) {
return Padding (
padding: EdgeInsets . all ( 10 ) ,
child: Row (
children: < Widget > [
Expanded ( flex: 3 , child: AppText ( result . patientName ) ) ,
Expanded (
flex: 1 ,
child: IconButton (
icon: Icon (
Icons . delete ,
color: Colors . black ,
) ,
onPressed: ( ) {
deactivateRequest ( result . iD , 5 , context ) ;
} ,
) ) ,
] ,
) ) ;
} ) . toList ( ) )
] )
] ,
) ;
return Container (
padding: EdgeInsets . all ( 15 ) ,
child: Card (
elevation: 3 ,
shape: cardRadius ( 8 ) ,
child: Column (
children: [
Column ( children: [
Padding (
padding: EdgeInsets . all ( 10 ) ,
child: Row ( children: [
Expanded ( flex: 3 , child: AppText ( TranslationBase . of ( context ) . name ) ) ,
Expanded ( flex: 1 , child: AppText ( TranslationBase . of ( context ) . delete ) ) ,
] ) ) ,
Divider ( color: Colors . black ) ,
Column (
children: familyFileProvider . allSharedRecordsByStatusResponse . getAllSharedRecordsByStatusList . map < Widget > ( ( result ) {
return Padding (
padding: EdgeInsets . all ( 10 ) ,
child: Row (
children: < Widget > [
Expanded ( flex: 3 , child: AppText ( result . patientName ) ) ,
Expanded (
flex: 1 ,
child: IconButton (
icon: Icon (
Icons . delete ,
color: Colors . black ,
) ,
onPressed: ( ) {
deactivateRequest ( result . iD , 5 , context ) ;
} ,
) ) ,
] ,
) ) ;
} ) . toList ( ) )
] )
] ,
) ) ) ;
}
} )
] ,
@ -523,38 +625,40 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
}
loginAfter ( result , context ) async {
GifLoaderDialogUtils . hideDialog ( context ) ;
var currentLang = await sharedPref . getString ( APP_LANGUAGE ) ;
Provider . of < ProjectViewModel > ( context , listen: false ) . setPrivilege ( privilegeList: result , isLoginChild: true ) ;
result = list . CheckActivationCode . fromJson ( result ) ;
var familyFile = await sharedPref . getObject ( FAMILY_FILE ) ;
result = list . CheckActivationCode . fromJson ( result ) ;
var mainUser = await sharedPref . getObject ( MAIN_USER ) ;
var bloodType = await sharedPref . getString ( BLOOD_TYPE ) ;
var loginType = await sharedPref . getInt ( LAST_LOGIN ) ;
this . sharedPref . clear ( ) ;
if ( mainUser [ " PatientID " ] ! = result . list . patientID ) {
result . list . isFamily = true ;
}
this . sharedPref . setString ( APP_LANGUAGE , currentLang ) ;
this . sharedPref . setInt ( LAST_LOGIN , loginType ) ;
this . sharedPref . setObject ( MAIN_USER , mainUser ) ;
this . sharedPref . setObject ( USER_PROFILE , result . list ) ;
this . sharedPref . setObject ( FAMILY_FILE , familyFile ) ;
this . sharedPref . setObject ( LOGIN_TOKEN_ID , result . logInTokenID ) ;
this . sharedPref . setString ( TOKEN , result . authenticationTokenID ) ;
await authenticatedUserObject . getUser ( getUser: true ) ;
Provider . of < ProjectViewModel > ( context , listen: false ) . user = authenticatedUserObject . user ;
Provider . of < ProjectViewModel > ( context , listen: false ) . setUser ( authenticatedUserObject . user ) ;
await pharmacyModuleViewModel . generatePharmacyToken ( ) . then ( ( value ) async {
if ( pharmacyModuleViewModel . error . isNotEmpty ) await pharmacyModuleViewModel . createUser ( ) ;
} ) ;
/ / await pharmacyModuleViewModel . generatePharmacyToken ( ) . then ( ( value ) async {
/ / if ( pharmacyModuleViewModel . error . isNotEmpty ) await pharmacyModuleViewModel . createUser ( ) ;
/ / } ) ;
appointmentRateViewModel
. getIsLastAppointmentRatedList ( )
. then ( ( value ) = > {
getToDoCount ( ) ,
/ / Utils. hide Progress Dialog( ) ,
GifLoaderDialog Utils. hide Dialog( context ) ,
if ( appointmentRateViewModel . isHaveAppointmentNotRate )
{
Navigator . pushAndRemoveUntil (
@ -577,7 +681,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
. catchError ( ( err ) {
print ( err ) ;
/ / Utils . hideProgressDialog ( ) ;
/ / GifLoaderDialogUtils . hideDialog ( context ) ;
GifLoaderDialogUtils . hideDialog ( context ) ;
} ) ;
}
@ -610,12 +714,12 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
}
getToDoCount ( ) {
toDoProvider . setState ( 0 , true );
toDoProvider . setState ( 0 , true , toDoProvider . notificationsCount );
ClinicListService service = new ClinicListService ( ) ;
service . getActiveAppointmentNo ( context ) . then ( ( res ) {
print ( res [ ' AppointmentActiveNumber ' ] ) ;
if ( res [ ' MessageStatus ' ] = = 1 & & res [ ' AppointmentActiveNumber ' ] ! = null ) {
toDoProvider . setState ( res [ ' AppointmentActiveNumber ' ] , true );
toDoProvider . setState ( res [ ' AppointmentActiveNumber ' ] , true , toDoProvider . notificationsCount );
} else { }
} ) . catchError ( ( err ) {
print ( err ) ;