fix: revert null-aware map entries; disable use_null_aware_elements lint
The ? operator on map entries applies to the key, not the value. String literal keys can never be null, so ?'key': value was flagged as invalid_null_aware_operator. Reverted to if (x != null) 'key': x form and disabled the lint project-wide since it doesn't apply here.
This commit is contained in:
@@ -23,6 +23,9 @@ linter:
|
||||
rules:
|
||||
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
||||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
||||
# ?'key': value applies ? to the key (never null for string literals);
|
||||
# the if (x != null) form is correct for nullable-value map entries.
|
||||
use_null_aware_elements: false
|
||||
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
|
||||
Reference in New Issue
Block a user