@ -1,5 +1,6 @@
import ' dart:ui ' ;
import ' dart:ui ' ;
import ' package:diplomaticquarterapp/config/shared_pref_kay.dart ' ;
import ' package:diplomaticquarterapp/config/size_config.dart ' ;
import ' package:diplomaticquarterapp/config/size_config.dart ' ;
import ' package:diplomaticquarterapp/core/model/ImagesInfo.dart ' ;
import ' package:diplomaticquarterapp/core/model/ImagesInfo.dart ' ;
import ' package:diplomaticquarterapp/core/service/AuthenticatedUserObject.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/appointment_rate_view_model.dart ' ;
import ' package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_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/core/viewModels/project_view_model.dart ' ;
import ' package:diplomaticquarterapp/extensions/string_extensions.dart ' ;
import ' package:diplomaticquarterapp/locator.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/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/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart ' ;
import ' package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart ' ;
import ' package:diplomaticquarterapp/pages/landing/landing_page.dart ' ;
import ' package:diplomaticquarterapp/pages/landing/landing_page.dart ' ;
import ' package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.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/services/family_files/family_files_provider.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_shared_preferences.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_shared_preferences.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_toast.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_toast.dart ' ;
import ' package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart ' ;
import ' package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.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/card/rounded_container.dart ' ;
import ' package:diplomaticquarterapp/widgets/data_display/text.dart ' ;
import ' package:diplomaticquarterapp/widgets/data_display/text.dart ' ;
import ' package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.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: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:diplomaticquarterapp/config/shared_pref_kay.dart ' ;
import ' package:diplomaticquarterapp/routes.dart ' ;
import ' package:provider/provider.dart ' ;
import ' package:provider/provider.dart ' ;
import ' package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart ' ;
class MyFamily extends StatefulWidget {
class MyFamily extends StatefulWidget {
final bool isAppbarVisible ;
final bool isAppbarVisible ;
MyFamily ( { this . isAppbarVisible = true } ) ;
MyFamily ( { this . isAppbarVisible = true } ) ;
@ override
@ override
_MyFamily createState ( ) = > _MyFamily ( ) ;
_MyFamily createState ( ) = > _MyFamily ( ) ;
}
}
@ -55,6 +59,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
PharmacyModuleViewModel pharmacyModuleViewModel = locator < PharmacyModuleViewModel > ( ) ;
PharmacyModuleViewModel pharmacyModuleViewModel = locator < PharmacyModuleViewModel > ( ) ;
ToDoCountProviderModel toDoProvider ;
ToDoCountProviderModel toDoProvider ;
var isVaiable = false ;
var isVaiable = false ;
bool isSwitchUser = false ;
@ override
@ override
void initState ( ) {
void initState ( ) {
_tabController = new TabController ( length: 2 , vsync: this , initialIndex: 0 ) ;
_tabController = new TabController ( length: 2 , vsync: this , initialIndex: 0 ) ;
@ -102,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 (
Center (
child: Container (
child:
height: 60.0 ,
/ / TabBar (
margin: EdgeInsets . only ( top: 10.0 ) ,
/ / isScrollable: true ,
width: MediaQuery . of ( context ) . size . width * 0.92 , / / 0.9 ,
/ / controller: _tabController ,
decoration: BoxDecoration (
/ / indicatorWeight: 5.0 ,
border: Border (
/ / indicatorSize: TabBarIndicatorSize . tab ,
bottom: BorderSide ( color: Theme . of ( context ) . dividerColor , width: 0.9 ) , / / width: 0.7
/ / labelPadding: EdgeInsets . only ( top: 4.0 , left: 35.0 , right: 35.0 ) ,
) ,
/ / unselectedLabelColor: Colors . grey [ 800 ] ,
color: Colors . white ) ,
/ / tabs: [
child: Center (
/ / Container (
child: TabBar (
/ / width: MediaQuery . of ( context ) . size . width * 0.30 ,
isScrollable: true ,
/ / child: Center (
controller: _tabController ,
/ / child: AppText ( TranslationBase . of ( context ) . family ) ,
indicatorWeight: 5.0 ,
/ / ) ,
/ / indicatorSize: TabBarIndicatorSize . label ,
/ / ) ,
indicatorSize: TabBarIndicatorSize . tab ,
/ / Container (
/ / width: MediaQuery . of ( context ) . size . width * 0.30 ,
/ / indicatorColor: Theme . of ( context ) . primaryColor ,
/ / child: Center (
/ / labelColor: Theme . of ( context ) . primaryColor ,
/ / child: AppText ( TranslationBase . of ( context ) . request ) ,
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 ,
TabBar (
child: Center (
controller: _tabController ,
child: AppText ( TranslationBase . of ( context ) . family ) ,
indicatorWeight: 3.0 ,
) ,
indicatorSize: TabBarIndicatorSize . tab ,
) ,
labelColor: Color ( 0xff2B353E ) ,
Container (
unselectedLabelColor: Color ( 0xff575757 ) ,
width: MediaQuery . of ( context ) . size . width * 0.30 ,
labelPadding: EdgeInsets . only ( top: 15 , bottom: 13 , left: 20 , right: 20 ) ,
child: Center (
labelStyle: TextStyle (
child: AppText ( TranslationBase . of ( context ) . request ) ,
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 ) ] ,
) ,
) ,
) ,
) ,
/ / ) ,
/ / ) ,
] ,
] ,
) ,
) ,
) ,
) ,
@ -159,15 +183,14 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
] ,
] ,
) ,
) ,
bottomSheet: Container (
bottomSheet: Container (
width: MediaQuery . of ( context ) . size . width ,
color: Theme . of ( context ) . scaffoldBackgroundColor ,
height: 70.0 ,
width: double . infinity ,
margin: EdgeInsets . only ( left: 15.0 , right: 15.0 , top: 10.0 ) ,
padding: EdgeInsets . all ( 14 ) ,
child: Button (
child: DefaultButton (
onTap: ( ) async {
TranslationBase . of ( context ) . addFamilyMember ,
( ) async {
Navigator . of ( context ) . pushNamed ( ADD_FAMILY_MEMBER_TYPE ) ;
Navigator . of ( context ) . pushNamed ( ADD_FAMILY_MEMBER_TYPE ) ;
} ,
} ,
label: TranslationBase . of ( context ) . addFamilyMember ,
backgroundColor: Colors . red [ 900 ] ,
) ,
) ,
) ,
) ,
) ,
) ,
@ -195,50 +218,105 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
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 . spaceBetween ,
/ / mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: < Widget > [
/ / children: < Widget > [
Expanded (
/ / Expanded (
flex: 3 ,
/ / flex: 3 ,
child: Texts (
/ / child: Texts (
TranslationBase . of ( context ) . request ,
/ / TranslationBase . of ( context ) . request ,
textAlign: TextAlign . center ,
/ / textAlign: TextAlign . center ,
) ) ,
/ / ) ) ,
Expanded ( flex: 2 , child: Texts ( TranslationBase . of ( context ) . switchUser , 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 ) ) ,
/ / Expanded ( flex: 1 , child: Texts ( TranslationBase . of ( context ) . deleteView , textAlign: TextAlign . center ) ) ,
] ,
/ / ] ,
) ,
/ / ) ,
Column (
Column (
mainAxisAlignment: MainAxisAlignment . start ,
mainAxisAlignment: MainAxisAlignment . start ,
children: snapshot . data . getAllSharedRecordsByStatusList . map < Widget > ( ( result ) {
children: snapshot . data . getAllSharedRecordsByStatusList . map < Widget > ( ( result ) {
return result . status = = 3
return result . status = = 3
? Padding (
? Card (
padding: EdgeInsets . all ( 10 ) ,
margin: EdgeInsets . all ( 10 ) ,
child: Row (
shape: cardRadius ( 15 ) ,
children: < Widget > [
color: result . gender = = 1 ? Color ( 0xff6EA8FF ) : Color ( 0xffFDA4B0 ) ,
Expanded ( flex: 3 , child: Text ( result . patientName ) ) ,
elevation: 3 ,
Expanded (
child: Container (
flex: 2 ,
/ / height: 130 ,
child: IconButton (
width: MediaQuery . of ( context ) . size . width ,
icon: Icon ( Icons . group ) ,
padding: EdgeInsets . all ( 10 ) ,
color: Colors . black ,
child: Column (
onPressed: ( ) {
crossAxisAlignment: CrossAxisAlignment . start ,
switchUser ( result , context ) ;
children: < Widget > [
} ,
Texts (
) ) ,
result . patientName . toLowerCase ( ) . capitalizeFirstofEach ,
Expanded (
fontSize: 22 ,
flex: 1 ,
fontWeight: FontWeight . bold ,
child: IconButton (
color: Colors . white ,
icon: Icon (
) ,
Icons . delete ,
Texts ( TranslationBase . of ( context ) . fileNumber + ' : ' + result . responseID . toString ( ) , fontSize: 12 , color: Colors . white ) ,
color: Colors . black ,
Texts ( result . age . toString ( ) + ' ' + TranslationBase . of ( context ) . years + ' , ' + result . genderDescription , fontSize: 12 , color: Colors . white ) ,
) ,
Row (
onPressed: ( ) {
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
deleteFamily ( result , context ) ;
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 ( ) ;
: SizedBox ( ) ;
} ) . toList ( ) )
} ) . toList ( ) )
] ) ) ;
] ) ) ;
@ -308,35 +386,34 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
] ) ) ,
] ) ) ,
Column (
Column (
children: familyFileProvider . allSharedRecordsByStatusResponse . getAllSharedRecordsByStatusList . map < Widget > ( ( result ) {
children: familyFileProvider . allSharedRecordsByStatusResponse . getAllSharedRecordsByStatusList . map < Widget > ( ( result ) {
return Padding (
return Card (
padding: EdgeInsets . all ( 10 ) ,
child: Row (
child: Row (
children: < Widget > [
children: < Widget > [
Expanded ( flex: 3 , child: Text ( result . patientName ) ) ,
Expanded ( flex: 3 , child: Text ( result . patientName ) ) ,
Expanded (
Expanded (
flex: 1 ,
flex: 1 ,
child: IconButton (
child: IconButton (
icon: Icon (
icon: Icon (
Icons . check_circle ,
Icons . check_circle ,
color: Colors . black ,
color: Colors . black ,
) ,
) ,
onPressed: ( ) {
onPressed: ( ) {
acceptRemoveRequest ( result . iD , 3 , context ) ;
acceptRemoveRequest ( result . iD , 3 , context ) ;
} ,
} ,
) ) ,
) ) ,
Expanded (
Expanded (
flex: 1 ,
flex: 1 ,
child: IconButton (
child: IconButton (
icon: Icon (
icon: Icon (
Icons . delete ,
Icons . delete ,
color: Colors . black ,
color: Colors . black ,
) ,
) ,
onPressed: ( ) {
onPressed: ( ) {
acceptRemoveRequest ( result . iD , 4 , context ) ;
acceptRemoveRequest ( result . iD , 4 , context ) ;
} ,
} ,
) )
) )
] ,
] ,
) ) ;
) ) ;
} ) . toList ( ) )
} ) . toList ( ) )
] )
] )
] ,
] ,
@ -525,7 +602,6 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
}
}
loginAfter ( result , context ) async {
loginAfter ( result , context ) async {
GifLoaderDialogUtils . hideDialog ( context ) ;
var currentLang = await sharedPref . getString ( APP_LANGUAGE ) ;
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 ) ;
result = list . CheckActivationCode . fromJson ( result ) ;
@ -559,7 +635,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
. getIsLastAppointmentRatedList ( )
. getIsLastAppointmentRatedList ( )
. then ( ( value ) = > {
. then ( ( value ) = > {
getToDoCount ( ) ,
getToDoCount ( ) ,
/ / Utils. hide Progress Dialog( ) ,
GifLoaderDialog Utils. hide Dialog( context ) ,
if ( appointmentRateViewModel . isHaveAppointmentNotRate )
if ( appointmentRateViewModel . isHaveAppointmentNotRate )
{
{
Navigator . pushAndRemoveUntil (
Navigator . pushAndRemoveUntil (
@ -582,7 +658,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
. catchError ( ( err ) {
. catchError ( ( err ) {
print ( err ) ;
print ( err ) ;
/ / Utils . hideProgressDialog ( ) ;
/ / Utils . hideProgressDialog ( ) ;
/ / GifLoaderDialogUtils . hideDialog ( context ) ;
GifLoaderDialogUtils . hideDialog ( context ) ;
} ) ;
} ) ;
}
}