fix nullability issues (#67443)
This commit is contained in:
committed by
GitHub
parent
896c19a292
commit
f1c1d944e3
@@ -1660,9 +1660,7 @@ abstract class DiagnosticsNode {
|
||||
result = toStringDeep(
|
||||
parentConfiguration: parentConfiguration, minLevel: minLevel);
|
||||
} else {
|
||||
String? description = toDescription(parentConfiguration: parentConfiguration);
|
||||
assert(description != null);
|
||||
description = description!;
|
||||
final String description = toDescription(parentConfiguration: parentConfiguration)!;
|
||||
|
||||
if (name == null || name!.isEmpty || !showName) {
|
||||
result = description;
|
||||
|
||||
@@ -1171,7 +1171,7 @@ class FilterChip extends StatelessWidget
|
||||
@override
|
||||
final bool selected;
|
||||
@override
|
||||
final ValueChanged<bool> onSelected;
|
||||
final ValueChanged<bool>? onSelected;
|
||||
@override
|
||||
final double? pressElevation;
|
||||
@override
|
||||
|
||||
@@ -459,13 +459,13 @@ class _ChangeAnimation extends Animation<double> with AnimationWithParentMixin<d
|
||||
|
||||
@override
|
||||
void removeStatusListener(AnimationStatusListener listener) {
|
||||
if (parent != null)
|
||||
if (controller.animation != null)
|
||||
super.removeStatusListener(listener);
|
||||
}
|
||||
|
||||
@override
|
||||
void removeListener(VoidCallback listener) {
|
||||
if (parent != null)
|
||||
if (controller.animation != null)
|
||||
super.removeListener(listener);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import 'theme.dart';
|
||||
export 'package:flutter/services.dart' show TextInputType, TextInputAction, TextCapitalization, SmartQuotesType, SmartDashesType;
|
||||
|
||||
/// Signature for the [TextField.buildCounter] callback.
|
||||
typedef InputCounterWidgetBuilder = Widget Function(
|
||||
typedef InputCounterWidgetBuilder = Widget? Function(
|
||||
/// The build context for the TextField.
|
||||
BuildContext context, {
|
||||
/// The length of the string currently in the input.
|
||||
@@ -880,7 +880,7 @@ class _TextFieldState extends State<TextField> with RestorationMixin implements
|
||||
&& effectiveDecoration.counterText == null
|
||||
&& widget.buildCounter != null) {
|
||||
final bool isFocused = _effectiveFocusNode.hasFocus;
|
||||
final Widget builtCounter = widget.buildCounter!(
|
||||
final Widget? builtCounter = widget.buildCounter!(
|
||||
context,
|
||||
currentLength: currentLength,
|
||||
maxLength: widget.maxLength,
|
||||
|
||||
@@ -345,7 +345,7 @@ class _TextFormFieldState extends FormFieldState<String> {
|
||||
void reset() {
|
||||
super.reset();
|
||||
setState(() {
|
||||
_effectiveController!.text = widget.initialValue!;
|
||||
_effectiveController!.text = widget.initialValue;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -910,7 +910,7 @@ class _Dial extends StatefulWidget {
|
||||
final _TimePickerMode mode;
|
||||
final bool use24HourDials;
|
||||
final ValueChanged<TimeOfDay>? onChanged;
|
||||
final VoidCallback onHourSelected;
|
||||
final VoidCallback? onHourSelected;
|
||||
|
||||
@override
|
||||
_DialState createState() => _DialState();
|
||||
@@ -1058,7 +1058,7 @@ class _DialState extends State<_Dial> with SingleTickerProviderStateMixin {
|
||||
_animateTo(_getThetaForTime(widget.selectedTime));
|
||||
if (widget.mode == _TimePickerMode.hour) {
|
||||
if (widget.onHourSelected != null) {
|
||||
widget.onHourSelected();
|
||||
widget.onHourSelected!();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1076,7 +1076,7 @@ class _DialState extends State<_Dial> with SingleTickerProviderStateMixin {
|
||||
_announceToAccessibility(context, localizations.formatDecimal(newTime.hourOfPeriod));
|
||||
}
|
||||
if (widget.onHourSelected != null) {
|
||||
widget.onHourSelected();
|
||||
widget.onHourSelected!();
|
||||
}
|
||||
} else {
|
||||
_announceToAccessibility(context, localizations.formatDecimal(newTime.minute));
|
||||
|
||||
Reference in New Issue
Block a user