copyWith method Null safety

SuggestionState<Mention> copyWith(
  1. {List<HashTag>? hashtags,
  2. List<Mention>? mentions,
  3. String? last,
  4. double? suggestionHeight,
  5. bool? loading}
)

Implementation

SuggestionState<Mention> copyWith(
    {final List<HashTag>? hashtags,
    final List<Mention>? mentions,
    final String? last,
    final double? suggestionHeight,
    final bool? loading}) {
  return SuggestionState(
      hashtags: hashtags ?? this.hashtags,
      mentions: mentions ?? this.mentions,
      last: last ?? this.last,
      suggestionHeight: suggestionHeight ?? this.suggestionHeight,
      loading: loading ?? this.loading);
}