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:
- prefer_is_not_operator
- prefer_iterable_whereType
# - 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_single_quotes
- prefer_spread_collections
......
......@@ -267,7 +267,7 @@ class GestureArenaManager {
bool _debugLogDiagnostic(int pointer, String message, [ _GestureArena? state ]) {
assert(() {
if (debugPrintGestureArenaDiagnostics) {
final int? count = state != null ? state.members.length : null;
final int? count = state?.members.length;
final String s = count != 1 ? 's' : '';
debugPrint('Gesture arena ${pointer.toString().padRight(4)}$message${ count != null ? " with $count member$s." : ""}');
}
......
......@@ -65,7 +65,7 @@ Widget buildFormFrame({
iconEnabledColor: iconEnabledColor,
isDense: isDense,
isExpanded: isExpanded,
items: items == null ? null : items.map<DropdownMenuItem<String>>((String item) {
items: items?.map<DropdownMenuItem<String>>((String item) {
return DropdownMenuItem<String>(
key: ValueKey<String>(item),
value: item,
......
......@@ -54,9 +54,7 @@ Widget buildDropdown({
Color? focusColor,
Color? dropdownColor,
}) {
final List<DropdownMenuItem<String>>? listItems = items == null
? null
: items.map<DropdownMenuItem<String>>((String item) {
final List<DropdownMenuItem<String>>? listItems = items?.map<DropdownMenuItem<String>>((String item) {
return DropdownMenuItem<String>(
key: ValueKey<String>(item),
value: item,
......
......@@ -692,7 +692,7 @@ class _IOSSimulatorLogReader extends DeviceLogReader {
onListen: _start,
onCancel: _stop,
);
_appName = app == null ? null : app.name.replaceAll('.app', '');
_appName = app?.name?.replaceAll('.app', '');
}
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