Unverified Commit 70cecf6c authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Remove unnecessary null checks in dev/*_tests (#118844)

parent 25843bdb
......@@ -20,7 +20,7 @@ const List<AndroidSemanticsAction> ignoredAccessibilityFocusActions = <AndroidSe
];
String adbPath() {
final String androidHome = io.Platform.environment['ANDROID_HOME'] ?? io.Platform.environment['ANDROID_SDK_ROOT']!;
final String? androidHome = io.Platform.environment['ANDROID_HOME'] ?? io.Platform.environment['ANDROID_SDK_ROOT'];
if (androidHome == null) {
return 'adb';
} else {
......
......@@ -19,7 +19,7 @@ class AndroidPlatformView extends StatelessWidget {
this.onPlatformViewCreated,
this.useHybridComposition = false,
required this.viewType,
}) : assert(viewType != null);
});
/// The unique identifier for the view type to be embedded by this widget.
///
......
......@@ -99,7 +99,7 @@ class TestUrlStrategy extends UrlStrategy {
@override
void replaceState(dynamic state, String title, String url) {
assert(withinAppHistory);
if (url == null || url == '') {
if (url == '') {
url = currentEntry.url;
}
currentEntry = TestHistoryEntry(state, title, url);
......
......@@ -48,8 +48,6 @@ class Memento extends Object with Diagnosticable {
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(StringProperty('name', name));
properties.add(FlagProperty('undo', value: undo != null, ifTrue: 'undo'));
properties.add(FlagProperty('redo', value: redo != null, ifTrue: 'redo'));
}
}
......@@ -63,8 +61,7 @@ class UndoableActionDispatcher extends ActionDispatcher implements Listenable {
/// The [maxUndoLevels] argument must not be null.
UndoableActionDispatcher({
int maxUndoLevels = _defaultMaxUndoLevels,
}) : assert(maxUndoLevels != null),
_maxUndoLevels = maxUndoLevels;
}) : _maxUndoLevels = maxUndoLevels;
// A stack of actions that have been performed. The most recent action
// performed is at the end of the list.
......
......@@ -365,9 +365,7 @@ class _OptionsState extends State<Options> {
}
class _ControlTile extends StatelessWidget {
const _ControlTile({required this.label, required this.child})
: assert(label != null),
assert(child != null);
const _ControlTile({required this.label, required this.child});
final String label;
final Widget child;
......
......@@ -43,7 +43,7 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
return KeyEventResult.ignored;
}
String _asHex(int value) => value != null ? '0x${value.toRadixString(16)}' : 'null';
String _asHex(int value) => '0x${value.toRadixString(16)}';
String _getEnumName(dynamic enumItem) {
final String name = '$enumItem';
......
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