HeroText constructor

const HeroText(
  1. String? text, {
  2. required Object? tag,
  3. required ViewState viewState,
  4. Key? key,
  5. double smallFontSize = 15.0,
  6. double largeFontSize = 48.0,
  7. TextStyle? style,
  8. TextAlign textAlign = TextAlign.center,
  9. TextDirection? textDirection,
  10. double? textScaleFactor,
  11. int maxLines = 1,
  12. Locale? locale,
  13. StrutStyle? strutStyle,
})

Creates a HeroText widget with hero animation.

tag must be unique and consistent across transitions. viewState must be ViewState.shrunk or ViewState.enlarged in static state.

Implementation

const HeroText(
  this.text, {
  required this.tag,
  required this.viewState,
  super.key,
  this.smallFontSize = 15.0,
  this.largeFontSize = 48.0,
  this.style,
  this.textAlign = TextAlign.center,
  this.textDirection,
  this.textScaleFactor,
  this.maxLines = 1,
  this.locale,
  this.strutStyle,
}) : assert(
        viewState == ViewState.shrunk || viewState == ViewState.enlarged,
        'viewState must be either ViewState.shrunk or ViewState.enlarged for static HeroText.',
      );