claude refactor
This commit is contained in:
@@ -14,8 +14,8 @@ class BlocModule<TBloc extends StateStreamableSource<TState>, TState> extends St
|
||||
@override
|
||||
Widget build(BuildContext context) => BlocProvider<TBloc>(
|
||||
create: (context) {
|
||||
var bloc = create(context);
|
||||
this.onInitialisation != null ? this.onInitialisation!(context, bloc) : null;
|
||||
final bloc = create(context);
|
||||
onInitialisation?.call(context, bloc);
|
||||
return bloc;
|
||||
},
|
||||
child: Builder(
|
||||
|
||||
+2
-1
@@ -103,7 +103,8 @@ abstract class LoadableHydratedBloc<
|
||||
Map<String, dynamic>? toJson(LoadableState<TState> state) {
|
||||
Map<String, dynamic>? data;
|
||||
try {
|
||||
data = state.data == null ? null : toStorage(state.data!);
|
||||
final stateData = state.data;
|
||||
data = stateData is TState ? toStorage(stateData) : null;
|
||||
} catch(e) {
|
||||
log('Failed to save state ${TState.toString()}: ${e.toString()}');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user