SemanticsData constructor

SemanticsData({
  1. required int flags,
  2. required int actions,
  3. required String identifier,
  4. required AttributedString attributedLabel,
  5. required AttributedString attributedValue,
  6. required AttributedString attributedIncreasedValue,
  7. required AttributedString attributedDecreasedValue,
  8. required AttributedString attributedHint,
  9. required String tooltip,
  10. required TextDirection? textDirection,
  11. required Rect rect,
  12. required double elevation,
  13. required double thickness,
  14. required TextSelection? textSelection,
  15. required int? scrollIndex,
  16. required int? scrollChildCount,
  17. required double? scrollPosition,
  18. required double? scrollExtentMax,
  19. required double? scrollExtentMin,
  20. required int? platformViewId,
  21. required int? maxValueLength,
  22. required int? currentValueLength,
  23. required int headingLevel,
  24. Set<SemanticsTag>? tags,
  25. Matrix4? transform,
  26. List<int>? customSemanticsActionIds,
})

Creates a semantics data object.

If label is not empty, then textDirection must also not be null.

Implementation

SemanticsData({
  required this.flags,
  required this.actions,
  required this.identifier,
  required this.attributedLabel,
  required this.attributedValue,
  required this.attributedIncreasedValue,
  required this.attributedDecreasedValue,
  required this.attributedHint,
  required this.tooltip,
  required this.textDirection,
  required this.rect,
  required this.elevation,
  required this.thickness,
  required this.textSelection,
  required this.scrollIndex,
  required this.scrollChildCount,
  required this.scrollPosition,
  required this.scrollExtentMax,
  required this.scrollExtentMin,
  required this.platformViewId,
  required this.maxValueLength,
  required this.currentValueLength,
  required this.headingLevel,
  this.tags,
  this.transform,
  this.customSemanticsActionIds,
}) : assert(tooltip == '' || textDirection != null, 'A SemanticsData object with tooltip "$tooltip" had a null textDirection.'),
     assert(attributedLabel.string == '' || textDirection != null, 'A SemanticsData object with label "${attributedLabel.string}" had a null textDirection.'),
     assert(attributedValue.string == '' || textDirection != null, 'A SemanticsData object with value "${attributedValue.string}" had a null textDirection.'),
     assert(attributedDecreasedValue.string == '' || textDirection != null, 'A SemanticsData object with decreasedValue "${attributedDecreasedValue.string}" had a null textDirection.'),
     assert(attributedIncreasedValue.string == '' || textDirection != null, 'A SemanticsData object with increasedValue "${attributedIncreasedValue.string}" had a null textDirection.'),
     assert(attributedHint.string == '' || textDirection != null, 'A SemanticsData object with hint "${attributedHint.string}" had a null textDirection.'),
     assert(headingLevel >= 0 && headingLevel <= 6, 'Heading level must be between 0 and 6');