createModel<T extends FlutterFlowModel<Widget>> function

T createModel<T extends FlutterFlowModel<Widget>>(
  1. BuildContext context,
  2. T defaultBuilder()
)

Implementation

T createModel<T extends FlutterFlowModel>(
  BuildContext context,
  T Function() defaultBuilder,
) {
  final model = context.read<T?>() ?? defaultBuilder();
  model._init(context);
  return model;
}