@@ -10,7 +10,7 @@ import 'package:minimal/routes.dart';
1010class ImageWrapper extends StatelessWidget {
1111 final String image;
1212
13- const ImageWrapper ({Key key, this .image}) : super (key: key);
13+ const ImageWrapper ({Key ? key, required this .image}) : super (key: key);
1414
1515 @override
1616 Widget build (BuildContext context) {
@@ -31,7 +31,7 @@ class ImageWrapper extends StatelessWidget {
3131class TagWrapper extends StatelessWidget {
3232 final List <Tag > tags;
3333
34- const TagWrapper ({Key key, this .tags}) : super (key: key);
34+ const TagWrapper ({Key ? key, this .tags = const [] }) : super (key: key);
3535
3636 @override
3737 Widget build (BuildContext context) {
@@ -48,7 +48,7 @@ class TagWrapper extends StatelessWidget {
4848class Tag extends StatelessWidget {
4949 final String tag;
5050
51- const Tag ({Key key, this .tag}) : super (key: key);
51+ const Tag ({Key ? key, required this .tag}) : super (key: key);
5252
5353 @override
5454 Widget build (BuildContext context) {
@@ -72,7 +72,7 @@ class Tag extends StatelessWidget {
7272class ReadMoreButton extends StatelessWidget {
7373 final Function onPressed;
7474
75- const ReadMoreButton ({Key key, @ required this .onPressed}) : super (key: key);
75+ const ReadMoreButton ({Key ? key, required this .onPressed}) : super (key: key);
7676
7777 @override
7878 Widget build (BuildContext context) {
@@ -83,7 +83,7 @@ class ReadMoreButton extends StatelessWidget {
8383 onHover: (event) => setState (() => hover = true ),
8484 onExit: (event) => setState (() => hover = false ),
8585 child: OutlineButton (
86- onPressed: onPressed,
86+ onPressed: onPressed as void Function () ? ,
8787 highlightedBorderColor: textPrimary,
8888 hoverColor: textPrimary,
8989 borderSide: BorderSide (color: textPrimary, width: 2 ),
@@ -116,7 +116,8 @@ Widget dividerSmall = Container(
116116 ),
117117);
118118
119- List <Widget > authorSection ({String imageUrl, String name, String bio}) {
119+ List <Widget > authorSection (
120+ {required String imageUrl, String ? name, String ? bio}) {
120121 return [
121122 divider,
122123 Container (
@@ -246,12 +247,12 @@ class Footer extends StatelessWidget {
246247
247248class ListItem extends StatelessWidget {
248249 // TODO replace with Post item model.
249- final String imageUrl;
250250 final String title;
251- final String description;
251+ final String ? imageUrl;
252+ final String ? description;
252253
253254 const ListItem (
254- {Key key, this .imageUrl, @required this .title , this .description})
255+ {Key ? key, required this .title, this .imageUrl , this .description})
255256 : super (key: key);
256257
257258 @override
@@ -261,7 +262,7 @@ class ListItem extends StatelessWidget {
261262 if (imageUrl != null )
262263 Container (
263264 child: ImageWrapper (
264- image: imageUrl,
265+ image: imageUrl! ,
265266 ),
266267 ),
267268 Align (
@@ -280,7 +281,7 @@ class ListItem extends StatelessWidget {
280281 child: Container (
281282 margin: marginBottom12,
282283 child: Text (
283- description,
284+ description! ,
284285 style: bodyTextStyle,
285286 ),
286287 ),
0 commit comments