null safety

This commit is contained in:
phyothandar
2021-09-10 14:25:37 +06:30
parent 5a313d641e
commit 079c9a135d
31 changed files with 230 additions and 227 deletions

View File

@@ -8,10 +8,10 @@ import 'show_img.dart';
typedef OnFile = void Function(File);
class ImageUrl extends StatefulWidget {
final String title;
final String url;
final String? title;
final String? url;
const ImageUrl({Key key, this.title, this.url}) : super(key: key);
const ImageUrl({Key? key, this.title, this.url}) : super(key: key);
@override
_ImageUrlState createState() => _ImageUrlState();
}
@@ -25,12 +25,12 @@ class _ImageUrlState extends State<ImageUrl> {
context,
MaterialPageRoute(
builder: (context) =>
ShowImage(url: widget.url, fileName: widget.title)),
ShowImage(url: widget.url!, fileName: widget.title!)),
)
},
child: Chip(
avatar: Icon(Icons.image),
label: Text(widget.title),
label: Text(widget.title!),
),
);
}