OnBuilder<T>.create constructor
OnBuilder<T>.create ({
- Key? key,
- @Deprecated('Use creator instead') ReactiveModel<
T> create()?, - T creator()?,
- SideEffects<
T> ? sideEffects, - required Widget builder(
- ReactiveModel<
T> rm
- ReactiveModel<
If creator is null, a ReactiveModel
Implementation
OnBuilder.create({
Key? key,
@Deprecated('Use creator instead') ReactiveModel<T> Function()? create,
T Function()? creator,
SideEffects<T>? sideEffects,
required Widget Function(ReactiveModel<T> rm) builder,
}) : super(
key: key,
observers: (_) => [
creator != null
? ReactiveModel<T>.create(
creator: creator,
initialState: null,
autoDisposeWhenNotUsed: true,
) as ReactiveModelImp<T>
: create != null
? create() as ReactiveModelImp<T>
: ReactiveModel<T>.create(
creator: () => null,
initialState: null,
autoDisposeWhenNotUsed: true,
) as ReactiveModelImp<void>,
],
builder: (_, __, rm) => builder(rm),
sideEffects: sideEffects,
);