Skip to content

Commit

Permalink
refactor(djangoflow_app): Expose AppCubit.internal
Browse files Browse the repository at this point in the history
- Exposed via `visibleForTesting` annotation
- This will help creating separate instances for testing
  • Loading branch information
Ajil Oommen authored and ajil-apx committed Oct 31, 2023
1 parent 82d4fab commit 2c1996a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/djangoflow_app/lib/src/bloc/app_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ class AppState with _$AppState {

class AppCubit extends HydratedCubit<AppState> {
static AppCubit get instance => _instance;
static final AppCubit _instance = AppCubit._internal();
static final AppCubit _instance = AppCubit.internal();
static PackageInfo? packageInfo;

static AppState? _initialState;
static set initialState(AppState? appState) => _initialState = appState;

AppCubit._internal() : super(_initialState ?? const AppState());
@visibleForTesting
AppCubit.internal() : super(_initialState ?? const AppState());

void firstRunDone() => emit(state.copyWith(firstRun: false));

Expand Down

0 comments on commit 2c1996a

Please sign in to comment.