copy method Null safety

  1. @override
StringAttribute copy(
  1. {required TextRange range}
)
override

Creates a new attribute with all properties copied except for range, which is updated to the specified value.

For example, the LocaleStringAttribute specifies a Locale for its range of characters. Copying it will result in a new LocaleStringAttribute that has the same locale but an updated TextRange.

Implementation

@override
StringAttribute copy({required TextRange range}) {
  return LocaleStringAttribute(range: range, locale: locale);
}