Unverified Commit f1c1d944 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

fix nullability issues (#67443)

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