From 10febea8777fca41779802086a431313827a2104 Mon Sep 17 00:00:00 2001 From: Alexandre Ardhuin Date: Wed, 23 Sep 2020 07:22:10 +0200 Subject: [PATCH] fix nullability issues (#66418) --- packages/flutter/lib/src/cupertino/button.dart | 2 +- .../flutter/lib/src/widgets/list_wheel_scroll_view.dart | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/flutter/lib/src/cupertino/button.dart b/packages/flutter/lib/src/cupertino/button.dart index 0c497f63dd..91901ca481 100644 --- a/packages/flutter/lib/src/cupertino/button.dart +++ b/packages/flutter/lib/src/cupertino/button.dart @@ -211,7 +211,7 @@ class _CupertinoButtonState extends State with SingleTickerProv Widget build(BuildContext context) { final bool enabled = widget.enabled; final CupertinoThemeData themeData = CupertinoTheme.of(context); - final Color? primaryColor = themeData.primaryColor; + final Color primaryColor = themeData.primaryColor; final Color? backgroundColor = widget.color == null ? (widget._filled ? primaryColor : null) : CupertinoDynamicColor.resolve(widget.color, context); diff --git a/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart b/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart index e8f8da51e0..3c5db11453 100644 --- a/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart @@ -181,11 +181,7 @@ class ListWheelChildBuilderDelegate extends ListWheelChildDelegate { @override Widget? build(BuildContext context, int index) { if (childCount == null) { - 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 + final Widget? child = builder(context, index); return child == null ? null : IndexedSemantics(child: child, index: index); } if (index < 0 || index >= childCount!)