@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import ' package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart ' ;
import ' package:diplomaticquarterapp/pages/base/base_view.dart ' ;
import ' package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart ' ;
import ' package:diplomaticquarterapp/theme/colors.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 ' ;
@ -66,316 +67,297 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
} ,
builder: ( _ , model , widget ) = > AppScaffold (
isShowAppBar: false ,
backgroundColor: CustomColors . appBackgroudGrey2Color ,
body: SingleChildScrollView (
physics: ScrollPhysics ( ) ,
child: Container (
margin: EdgeInsets . all ( 12 ) ,
child: Center (
child: FractionallySizedBox (
widthFactor: 0.94 ,
child: Column (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
SizedBox (
height: 20 ,
) ,
Center (
child: Texts (
TranslationBase . of ( context ) . otherInfo ,
textAlign: TextAlign . center ,
) ,
) ,
SizedBox (
height: 12 ,
) ,
Container (
padding: EdgeInsets . only ( top: 10 ) ,
decoration: BoxDecoration (
borderRadius: BorderRadius . circular ( 12 ) ,
color: Colors . white ,
) ,
child: Column (
children: [
Row (
mainAxisAlignment: MainAxisAlignment . start ,
children: [
Padding (
padding: const EdgeInsets . symmetric ( horizontal: 9 ) ,
child: Texts (
TranslationBase . of ( context ) . medicalReport ,
color: Colors . grey ,
fontSize: 17 ,
) ,
) ,
] ,
) ,
InkWell (
onTap: ( ) {
ImageOptions . showImageOptions (
context ,
( String image , File file ) {
setState ( ( ) {
EReferralAttachment eReferralAttachment = new EReferralAttachment ( fileName: ' image ${ medicalReportImages . length + 1 } .png ' , base64String: image ) ;
medicalReportImages . add ( eReferralAttachment ) ;
} ) ;
} ,
) ;
} ,
child: Container (
margin: EdgeInsets . only ( left: 10 , right: 10 , top: 15 ) ,
height: 50 ,
decoration: BoxDecoration (
border: Border . all ( color: Colors . grey ) ,
borderRadius: BorderRadius . circular ( 7 ) ,
color: Colors . white ,
shape: BoxShape . rectangle ,
) ,
child: Center (
child: Row (
crossAxisAlignment: CrossAxisAlignment . center ,
mainAxisAlignment: MainAxisAlignment . center ,
children: < Widget > [
Icon ( Icons . attach_file ) ,
Texts (
TranslationBase . of ( context ) . selectAttachment ,
variant: ' bodyText ' ,
textAlign: TextAlign . center ,
) ,
] ,
) ,
child: Column (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
SizedBox (
height: 20 ,
) ,
Text (
TranslationBase . of ( context ) . otherInfo ,
style: TextStyle (
fontSize: 16 ,
fontWeight: FontWeight . w600 ,
letterSpacing: - 0.64 ,
) ,
) ,
SizedBox (
height: 12 ,
) ,
Container (
padding: EdgeInsets . all ( 12 ) ,
decoration: BoxDecoration (
borderRadius: BorderRadius . circular ( 12 ) ,
color: Colors . white ,
) ,
child: Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
TranslationBase . of ( context ) . medicalReport ,
style: TextStyle (
fontSize: 12 ,
letterSpacing: - 0.48 ,
fontWeight: FontWeight . w600 ,
) ,
) ,
) ,
SizedBox (
height: 12 ,
) ,
. . . List . generate (
. . . List . generate (
medicalReportImages . length ,
( index ) = > Container (
margin: EdgeInsets . all ( 10 ) ,
padding: EdgeInsets . all ( 8.0 ) ,
child: Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
padding: EdgeInsets . only ( top: 6 , bottom: 6 ) ,
child: Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: < Widget > [
Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
Icon ( FontAwesomeIcons . paperclip ) ,
SizedBox (
width: 8 ,
) ,
Texts (
medicalReportImages [ index ] . fileName ,
) ,
] ,
Texts (
medicalReportImages [ index ] . fileName ,
) ,
InkWell (
onTap: ( ) {
setState ( ( ) {
medicalReportImages . remove ( medicalReportImages [ index ] ) ;
} ) ;
} ,
child: Icon (
FontAwesomeIcons . trashAlt ,
color: Colors . red [ 300 ] ,
) )
] ,
) ,
) ) ,
] ,
InkWell (
onTap: ( ) {
setState ( ( ) {
medicalReportImages . remove ( medicalReportImages [ index ] ) ;
} ) ;
} ,
child: Icon (
Icons . close ,
color: Colors . red [ 300 ] ,
) )
] ,
) ,
) ,
) ,
InkWell (
onTap: ( ) {
ImageOptions . showImageOptions (
context ,
( String image , File file ) {
setState ( ( ) {
EReferralAttachment eReferralAttachment = new EReferralAttachment ( fileName: ' image ${ medicalReportImages . length + 1 } .png ' , base64String: image ) ;
medicalReportImages . add ( eReferralAttachment ) ;
} ) ;
} ,
) ;
} ,
child: Padding (
padding: EdgeInsets . only ( top: 12 , bottom: 12 ) ,
child: Text (
TranslationBase . of ( context ) . selectAttachment ,
style: TextStyle (
fontSize: 14 ,
letterSpacing: - 0.56 ,
decoration: TextDecoration . underline ,
color: CustomColors . accentColor ,
) ,
) ,
) ,
) ,
] ,
) ,
) ,
) ,
SizedBox (
height: 12 ,
) ,
Container (
padding: EdgeInsets . only ( top: 10 ) ,
decoration: BoxDecoration ( borderRadius: BorderRadius . circular ( 12 ) , color: Colors . white ) ,
child: Column (
children: [
Container (
width: double . infinity ,
decoration: containerRadius ( Colors . white , 12 ) ,
margin: EdgeInsets . only ( left: 20 , right: 20 ) ,
padding: EdgeInsets . only ( left: 10 , right: 10 , top: 12 , bottom: 12 ) ,
child: Row (
children: [
Flexible (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
TranslationBase . of ( context ) . preferredBranch ,
style: TextStyle (
fontSize: 11 ,
letterSpacing: - 0.44 ,
fontWeight: FontWeight . w600 ,
) ,
) ,
Container (
height: 18 ,
child: DropdownButtonHideUnderline (
child: DropdownButton < String > (
key: projectDropdownKey ,
hint: Text ( TranslationBase . of ( context ) . selectPreferredBranch ) ,
value: projectDropdownValue ,
iconSize: 0 ,
isExpanded: true ,
style: TextStyle ( fontSize: 14 , letterSpacing: - 0.56 , color: Colors . black ) ,
items: projectsList . map ( ( item ) {
return new DropdownMenuItem < String > (
value: item . mainProjectID . toString ( ) + " , " + item . name . toString ( ) ,
child: new Text ( item . name ) ,
) ;
} ) . toList ( ) ,
onChanged: ( newValue ) {
setState ( ( ) {
projectDropdownValue = newValue ;
print ( projectDropdownValue ) ;
} ) ;
} ,
) ,
) ,
Icon ( Icons . attach_file ) ,
] ,
) ,
) ,
SizedBox (
height: 12 ,
) ,
Container (
padding: EdgeInsets . only ( top: 10 ) ,
decoration: BoxDecoration ( borderRadius: BorderRadius . circular ( 12 ) , color: Colors . white ) ,
child: Column (
children: [
Container (
width: double . infinity ,
decoration: containerRadius ( Colors . white , 12 ) ,
margin: EdgeInsets . only ( left: 20 , right: 20 ) ,
padding: EdgeInsets . only ( left: 10 , right: 10 , top: 12 , bottom: 12 ) ,
child: Row (
children: [
Flexible (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
TranslationBase . of ( context ) . preferredBranch ,
style: TextStyle (
fontSize: 11 ,
letterSpacing: - 0.44 ,
fontWeight: FontWeight . w600 ,
) ,
) ,
Container (
height: 18 ,
child: DropdownButtonHideUnderline (
child: DropdownButton < String > (
key: projectDropdownKey ,
hint: Text ( TranslationBase . of ( context ) . selectPreferredBranch ) ,
value: projectDropdownValue ,
iconSize: 0 ,
isExpanded: true ,
style: TextStyle ( fontSize: 14 , letterSpacing: - 0.56 , color: Colors . black ) ,
items: projectsList . map ( ( item ) {
return new DropdownMenuItem < String > (
value: item . mainProjectID . toString ( ) + " , " + item . name . toString ( ) ,
child: new Text ( item . name ) ,
) ;
} ) . toList ( ) ,
onChanged: ( newValue ) {
setState ( ( ) {
projectDropdownValue = newValue ;
print ( projectDropdownValue ) ;
} ) ;
} ,
) ,
] ,
) ,
) ,
) ,
Icon ( Icons . keyboard_arrow_down ) ,
] ,
) ) ,
] ,
) ,
) ,
SizedBox (
height: 12 ,
) ,
Container (
decoration: BoxDecoration ( borderRadius: BorderRadius . circular ( 12 ) , color: Colors . white ) ,
child: Column (
] ,
) ,
) ,
Icon ( Icons . keyboard_arrow_down ) ,
] ,
) ) ,
] ,
) ,
) ,
SizedBox (
height: 12 ,
) ,
Container (
decoration: BoxDecoration ( borderRadius: BorderRadius . circular ( 12 ) , color: Colors . white ) ,
child: Column (
children: [
Row (
mainAxisAlignment: MainAxisAlignment . start ,
children: [
Row (
mainAxisAlignment: MainAxisAlignment . start ,
children: [
Row (
children: [
Checkbox (
value: isPatientInsured ,
activeColor: Colors . black38 ,
onChanged: ( bool newValue ) {
setState ( ( ) {
isPatientInsured = newValue ;
} ) ;
} ) ,
Padding (
padding: const EdgeInsets . all ( 20.0 ) ,
child: Texts (
TranslationBase . of ( context ) . insuredPatientReferral ,
fontSize: 17 ,
) ,
) ,
] ,
Checkbox (
value: isPatientInsured ,
activeColor: Colors . black38 ,
onChanged: ( bool newValue ) {
setState ( ( ) {
isPatientInsured = newValue ;
} ) ;
} ) ,
Padding (
padding: const EdgeInsets . all ( 20.0 ) ,
child: Texts (
TranslationBase . of ( context ) . insuredPatientReferral ,
fontSize: 17 ,
) ,
) ,
] ,
) ,
] ,
) ,
] ,
) ,
) ,
if ( isPatientInsured )
SizedBox (
height: 12 ,
) ,
Opacity (
opacity: isPatientInsured ? 1 : 0 ,
child: Container (
padding: EdgeInsets . all ( 10 ) ,
decoration: BoxDecoration (
borderRadius: BorderRadius . circular ( 12 ) ,
color: Colors . white ,
) ,
if ( isPatientInsured )
SizedBox (
height: 12 ,
) ,
Opacity (
opacity: isPatientInsured ? 1 : 0 ,
child: Container (
padding: EdgeInsets . only ( top: 10 ) ,
decoration: BoxDecoration (
borderRadius: BorderRadius . circular ( 12 ) ,
color: Colors . white ,
) ,
child: Column (
children: [
InkWell (
onTap: ( ) {
ImageOptions . showImageOptions ( context , ( String image , File file ) {
setState ( ( ) {
EReferralAttachment eReferralAttachment = new EReferralAttachment ( fileName: ' image ${ medicalReportImages . length + 1 } .png ' , base64String: image ) ;
insuredPatientImages = [ eReferralAttachment ] ;
} ) ;
} ) ;
} ,
child: Container (
margin: EdgeInsets . only ( left: 10 , right: 10 , top: 15 ) ,
height: 50 ,
decoration: BoxDecoration (
border: Border . all ( color: Colors . grey ) ,
borderRadius: BorderRadius . circular ( 7 ) ,
color: Colors . white ,
shape: BoxShape . rectangle ,
) ,
child: Center (
child: Row (
crossAxisAlignment: CrossAxisAlignment . center ,
mainAxisAlignment: MainAxisAlignment . center ,
children: < Widget > [
Icon ( Icons . attach_file ) ,
Texts (
' selected attachment ' ,
variant: ' bodyText ' ,
textAlign: TextAlign . center ,
) ,
] ,
) ,
child: Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
TranslationBase . of ( context ) . medicalReport ,
style: TextStyle (
fontSize: 12 ,
letterSpacing: - 0.48 ,
fontWeight: FontWeight . w600 ,
) ,
) ,
) ,
SizedBox (
height: 12 ,
) ,
. . . List . generate (
. . . List . generate (
insuredPatientImages . length ,
( index ) = > Container (
margin: EdgeInsets . all ( 10 ) ,
padding: EdgeInsets . all ( 8.0 ) ,
child: Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
padding: EdgeInsets . only ( top: 6 , bottom: 6 ) ,
child: Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: < Widget > [
Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
Icon ( FontAwesomeIcons . paperclip ) ,
SizedBox (
width: 8 ,
) ,
Texts (
' image ${ index + 1 } .png ' ,
) ,
] ,
Texts (
' image ${ index + 1 } .png ' ,
) ,
InkWell (
onTap: ( ) {
setState ( ( ) {
insuredPatientImages . remove ( insuredPatientImages [ index ] ) ;
} ) ;
} ,
child: Icon (
FontAwesomeIcons . trashAlt ,
color: Colors . red [ 300 ] ,
) )
] ,
) ,
) ) ,
] ,
InkWell (
onTap: ( ) {
setState ( ( ) {
insuredPatientImages . remove ( insuredPatientImages [ index ] ) ;
} ) ;
} ,
child: Icon (
Icons . close ,
color: Colors . red [ 300 ] ,
) ,
)
] ,
) ,
) ,
) ,
InkWell (
onTap: ( ) {
ImageOptions . showImageOptions ( context , ( String image , File file ) {
setState ( ( ) {
EReferralAttachment eReferralAttachment = new EReferralAttachment ( fileName: ' image ${ medicalReportImages . length + 1 } .png ' , base64String: image ) ;
insuredPatientImages = [ eReferralAttachment ] ;
} ) ;
} ) ;
} ,
child: Padding (
padding: const EdgeInsets . only ( top: 12 , bottom: 12 ) ,
child: Text (
TranslationBase . of ( context ) . selectAttachment ,
style: TextStyle (
fontSize: 14 ,
letterSpacing: - 0.56 ,
decoration: TextDecoration . underline ,
color: CustomColors . accentColor ,
) ,
) ,
) ,
) ,
] ,
) ,
) ,
) ,
) ,
SizedBox (
height: 12 ,
Icon ( Icons . attach_file ) ,
] ,
) ,
] ,
) ,
) ,
) ,
] ,
) ,
) ,
) ,