Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 70cecf6

Browse files
authored
Remove unnecessary null checks in dev/*_tests (#118844)
1 parent 25843bd commit 70cecf6

File tree

6 files changed

+6
-11
lines changed

6 files changed

+6
-11
lines changed

dev/integration_tests/android_semantics_testing/test_driver/main_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const List<AndroidSemanticsAction> ignoredAccessibilityFocusActions = <AndroidSe
2020
];
2121

2222
String adbPath() {
23-
final String androidHome = io.Platform.environment['ANDROID_HOME'] ?? io.Platform.environment['ANDROID_SDK_ROOT']!;
23+
final String? androidHome = io.Platform.environment['ANDROID_HOME'] ?? io.Platform.environment['ANDROID_SDK_ROOT'];
2424
if (androidHome == null) {
2525
return 'adb';
2626
} else {

dev/integration_tests/hybrid_android_views/lib/android_platform_view.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AndroidPlatformView extends StatelessWidget {
1919
this.onPlatformViewCreated,
2020
this.useHybridComposition = false,
2121
required this.viewType,
22-
}) : assert(viewType != null);
22+
});
2323

2424
/// The unique identifier for the view type to be embedded by this widget.
2525
///

dev/integration_tests/web_e2e_tests/test_driver/url_strategy_integration.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class TestUrlStrategy extends UrlStrategy {
9999
@override
100100
void replaceState(dynamic state, String title, String url) {
101101
assert(withinAppHistory);
102-
if (url == null || url == '') {
102+
if (url == '') {
103103
url = currentEntry.url;
104104
}
105105
currentEntry = TestHistoryEntry(state, title, url);

dev/manual_tests/lib/actions.dart

+1-4
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ class Memento extends Object with Diagnosticable {
4848
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
4949
super.debugFillProperties(properties);
5050
properties.add(StringProperty('name', name));
51-
properties.add(FlagProperty('undo', value: undo != null, ifTrue: 'undo'));
52-
properties.add(FlagProperty('redo', value: redo != null, ifTrue: 'redo'));
5351
}
5452
}
5553

@@ -63,8 +61,7 @@ class UndoableActionDispatcher extends ActionDispatcher implements Listenable {
6361
/// The [maxUndoLevels] argument must not be null.
6462
UndoableActionDispatcher({
6563
int maxUndoLevels = _defaultMaxUndoLevels,
66-
}) : assert(maxUndoLevels != null),
67-
_maxUndoLevels = maxUndoLevels;
64+
}) : _maxUndoLevels = maxUndoLevels;
6865

6966
// A stack of actions that have been performed. The most recent action
7067
// performed is at the end of the list.

dev/manual_tests/lib/density.dart

+1-3
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,7 @@ class _OptionsState extends State<Options> {
365365
}
366366

367367
class _ControlTile extends StatelessWidget {
368-
const _ControlTile({required this.label, required this.child})
369-
: assert(label != null),
370-
assert(child != null);
368+
const _ControlTile({required this.label, required this.child});
371369

372370
final String label;
373371
final Widget child;

dev/manual_tests/lib/raw_keyboard.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
4343
return KeyEventResult.ignored;
4444
}
4545

46-
String _asHex(int value) => value != null ? '0x${value.toRadixString(16)}' : 'null';
46+
String _asHex(int value) => '0x${value.toRadixString(16)}';
4747

4848
String _getEnumName(dynamic enumItem) {
4949
final String name = '$enumItem';

0 commit comments

Comments
 (0)