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