AutoSizeStyledText constructor

AutoSizeStyledText({
  1. Key? key,
  2. required String text,
  3. required double minFontSize,
  4. bool newLineAsBreaks = true,
  5. TextStyle? style,
  6. @Deprecated('Use tags property instead of styles') Map<String, TextStyle>? styles,
  7. Map<String, AutoSizeStyledTextTagBase>? tags,
  8. TextAlign textAlign = TextAlign.start,
  9. TextDirection? textDirection,
  10. bool softWrap = true,
  11. TextOverflow overflow = TextOverflow.clip,
  12. double textScaleFactor = 1.0,
  13. int? maxLines,
  14. Locale? locale,
  15. StrutStyle? strutStyle,
  16. double maxFontSize = double.infinity,
  17. double stepGranularity = 1,
  18. List<double>? presetFontSizes,
  19. Widget? overflowReplacement,
  20. bool wrapWords = true,
  21. String? semanticsLabel,
  22. 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);