1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-10 14:58:34 +00:00

filipino_cuisine: migrate to null safety (#920)

This commit is contained in:
Brett Morgan
2021-10-08 12:10:23 +11:00
committed by GitHub
parent 3905b45fba
commit d14e79b833
7 changed files with 511 additions and 530 deletions

View File

@@ -123,12 +123,12 @@ class ScalePainter extends BasePainter {
: radius + ((index + 1) * (size + space));
double progress = page - index;
_paint.color = Color.lerp(widget.activeColor, widget.color, progress);
_paint.color = Color.lerp(widget.activeColor, widget.color, progress)!;
//last
canvas.drawCircle(Offset(radius + (index * (size + space)), radius),
lerp(radius, radius * widget.scale, progress), _paint);
//first
_paint.color = Color.lerp(widget.color, widget.activeColor, progress);
_paint.color = Color.lerp(widget.color, widget.activeColor, progress)!;
canvas.drawCircle(Offset(secondOffset, radius),
lerp(radius * widget.scale, radius, progress), _paint);
}
@@ -154,12 +154,12 @@ class ColorPainter extends BasePainter {
? radius
: radius + ((index + 1) * (size + space));
_paint.color = Color.lerp(widget.activeColor, widget.color, progress);
_paint.color = Color.lerp(widget.activeColor, widget.color, progress)!;
//left
canvas.drawCircle(
Offset(radius + (index * (size + space)), radius), radius, _paint);
//right
_paint.color = Color.lerp(widget.color, widget.activeColor, progress);
_paint.color = Color.lerp(widget.color, widget.activeColor, progress)!;
canvas.drawCircle(Offset(secondOffset, radius), radius, _paint);
}
}
@@ -311,7 +311,7 @@ class PageIndicator extends StatefulWidget {
final Color color;
/// layout of the dots,default is [PageIndicatorLayout.SLIDE]
final PageIndicatorLayout layout;
final PageIndicatorLayout? layout;
// Only valid when layout==PageIndicatorLayout.scale
final double scale;
@@ -324,20 +324,18 @@ class PageIndicator extends StatefulWidget {
final double activeSize;
const PageIndicator(
{Key key,
{Key? key,
this.size = 20.0,
this.space = 5.0,
@required this.count,
required this.count,
this.activeSize = 20.0,
@required this.controller,
required this.controller,
this.color = Colors.white30,
this.layout = PageIndicatorLayout.SLIDE,
this.activeColor = Colors.white,
this.scale = 0.6,
this.dropHeight = 20.0})
: assert(count != null),
assert(controller != null),
super(key: key);
: super(key: key);
@override
State<StatefulWidget> createState() {