fix nullability issues (#66418)

This commit is contained in:
Alexandre Ardhuin
2020-09-23 07:22:10 +02:00
committed by GitHub
parent 45fa60eb3e
commit 10febea877
2 changed files with 2 additions and 6 deletions

View File

@@ -211,7 +211,7 @@ class _CupertinoButtonState extends State<CupertinoButton> 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);

View File

@@ -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!)