getFn method

void getFn(
  1. BuildContext context
)

Implementation

void getFn(BuildContext context) {
  switch (editType) {
    case EditType.numbers:
    case EditType.text:
      TextEditType.showEditingText(
          context: context,
          isNumber: editType == EditType.numbers,
          title: title,
          onChanged: onChanged == null ? null : (value) => onChanged!(value),
          onEditingComplete: onEditingComplete,
          subTitle: subTitle,
          androidDialogMessage: androidDialogMessage);
      break;
    case EditType.list:
      try {
        Navigator.push(context,
            MaterialPageRoute(builder: (context) => listEditTypeView!));
      } catch (e) {
        throw Exception(
            "A ListEditTypeView is required if using EditType.list...\n$e");
      }
      break;
    case EditType.custom:
      try {
        onTap!();
      } catch (error) {
        throw Exception(
            "package: platform_settings_ui\tonTap VoidCallback must not be null when EditType is custom...\n$error");
      }
      break;
    case EditType.uneditable:
      break; // Do nothing;
  }
}