Unverified Commit 10febea8 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

fix nullability issues (#66418)

parent 45fa60eb
...@@ -211,7 +211,7 @@ class _CupertinoButtonState extends State<CupertinoButton> with SingleTickerProv ...@@ -211,7 +211,7 @@ class _CupertinoButtonState extends State<CupertinoButton> with SingleTickerProv
Widget build(BuildContext context) { Widget build(BuildContext context) {
final bool enabled = widget.enabled; final bool enabled = widget.enabled;
final CupertinoThemeData themeData = CupertinoTheme.of(context); final CupertinoThemeData themeData = CupertinoTheme.of(context);
final Color? primaryColor = themeData.primaryColor; final Color primaryColor = themeData.primaryColor;
final Color? backgroundColor = widget.color == null final Color? backgroundColor = widget.color == null
? (widget._filled ? primaryColor : null) ? (widget._filled ? primaryColor : null)
: CupertinoDynamicColor.resolve(widget.color, context); : CupertinoDynamicColor.resolve(widget.color, context);
......
...@@ -181,11 +181,7 @@ class ListWheelChildBuilderDelegate extends ListWheelChildDelegate { ...@@ -181,11 +181,7 @@ class ListWheelChildBuilderDelegate extends ListWheelChildDelegate {
@override @override
Widget? build(BuildContext context, int index) { Widget? build(BuildContext context, int index) {
if (childCount == null) { if (childCount == null) {
final Widget child = builder(context, index); final Widget? child = builder(context, index);
// `child` has a non-nullable return type, but might be null when
// running with weak checking, so we need to null check it anyway (and
// ignore the warning that the null-handling logic is dead code).
// ignore: dead_code
return child == null ? null : IndexedSemantics(child: child, index: index); return child == null ? null : IndexedSemantics(child: child, index: index);
} }
if (index < 0 || index >= childCount!) if (index < 0 || index >= childCount!)
......
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