|
|
|
|
@ -17,7 +17,9 @@ import 'package:test_sa/new_views/common_widgets/single_item_drop_down_menu.dart
|
|
|
|
|
import 'package:test_sa/providers/loading_list_notifier.dart';
|
|
|
|
|
|
|
|
|
|
class EvaluationFormPage extends StatefulWidget {
|
|
|
|
|
EvaluationFormPage({Key? key}) : super(key: key);
|
|
|
|
|
final int id;
|
|
|
|
|
|
|
|
|
|
const EvaluationFormPage({Key? key, required this.id}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_EvaluationFormPageState createState() {
|
|
|
|
|
@ -234,14 +236,14 @@ class _EvaluationFormPageState extends State<EvaluationFormPage> {
|
|
|
|
|
backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
|
showShadow: false,
|
|
|
|
|
showAsBottomSheet: true,
|
|
|
|
|
initialValue: formData['easeOfUse'],
|
|
|
|
|
initialValue: rating.where((obj) => obj.value == formData['easeOfUse']).firstOrNull,
|
|
|
|
|
staticData: rating,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null) return "Mandatory";
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
onSelect: (value) {
|
|
|
|
|
formData['easeOfUse'] = value;
|
|
|
|
|
formData['easeOfUse'] = value!.value;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
@ -251,14 +253,14 @@ class _EvaluationFormPageState extends State<EvaluationFormPage> {
|
|
|
|
|
backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
|
showShadow: false,
|
|
|
|
|
showAsBottomSheet: true,
|
|
|
|
|
initialValue: formData['easeOfApplication'],
|
|
|
|
|
initialValue: rating.where((obj) => obj.value == formData['easeOfApplication']).firstOrNull,
|
|
|
|
|
staticData: rating,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null) return "Mandatory";
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
onSelect: (value) {
|
|
|
|
|
formData['easeOfApplication'] = value;
|
|
|
|
|
formData['easeOfApplication'] = value!.value;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
@ -268,14 +270,14 @@ class _EvaluationFormPageState extends State<EvaluationFormPage> {
|
|
|
|
|
backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
|
showShadow: false,
|
|
|
|
|
showAsBottomSheet: true,
|
|
|
|
|
initialValue: formData['easeOfPatientSwitch'],
|
|
|
|
|
initialValue: rating.where((obj) => obj.value == formData['easeOfPatientSwitch']).firstOrNull,
|
|
|
|
|
staticData: rating,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null) return "Mandatory";
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
onSelect: (value) {
|
|
|
|
|
formData['easeOfPatientSwitch'] = value;
|
|
|
|
|
formData['easeOfPatientSwitch'] = value!.value;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
@ -285,14 +287,14 @@ class _EvaluationFormPageState extends State<EvaluationFormPage> {
|
|
|
|
|
backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
|
showShadow: false,
|
|
|
|
|
showAsBottomSheet: true,
|
|
|
|
|
initialValue: formData['patientComfort'],
|
|
|
|
|
initialValue: rating.where((obj) => obj.value == formData['patientComfort']).firstOrNull,
|
|
|
|
|
staticData: rating,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null) return "Mandatory";
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
onSelect: (value) {
|
|
|
|
|
formData['patientComfort'] = value;
|
|
|
|
|
formData['patientComfort'] = value!.value;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
// 8.height,
|
|
|
|
|
@ -374,11 +376,11 @@ class _EvaluationFormPageState extends State<EvaluationFormPage> {
|
|
|
|
|
FocusScope.of(context).unfocus();
|
|
|
|
|
if (_formKey.currentState!.validate()) {
|
|
|
|
|
_formKey.currentState!.save();
|
|
|
|
|
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
DemoProvider demoProvider = Provider.of<DemoProvider>(context, listen: false);
|
|
|
|
|
formData["id"] = 0;
|
|
|
|
|
formData["id"] = widget.id;
|
|
|
|
|
formData["isAcknowledged"] = isAcknowledged;
|
|
|
|
|
|
|
|
|
|
bool isSuccess = await demoProvider.addDemoTrialOutcome(formData);
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
if (isSuccess) {
|
|
|
|
|
|