copyWith method Null safety

Token copyWith(
  1. {TokenType? tokenType,
  2. String? data}
)

Implementation

Token copyWith({
  TokenType? tokenType,
  String? data,
}) {
  return Token(
    tokenType: tokenType ?? this.tokenType,
    data: data ?? this.data,
  );
}