HeroText constructor
const
HeroText(
- String? text, {
- required Object? tag,
- required ViewState viewState,
- Key? key,
- double smallFontSize = 15.0,
- double largeFontSize = 48.0,
- TextStyle? style,
- TextAlign textAlign = TextAlign.center,
- TextDirection? textDirection,
- double? textScaleFactor,
- int maxLines = 1,
- Locale? locale,
- 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.',
);