withArgAndTickerProvider<Model, Msg, Arg> static method

MVUBuilder<Model, Msg> withArgAndTickerProvider<Model, Msg, Arg>(
  1. Arg a, {
  2. required (Model, Cmd<Msg>) init(
    1. Arg
    ),
  3. required (Model, Cmd<Msg>) update(
    1. Msg,
    2. Model
    ),
  4. required MsgWidgetBuilderWithTickerProvider<Model, Msg> view,
  5. Subscription<Model, Msg>? subscriptions,
})

Creates a MVUBuilder with the given init, update and view functions.

  • init is called once with the given argument to return the initial model and commands.
  • update is called when a message is received to update the model and return new commands.
  • view is called to render the view and dispatch new messages.
  • tickerProvider is used to create a Ticker for animations.

Implementation

static MVUBuilder<Model, Msg> withArgAndTickerProvider<Model, Msg, Arg>(
  Arg a, {
  required (Model, Cmd<Msg>) Function(Arg) init,
  required (Model, Cmd<Msg>) Function(Msg, Model) update,
  required MsgWidgetBuilderWithTickerProvider<Model, Msg> view,
  Subscription<Model, Msg>? subscriptions,
}) =>
    MVUBuilder._(
        MVUProcessor.fromFunctions(
            init: () => init(a),
            update: update,
            subscriptions: subscriptions),
        view);