From b48017508abe4be04967c7cc724ded9e499f9e48 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Mon, 29 Aug 2022 19:37:31 +0300 Subject: [PATCH] Fix ProviderVolume cubit exception --- .../provider_volumes/provider_volume_cubit.dart | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/logic/cubit/provider_volumes/provider_volume_cubit.dart b/lib/logic/cubit/provider_volumes/provider_volume_cubit.dart index c1cb391a..84d8aee1 100644 --- a/lib/logic/cubit/provider_volumes/provider_volume_cubit.dart +++ b/lib/logic/cubit/provider_volumes/provider_volume_cubit.dart @@ -12,20 +12,19 @@ part 'provider_volume_state.dart'; class ApiProviderVolumeCubit extends ServerInstallationDependendCubit { ApiProviderVolumeCubit(final ServerInstallationCubit serverInstallationCubit) - : super(serverInstallationCubit, const ApiProviderVolumeState.initial()) { - final serverDetails = getIt().serverDetails; - providerApi = serverDetails == null - ? null - : VolumeApiFactoryCreator.createVolumeProviderApiFactory( - getIt().serverDetails!.provider, - ); - } + : super(serverInstallationCubit, const ApiProviderVolumeState.initial()); VolumeProviderApiFactory? providerApi; @override Future load() async { if (serverInstallationCubit.state is ServerInstallationFinished) { + final serverDetails = getIt().serverDetails; + providerApi = serverDetails == null + ? null + : VolumeApiFactoryCreator.createVolumeProviderApiFactory( + getIt().serverDetails!.provider, + ); _refetch(); } }