resolveFluentToastState function

FluentToastState resolveFluentToastState({
  1. required Widget title,
  2. FluentToastIntent intent = FluentToastIntent.info,
  3. FluentToastType type = FluentToastType.dismiss,
  4. bool showIcon = true,
  5. Widget? icon,
  6. Widget? body,
  7. Widget? subtitle,
  8. List<Widget> footer = const <Widget>[],
  9. Widget? end,
})

Builds the state a toast will be styled and rendered from.

The first of the three-function recomposition contract, and the only place the default glyph is chosen: icon overrides FluentToastIntent.glyph, and showIcon: false suppresses the glyph altogether.

Implementation

FluentToastState resolveFluentToastState({
  required Widget title,
  FluentToastIntent intent = FluentToastIntent.info,
  FluentToastType type = FluentToastType.dismiss,
  bool showIcon = true,
  Widget? icon,
  Widget? body,
  Widget? subtitle,
  List<Widget> footer = const <Widget>[],
  Widget? end,
}) {
  final glyph = intent.glyph;
  return FluentToastState(
    title: title,
    intent: intent,
    type: type,
    icon: showIcon ? (icon ?? (glyph == null ? null : Icon(glyph))) : null,
    body: body,
    subtitle: subtitle,
    footer: footer,
    end: end,
  );
}