mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Remove unnecessary null checks in dev/*_tests (#118844)
This commit is contained in:
parent
25843bdb5a
commit
70cecf6c9e
@ -20,7 +20,7 @@ const List<AndroidSemanticsAction> ignoredAccessibilityFocusActions = <AndroidSe
|
|||||||
];
|
];
|
||||||
|
|
||||||
String adbPath() {
|
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) {
|
if (androidHome == null) {
|
||||||
return 'adb';
|
return 'adb';
|
||||||
} else {
|
} else {
|
||||||
|
@ -19,7 +19,7 @@ class AndroidPlatformView extends StatelessWidget {
|
|||||||
this.onPlatformViewCreated,
|
this.onPlatformViewCreated,
|
||||||
this.useHybridComposition = false,
|
this.useHybridComposition = false,
|
||||||
required this.viewType,
|
required this.viewType,
|
||||||
}) : assert(viewType != null);
|
});
|
||||||
|
|
||||||
/// The unique identifier for the view type to be embedded by this widget.
|
/// The unique identifier for the view type to be embedded by this widget.
|
||||||
///
|
///
|
||||||
|
@ -99,7 +99,7 @@ class TestUrlStrategy extends UrlStrategy {
|
|||||||
@override
|
@override
|
||||||
void replaceState(dynamic state, String title, String url) {
|
void replaceState(dynamic state, String title, String url) {
|
||||||
assert(withinAppHistory);
|
assert(withinAppHistory);
|
||||||
if (url == null || url == '') {
|
if (url == '') {
|
||||||
url = currentEntry.url;
|
url = currentEntry.url;
|
||||||
}
|
}
|
||||||
currentEntry = TestHistoryEntry(state, title, url);
|
currentEntry = TestHistoryEntry(state, title, url);
|
||||||
|
@ -48,8 +48,6 @@ class Memento extends Object with Diagnosticable {
|
|||||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||||
super.debugFillProperties(properties);
|
super.debugFillProperties(properties);
|
||||||
properties.add(StringProperty('name', name));
|
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.
|
/// The [maxUndoLevels] argument must not be null.
|
||||||
UndoableActionDispatcher({
|
UndoableActionDispatcher({
|
||||||
int maxUndoLevels = _defaultMaxUndoLevels,
|
int maxUndoLevels = _defaultMaxUndoLevels,
|
||||||
}) : assert(maxUndoLevels != null),
|
}) : _maxUndoLevels = maxUndoLevels;
|
||||||
_maxUndoLevels = maxUndoLevels;
|
|
||||||
|
|
||||||
// A stack of actions that have been performed. The most recent action
|
// A stack of actions that have been performed. The most recent action
|
||||||
// performed is at the end of the list.
|
// performed is at the end of the list.
|
||||||
|
@ -365,9 +365,7 @@ class _OptionsState extends State<Options> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ControlTile extends StatelessWidget {
|
class _ControlTile extends StatelessWidget {
|
||||||
const _ControlTile({required this.label, required this.child})
|
const _ControlTile({required this.label, required this.child});
|
||||||
: assert(label != null),
|
|
||||||
assert(child != null);
|
|
||||||
|
|
||||||
final String label;
|
final String label;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
@ -43,7 +43,7 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
|
|||||||
return KeyEventResult.ignored;
|
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) {
|
String _getEnumName(dynamic enumItem) {
|
||||||
final String name = '$enumItem';
|
final String name = '$enumItem';
|
||||||
|
Loading…
Reference in New Issue
Block a user