SemanticsData constructor Null safety
- {required int flags,
- required int actions,
- 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,
- Set<
SemanticsTag> ? tags, - Matrix4? transform,
- List<
int> ? customSemanticsActionIds}
Creates a semantics data object.
The flags, actions, label, and Rect arguments must not be null.
If label is not empty, then textDirection must also not be null.
Implementation
SemanticsData({
required this.flags,
required this.actions,
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,
this.tags,
this.transform,
this.customSemanticsActionIds,
}) : assert(flags != null),
assert(actions != null),
assert(attributedLabel != null),
assert(attributedValue != null),
assert(attributedDecreasedValue != null),
assert(attributedIncreasedValue != null),
assert(attributedHint != null),
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(rect != null);