Skip to content

proposal: no_nullable_values_in_interpolated_strings #58615

@pq

Description

@pq

no_nullable_values_in_interpolated_strings

Description

Do not use nullable values in interpolated strings.

Details

TODO:

See: dart-lang/language#2053.

Kind

Error

Good Examples

void main() {
  String test = 'hi';
  String anotherTest = '$test';
  print(anotherTest);
}
main() {
  String? str = 'there';
  print('hi $str');
}
String? lastUpdatedTime;

Text('the last updated time is ${lastUpdatedTime!}');

Bad Examples

void main() {
  String? test;
  String anotherTest = '$test';
  print(anotherTest); 
}
String? lastUpdatedTime;

Text('the last updated time is $lastUpdatedTime');

Discussion

See: dart-lang/language#2053

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagelinter-lint-proposallinter-status-pendingtype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions