@ -32,6 +32,8 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import ' package:diplomaticquarterapp/routes.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 ' ;
import ' package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart ' ;
import ' package:diplomaticquarterapp/uitl/utils_new.dart ' ;
import ' package:diplomaticquarterapp/extensions/string_extensions.dart ' ;
class MyFamily extends StatefulWidget {
class MyFamily extends StatefulWidget {
final bool isAppbarVisible ;
final bool isAppbarVisible ;
@ -55,6 +57,7 @@ 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 ) ;
@ -195,50 +198,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 (
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 ) ,
padding: EdgeInsets . all ( 10 ) ,
child: Row (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
children: < Widget > [
Expanded ( flex: 3 , child: Text ( result . patientName ) ) ,
Texts (
Expanded (
result . patientName . toLowerCase ( ) . capitalizeFirstofEach ,
flex: 2 ,
fontSize: 22 ,
child: IconButton (
fontWeight: FontWeight . bold ,
icon: Icon ( Icons . group ) ,
color: Colors . white ,
color: Colors . black ,
) ,
onPressed: ( ) {
Texts ( TranslationBase . of ( context ) . fileNumber + ' : ' + result . responseID . toString ( ) , fontSize: 12 , color: Colors . white ) ,
switchUser ( result , context ) ;
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 ) ;
} ,
} ,
) ) ,
Expanded (
flex: 1 ,
child: IconButton (
icon: Icon (
Icons . delete ,
color: Colors . black ,
) ,
) ,
onPressed: ( ) {
Texts (
TranslationBase . of ( context ) . switchUser ,
color: Colors . white ,
fontSize: 12 ,
)
] ,
) ,
InkWell (
onTap: ( ) {
deleteFamily ( result , context ) ;
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,8 +366,7 @@ 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 ) ) ,
@ -525,7 +582,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 +615,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 +638,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 ) ;
} ) ;
} ) ;
}
}