getFormValues method

Future<List> getFormValues()

Implementation

Future<List<dynamic>> getFormValues() async {
  final List<dynamic> values = [];
  if (formsKey.currentState!.validate()) {
    for (ChangeNotifier xt in models) {
      switch (xt.runtimeType) {
        case GfFormFieldData:
          final GfFormFieldData jx = xt as GfFormFieldData;
          values.add(jx.getData());
          break;
        case GfFormDropdownData:
          final GfFormDropdownData jx = xt as GfFormDropdownData;
          values.add(jx.getValue());
          break;
        case GfGenderButtonData:
          final GfGenderButtonData jx = xt as GfGenderButtonData;
          values.add(jx.getValue());
          break;
        case GfQuestionButtonData:
          final GfQuestionButtonData jx = xt as GfQuestionButtonData;
          values.add(jx.getValue());
          break;
        case GfMultiCheckboxData:
          final GfMultiCheckboxData jx = xt as GfMultiCheckboxData;
          values.add(jx.getlistselectedindx());
          break;
        case GfMultiChipSelectData:
          final GfMultiChipSelectData jx = xt as GfMultiChipSelectData;
          values.add(jx.getlistselectedindx());
          break;
        case GfDatePickerData:
          final GfDatePickerData jx = xt as GfDatePickerData;
          values.add(jx.getDate());
          break;
        case GfTimePickerData:
          final GfTimePickerData jx = xt as GfTimePickerData;
          values.add(jx.getTime());
          break;
      }
    }
  }
  return values;
}