SemanticsData constructor
- required int flags,
- required int actions,
- required String identifier,
- required AttributedString attributedLabel,
- required AttributedString attributedValue,
- required AttributedString attributedIncreasedValue,
- required AttributedString attributedDecreasedValue,
- required AttributedString attributedHint,
- required String tooltip,
- required TextDirection? textDirection,
- required Rect rect,
- required double elevation,
- required double thickness,
- required TextSelection? textSelection,
- required int? scrollIndex,
- required int? scrollChildCount,
- required double? scrollPosition,
- required double? scrollExtentMax,
- required double? scrollExtentMin,
- required int? platformViewId,
- required int? maxValueLength,
- required int? currentValueLength,
- required int headingLevel,
- required Uri? linkUrl,
- Set<
SemanticsTag> ? tags, - Matrix4? transform,
- 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,
required this.linkUrl,
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'),
assert(linkUrl == null || (flags & SemanticsFlag.isLink.index) != 0, 'A SemanticsData object with a linkUrl must have the isLink flag set to true');