copy method

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

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.


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