1
0
mirror of https://github.com/flutter/samples.git synced 2026-06-02 12:29:50 +00:00

veggieseasons: Migrate to null safety (#922)

This commit is contained in:
Brett Morgan
2021-10-12 10:27:54 +11:00
committed by GitHub
parent 994cdb4afa
commit ac2bef7d83
21 changed files with 134 additions and 148 deletions

View File

@@ -8,17 +8,17 @@ import 'package:veggieseasons/screens/details.dart';
import 'package:veggieseasons/styles.dart';
class ZoomClipAssetImage extends StatelessWidget {
const ZoomClipAssetImage(
{@required this.zoom,
this.height,
this.width,
@required this.imageAsset,
Key key})
: super(key: key);
const ZoomClipAssetImage({
required this.zoom,
this.height,
this.width,
required this.imageAsset,
Key? key,
}) : super(key: key);
final double zoom;
final double height;
final double width;
final double? height;
final double? width;
final String imageAsset;
@override
@@ -30,8 +30,8 @@ class ZoomClipAssetImage extends StatelessWidget {
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: OverflowBox(
maxHeight: height * zoom,
maxWidth: width * zoom,
maxHeight: height! * zoom,
maxWidth: width! * zoom,
child: Image.asset(
imageAsset,
fit: BoxFit.fill,
@@ -45,7 +45,7 @@ class ZoomClipAssetImage extends StatelessWidget {
class VeggieHeadline extends StatelessWidget {
final Veggie veggie;
const VeggieHeadline(this.veggie, {Key key}) : super(key: key);
const VeggieHeadline(this.veggie, {Key? key}) : super(key: key);
List<Widget> _buildSeasonDots(List<Season> seasons) {
var widgets = <Widget>[];