fix nullability issues (#66418)
This commit is contained in:
committed by
GitHub
parent
45fa60eb3e
commit
10febea877
@@ -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);
|
||||
|
||||
@@ -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!)
|
||||
|
||||
Reference in New Issue
Block a user