@ -43,6 +43,8 @@ import 'package:test_sa/providers/gas_request_providers/site_provider.dart';
import ' package:test_sa/providers/loading_list_notifier.dart ' ;
import ' package:test_sa/providers/loading_list_notifier.dart ' ;
import ' package:test_sa/providers/work_order/vendor_provider.dart ' ;
import ' package:test_sa/providers/work_order/vendor_provider.dart ' ;
import ' package:test_sa/views/widgets/images/multi_image_picker.dart ' ;
import ' package:test_sa/views/widgets/images/multi_image_picker.dart ' ;
import ' package:test_sa/views/widgets/item_views/info_header_widget.dart ' ;
import ' package:test_sa/views/widgets/item_views/info_text_widget.dart ' ;
import ' ../../../../../../new_views/common_widgets/default_app_bar.dart ' ;
import ' ../../../../../../new_views/common_widgets/default_app_bar.dart ' ;
import ' ../../models/new_models/department.dart ' ;
import ' ../../models/new_models/department.dart ' ;
import ' demo_detail_view_page.dart ' ;
import ' demo_detail_view_page.dart ' ;
@ -92,76 +94,23 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
SingleChildScrollView (
SingleChildScrollView (
padding: const EdgeInsets . all ( 16 ) ,
padding: const EdgeInsets . all ( 16 ) ,
child: Column (
child: Column (
spacing: 12 ,
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
mainAxisSize: MainAxisSize . min ,
mainAxisSize: MainAxisSize . min ,
children: [
children: [
/ / SingleItemDropDownMenu < Lookup , DemoPeriodLookupProvider > (
/ / context: context ,
/ / title: " Demo Period " ,
/ / initialValue: demoPeriodLookup ,
/ / showShadow: false ,
/ / validator: ( value ) {
/ / if ( value = = null ) return " Mandatory " ;
/ / return null ;
/ / } ,
/ / backgroundColor: AppColor . fieldBgColor ( context ) ,
/ / showAsBottomSheet: true ,
/ / onSelect: ( value ) {
/ / demoPeriodLookup = value ;
/ / setState ( ( ) { } ) ;
/ / } ,
/ / ) ,
/ / 16. height ,
. . . siteSection ( ) ,
. . . siteSection ( ) ,
16. height ,
. . . doctorInfoSection ( ) ,
. . . doctorInfoSection ( ) ,
16. height ,
. . . assetSection ( ) ,
. . . assetSection ( ) ,
16. height ,
. . . vendorDetailsSection ( ) ,
. . . vendorDetailsSection ( ) ,
16. height ,
. . . attachmentSection ( ) ,
" Attachments " . bodyText ( context ) . custom ( color: AppColor . black10 ) ,
8. height ,
SingleItemDropDownMenu < Lookup , DemoDocumentLookupProvider > (
context: context ,
height: 56. toScreenHeight ,
title: " Document Type " ,
initialValue: demoDocumentLookup ,
showShadow: false ,
validator: ( value ) {
if ( value = = null ) return " Mandatory " ;
return null ;
} ,
backgroundColor: AppColor . fieldBgColor ( context ) ,
showAsBottomSheet: true ,
onSelect: ( value ) {
demoDocumentLookup = value ;
setState ( ( ) { } ) ;
} ,
) ,
16. height ,
AttachmentPicker (
label: context . translation . attachments ,
attachment: _attachments ,
buttonColor: AppColor . black10 . withOpacity ( demoDocumentLookup ! = null ? 1 : . 4 ) ,
onlyImages: false ,
enabled: demoDocumentLookup ! = null ,
documentType: demoDocumentLookup ,
showAsListView: true ,
buttonIcon: ' image-plus ' . toSvgAsset ( color: ( AppColor . primary10 ) . withOpacity ( demoDocumentLookup ! = null ? 1 : . 4 ) ) ,
onChange: ( attachments ) {
_attachments = attachments ;
setState ( ( ) { } ) ;
} ,
) ,
16. height ,
Row (
Row (
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
children: [
Checkbox (
Checkbox (
value: _demoFormModel . demoEaluationAcknowledge ,
value: _demoFormModel . demoEaluationAcknowledge ,
visualDensity: const VisualDensity ( horizontal: - 4 , vertical: - 4 ) ,
activeColor: AppColor . primary10 ,
activeColor: AppColor . blueStatus ( context ) ,
side: BorderSide ( color: AppColor . loadingColor ( context ) , width: 1.0 ) ,
visualDensity: const VisualDensity ( horizontal: - 4.0 , vertical: - 4.0 ) ,
materialTapTargetSize: MaterialTapTargetSize . shrinkWrap ,
materialTapTargetSize: MaterialTapTargetSize . shrinkWrap ,
onChanged: ( value ) {
onChanged: ( value ) {
setState ( ( ) {
setState ( ( ) {
@ -172,24 +121,29 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
Column (
Column (
mainAxisSize: MainAxisSize . min ,
mainAxisSize: MainAxisSize . min ,
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
spacing: 4 ,
children: [
children: [
" DEMO outcome evaluation form acknowledgement " . bodyText ( context ) . custom ( color: context . isDark ? AppColor . primary50 : AppColor . neutral50 ) ,
InfoTextLabelWidget (
4. height ,
label: " DEMO outcome evaluation form acknowledgement " ,
" I acknowledge at the end of the trial period I will complete and submit the Medical Technology Trial Outcome Form within two weeks. "
textStyle: AppTextStyles . bodyText ,
. tinyFont ( context )
color: AppColor . textColor ( context ) ,
. custom ( color: context . isDark ? AppColor . primary50 : AppColor . neutral120 ) ,
) ,
InfoTextLabelWidget (
label: " I acknowledge at the end of the trial period I will complete and submit the Medical Technology Trial Outcome Form within two weeks. " ,
color: AppColor . lightTextColor ( context ) ,
) ,
] ,
] ,
) . expanded ,
) . expanded ,
] ,
] ,
) ,
) ,
16. height ,
Row (
Row (
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
children: [
Checkbox (
Checkbox (
value: _demoFormModel . acknowledgeNotEquipment ,
value: _demoFormModel . acknowledgeNotEquipment ,
visualDensity: const VisualDensity ( horizontal: - 4 , vertical: - 4 ) ,
activeColor: AppColor . primary10 ,
activeColor: AppColor . blueStatus ( context ) ,
side: BorderSide ( color: AppColor . loadingColor ( context ) , width: 1.0 ) ,
visualDensity: const VisualDensity ( horizontal: - 4.0 , vertical: - 4.0 ) ,
materialTapTargetSize: MaterialTapTargetSize . shrinkWrap ,
materialTapTargetSize: MaterialTapTargetSize . shrinkWrap ,
onChanged: ( value ) {
onChanged: ( value ) {
setState ( ( ) {
setState ( ( ) {
@ -200,18 +154,23 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
Column (
Column (
mainAxisSize: MainAxisSize . min ,
mainAxisSize: MainAxisSize . min ,
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
spacing: 4 ,
children: [
children: [
" Acknowledgement of not using the equipment " . bodyText ( context ) . custom ( color: context . isDark ? AppColor . primary50 : AppColor . neutral50 ) ,
InfoTextLabelWidget (
4. height ,
label: " Acknowledgement of not using the equipment " ,
" I acknowledge at the end of the trial period I will not use the DEMO medical equipment & I will not book any patient on the DEMO medical equipment. "
textStyle: AppTextStyles . bodyText ,
. tinyFont ( context )
color: AppColor . textColor ( context ) ,
. custom ( color: context . isDark ? AppColor . primary50 : AppColor . neutral120 ) ,
) ,
InfoTextLabelWidget (
label: " I acknowledge at the end of the trial period I will not use the DEMO medical equipment & I will not book any patient on the DEMO medical equipment. " ,
color: AppColor . lightTextColor ( context ) ,
) ,
] ,
] ,
) . expanded ,
) . expanded ,
] ,
] ,
) ,
) ,
] ,
] ,
) . toShadowContainer ( context , borderRadius: 20 ),
) . toShadowContainer ( context ),
) . expanded ,
) . expanded ,
FooterActionButton . footerContainer (
FooterActionButton . footerContainer (
context: context ,
context: context ,
@ -231,8 +190,7 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
List < Widget > siteSection ( ) {
List < Widget > siteSection ( ) {
return [
return [
' Site Details ' . addTranslation . bodyText ( context ) . custom ( color: AppColor . black10 ) ,
InfoHeader16Widget ( ' Site Details ' . addTranslation ) ,
8. height ,
SingleItemDropDownMenu < Site , SiteProvider > (
SingleItemDropDownMenu < Site , SiteProvider > (
context: context ,
context: context ,
title: context . translation . site ,
title: context . translation . site ,
@ -252,7 +210,6 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
setState ( ( ) { } ) ;
setState ( ( ) { } ) ;
} ,
} ,
) ,
) ,
8. height ,
SingleItemDropDownMenu < Building , NullableLoadingProvider > (
SingleItemDropDownMenu < Building , NullableLoadingProvider > (
context: context ,
context: context ,
title: context . translation . building ,
title: context . translation . building ,
@ -273,7 +230,6 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
setState ( ( ) { } ) ;
setState ( ( ) { } ) ;
} ,
} ,
) ,
) ,
8. height ,
SingleItemDropDownMenu < Floor , NullableLoadingProvider > (
SingleItemDropDownMenu < Floor , NullableLoadingProvider > (
context: context ,
context: context ,
title: context . translation . floor ,
title: context . translation . floor ,
@ -293,7 +249,6 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
setState ( ( ) { } ) ;
setState ( ( ) { } ) ;
} ,
} ,
) ,
) ,
8. height ,
SingleItemDropDownMenu < Department , NullableLoadingProvider > (
SingleItemDropDownMenu < Department , NullableLoadingProvider > (
context: context ,
context: context ,
title: context . translation . department ,
title: context . translation . department ,
@ -318,8 +273,7 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
List < Widget > doctorInfoSection ( ) {
List < Widget > doctorInfoSection ( ) {
return [
return [
" Doctor Details " . bodyText ( context ) . custom ( color: AppColor . black10 ) ,
InfoHeader16Widget ( ' Doctor Details ' . addTranslation ) ,
8. height ,
AppTextFormField (
AppTextFormField (
initialValue: " " ,
initialValue: " " ,
labelText: " Name " ,
labelText: " Name " ,
@ -336,7 +290,6 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
_demoFormModel . docName = value ;
_demoFormModel . docName = value ;
} ,
} ,
) ,
) ,
8. height ,
AppTextFormField (
AppTextFormField (
initialValue: " " ,
initialValue: " " ,
labelText: " Contact Number " ,
labelText: " Contact Number " ,
@ -353,7 +306,6 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
_demoFormModel . docNumber = value ;
_demoFormModel . docNumber = value ;
} ,
} ,
) ,
) ,
8. height ,
AppTextFormField (
AppTextFormField (
initialValue: " " ,
initialValue: " " ,
labelText: " Email " ,
labelText: " Email " ,
@ -373,7 +325,6 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
_demoFormModel . docEmail = value ;
_demoFormModel . docEmail = value ;
} ,
} ,
) ,
) ,
8. height ,
AppTextFormField (
AppTextFormField (
labelText: " Item Description " ,
labelText: " Item Description " ,
validator: ( value ) {
validator: ( value ) {
@ -391,7 +342,6 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
_demoFormModel . itemDescription = value ;
_demoFormModel . itemDescription = value ;
} ,
} ,
) ,
) ,
8. height ,
AppTextFormField (
AppTextFormField (
labelText: " Request Description " ,
labelText: " Request Description " ,
/ / validator: ( value ) {
/ / validator: ( value ) {
@ -414,8 +364,7 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
List < Widget > assetSection ( ) {
List < Widget > assetSection ( ) {
return [
return [
' Asset Details ' . addTranslation . bodyText ( context ) . custom ( color: AppColor . black10 ) ,
InfoHeader16Widget ( ' Asset Details ' . addTranslation ) ,
8. height ,
AppTextFormField (
AppTextFormField (
labelText: " Asset Name " ,
labelText: " Asset Name " ,
validator: ( value ) {
validator: ( value ) {
@ -433,7 +382,6 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
_demoFormModel . assetName = value ;
_demoFormModel . assetName = value ;
} ,
} ,
) ,
) ,
8. height ,
AppTextFormField (
AppTextFormField (
labelText: " Model " ,
labelText: " Model " ,
validator: ( value ) {
validator: ( value ) {
@ -451,7 +399,6 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
_demoFormModel . model = value ;
_demoFormModel . model = value ;
} ,
} ,
) ,
) ,
8. height ,
AppTextFormField (
AppTextFormField (
labelText: " Manufacturer " ,
labelText: " Manufacturer " ,
validator: ( value ) {
validator: ( value ) {
@ -469,7 +416,6 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
_demoFormModel . manufacturer = value ;
_demoFormModel . manufacturer = value ;
} ,
} ,
) ,
) ,
8. height ,
SingleItemDropDownMenu < Lookup , DemoPeriodLookupProvider > (
SingleItemDropDownMenu < Lookup , DemoPeriodLookupProvider > (
context: context ,
context: context ,
height: 56. toScreenHeight ,
height: 56. toScreenHeight ,
@ -492,8 +438,7 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
List < Widget > vendorDetailsSection ( ) {
List < Widget > vendorDetailsSection ( ) {
return [
return [
' Vendor Details ' . addTranslation . bodyText ( context ) . custom ( color: AppColor . black10 ) ,
InfoHeader16Widget ( ' Vendor Details ' . addTranslation ) ,
8. height ,
AppTextFormField (
AppTextFormField (
labelText: ' Vendor Name ' . addTranslation ,
labelText: ' Vendor Name ' . addTranslation ,
style: Theme . of ( context ) . textTheme . titleMedium ,
style: Theme . of ( context ) . textTheme . titleMedium ,
@ -506,7 +451,6 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
_demoFormModel . vendorName = value ;
_demoFormModel . vendorName = value ;
} ,
} ,
) ,
) ,
8. height ,
AppTextFormField (
AppTextFormField (
labelText: ' Representative Name ' . addTranslation ,
labelText: ' Representative Name ' . addTranslation ,
style: Theme . of ( context ) . textTheme . titleMedium ,
style: Theme . of ( context ) . textTheme . titleMedium ,
@ -519,7 +463,6 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
_demoFormModel . vendorRepresentativeName = value ;
_demoFormModel . vendorRepresentativeName = value ;
} ,
} ,
) ,
) ,
8. height ,
AppTextFormField (
AppTextFormField (
/ / controller: vendorPhoneController ,
/ / controller: vendorPhoneController ,
labelText: " Contact Number " ,
labelText: " Contact Number " ,
@ -533,7 +476,6 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
_demoFormModel . vendorContactNumber = value ;
_demoFormModel . vendorContactNumber = value ;
} ,
} ,
) ,
) ,
8. height ,
AppTextFormField (
AppTextFormField (
labelText: " Email " ,
labelText: " Email " ,
/ / controller: vendorEmailController ,
/ / controller: vendorEmailController ,
@ -550,6 +492,43 @@ class _CreateDemoRequestPageState extends State<CreateDemoRequestPage> with Tick
] ;
] ;
}
}
List < Widget > attachmentSection ( ) {
return [
InfoHeader16Widget ( ' Attachments ' . addTranslation ) ,
SingleItemDropDownMenu < Lookup , DemoDocumentLookupProvider > (
context: context ,
height: 56. toScreenHeight ,
title: " Document Type " ,
initialValue: demoDocumentLookup ,
showShadow: false ,
validator: ( value ) {
if ( value = = null ) return " Mandatory " ;
return null ;
} ,
backgroundColor: AppColor . fieldBgColor ( context ) ,
showAsBottomSheet: true ,
onSelect: ( value ) {
demoDocumentLookup = value ;
setState ( ( ) { } ) ;
} ,
) ,
AttachmentPicker (
label: context . translation . attachments ,
attachment: _attachments ,
buttonColor: AppColor . primary10 . withOpacity ( demoDocumentLookup ! = null ? 1 : . 4 ) ,
onlyImages: false ,
enabled: demoDocumentLookup ! = null ,
documentType: demoDocumentLookup ,
showAsListView: true ,
buttonIcon: ' image-plus ' . toSvgAsset ( color: ( AppColor . primary10 ) . withOpacity ( demoDocumentLookup ! = null ? 1 : . 4 ) ) ,
onChange: ( attachments ) {
_attachments = attachments ;
setState ( ( ) { } ) ;
} ,
) ,
] ;
}
Future < void > _submit ( ) async {
Future < void > _submit ( ) async {
FocusScope . of ( context ) . unfocus ( ) ;
FocusScope . of ( context ) . unfocus ( ) ;
if ( _formKey . currentState ! . validate ( ) ) {
if ( _formKey . currentState ! . validate ( ) ) {