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

This commit is contained in:
Michael Goderbauer
2023-01-20 17:36:12 -08:00
committed by GitHub
parent 25843bdb5a
commit 70cecf6c9e
6 changed files with 6 additions and 11 deletions

View File

@@ -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.

View File

@@ -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;

View File

@@ -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';