showFieldEditorModal function

Future<Field?> showFieldEditorModal({
  1. required BuildContext context,
  2. required Model model,
  3. required Field field,
})

Implementation

Future<Field?> showFieldEditorModal({
  required BuildContext context,
  required Model model,
  required Field field,
}) async {
  final Field? result = await showDialog<Field>(
    context: context,
    barrierDismissible: false,
    builder: (BuildContext context) => BlocProvider<BaseDocumentBloc>(
      create: (BuildContext context) => FieldEditionBloc(
        entity: model,
        field: field,
        fieldType: field.type,
        draftService: context.read(),
      ),
      child: FieldEditorModal(
        entity: model,
        field: field,
      ),
    ),
  );
  return result;
}