From d6871e448e0537fe6191b38361b9ed828d8f12da Mon Sep 17 00:00:00 2001 From: NaiJi Date: Wed, 4 Oct 2023 04:06:08 -0300 Subject: [PATCH] refactor: Remove BackblazeFormCubit dependency on BackupsCubit --- .../forms/setup/initializing/backblaze_form_cubit.dart | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/logic/cubit/forms/setup/initializing/backblaze_form_cubit.dart b/lib/logic/cubit/forms/setup/initializing/backblaze_form_cubit.dart index 534c9c79..cbd96318 100644 --- a/lib/logic/cubit/forms/setup/initializing/backblaze_form_cubit.dart +++ b/lib/logic/cubit/forms/setup/initializing/backblaze_form_cubit.dart @@ -2,12 +2,11 @@ import 'dart:async'; import 'package:cubit_form/cubit_form.dart'; import 'package:selfprivacy/config/get_it_config.dart'; import 'package:selfprivacy/logic/api_maps/rest_maps/backblaze.dart'; -import 'package:selfprivacy/logic/cubit/backups/backups_cubit.dart'; import 'package:selfprivacy/logic/models/hive/backups_credential.dart'; import 'package:easy_localization/easy_localization.dart'; class BackblazeFormCubit extends FormCubit { - BackblazeFormCubit(this.backupsCubit) { + BackblazeFormCubit(this.onSubmitCallback) { keyId = FieldCubit( initalValue: '', validations: [ @@ -27,17 +26,17 @@ class BackblazeFormCubit extends FormCubit { @override FutureOr onSubmit() async { - await backupsCubit.setBackupsKey( + await onSubmitCallback( keyId.state.value, applicationKey.state.value, ); } - final BackupsCubit backupsCubit; - late final FieldCubit keyId; late final FieldCubit applicationKey; + final Function(String keyId, String applicationKey) onSubmitCallback; + @override FutureOr asyncValidation() async { late GenericResult backblazeResponse;