AutoSizeStyledText constructor
AutoSizeStyledText({
- Key? key,
- required String text,
- required double minFontSize,
- bool newLineAsBreaks = true,
- TextStyle? style,
- @Deprecated('Use tags property instead of styles') Map<
String, TextStyle> ? styles, - Map<
String, AutoSizeStyledTextTagBase> ? tags, - TextAlign textAlign = TextAlign.start,
- TextDirection? textDirection,
- bool softWrap = true,
- TextOverflow overflow = TextOverflow.clip,
- double textScaleFactor = 1.0,
- int? maxLines,
- Locale? locale,
- StrutStyle? strutStyle,
- double maxFontSize = double.infinity,
- double stepGranularity = 1,
- List<
double> ? presetFontSizes, - Widget? overflowReplacement,
- bool wrapWords = true,
- String? semanticsLabel,
- AutoSizeGroup? group,
Create a text widget with formatting via tags.
Implementation
AutoSizeStyledText({
Key? key,
required this.text,
required this.minFontSize,
this.newLineAsBreaks = true,
this.style,
@Deprecated('Use tags property instead of styles')
Map<String, TextStyle>? styles,
Map<String, AutoSizeStyledTextTagBase>? tags,
this.textAlign = TextAlign.start,
this.textDirection,
this.softWrap = true,
this.overflow = TextOverflow.clip,
this.textScaleFactor = 1.0,
this.maxLines,
this.locale,
this.strutStyle,
this.maxFontSize = double.infinity,
this.stepGranularity = 1,
this.presetFontSizes,
this.overflowReplacement,
this.wrapWords = true,
this.semanticsLabel,
this.group,
}) : assert(
styles != null || tags != null,
'Styles and tags cannot be used at the same time. Use styles for compatibility only. They will be removed in future versions.',
),
this.styles = // ignore: deprecated_member_use_from_same_package
styles ?? const {},
this.tags = tags ?? const {},
super(key: key);