Unverified Commit 6586a069 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

enable prefer_null_aware_operators (#77105)

parent 8818840a
...@@ -175,7 +175,7 @@ linter: ...@@ -175,7 +175,7 @@ linter:
- prefer_is_not_operator - prefer_is_not_operator
- prefer_iterable_whereType - prefer_iterable_whereType
# - prefer_mixin # https://github.com/dart-lang/language/issues/32 # - prefer_mixin # https://github.com/dart-lang/language/issues/32
# - prefer_null_aware_operators # disable until NNBD, see https://github.com/flutter/flutter/pull/32711#issuecomment-492930932 - prefer_null_aware_operators
# - prefer_relative_imports # not yet tested # - prefer_relative_imports # not yet tested
- prefer_single_quotes - prefer_single_quotes
- prefer_spread_collections - prefer_spread_collections
......
...@@ -267,7 +267,7 @@ class GestureArenaManager { ...@@ -267,7 +267,7 @@ class GestureArenaManager {
bool _debugLogDiagnostic(int pointer, String message, [ _GestureArena? state ]) { bool _debugLogDiagnostic(int pointer, String message, [ _GestureArena? state ]) {
assert(() { assert(() {
if (debugPrintGestureArenaDiagnostics) { if (debugPrintGestureArenaDiagnostics) {
final int? count = state != null ? state.members.length : null; final int? count = state?.members.length;
final String s = count != 1 ? 's' : ''; final String s = count != 1 ? 's' : '';
debugPrint('Gesture arena ${pointer.toString().padRight(4)}$message${ count != null ? " with $count member$s." : ""}'); debugPrint('Gesture arena ${pointer.toString().padRight(4)}$message${ count != null ? " with $count member$s." : ""}');
} }
......
...@@ -65,7 +65,7 @@ Widget buildFormFrame({ ...@@ -65,7 +65,7 @@ Widget buildFormFrame({
iconEnabledColor: iconEnabledColor, iconEnabledColor: iconEnabledColor,
isDense: isDense, isDense: isDense,
isExpanded: isExpanded, isExpanded: isExpanded,
items: items == null ? null : items.map<DropdownMenuItem<String>>((String item) { items: items?.map<DropdownMenuItem<String>>((String item) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
key: ValueKey<String>(item), key: ValueKey<String>(item),
value: item, value: item,
......
...@@ -54,9 +54,7 @@ Widget buildDropdown({ ...@@ -54,9 +54,7 @@ Widget buildDropdown({
Color? focusColor, Color? focusColor,
Color? dropdownColor, Color? dropdownColor,
}) { }) {
final List<DropdownMenuItem<String>>? listItems = items == null final List<DropdownMenuItem<String>>? listItems = items?.map<DropdownMenuItem<String>>((String item) {
? null
: items.map<DropdownMenuItem<String>>((String item) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
key: ValueKey<String>(item), key: ValueKey<String>(item),
value: item, value: item,
......
...@@ -692,7 +692,7 @@ class _IOSSimulatorLogReader extends DeviceLogReader { ...@@ -692,7 +692,7 @@ class _IOSSimulatorLogReader extends DeviceLogReader {
onListen: _start, onListen: _start,
onCancel: _stop, onCancel: _stop,
); );
_appName = app == null ? null : app.name.replaceAll('.app', ''); _appName = app?.name?.replaceAll('.app', '');
} }
final IOSSimulator device; final IOSSimulator device;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment