From 1ec649c86838dc6d0744e363dc7edc2403519c89 Mon Sep 17 00:00:00 2001 From: kstar0707 Date: Sat, 8 Jan 2022 10:29:21 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20(fix)=20Display=20error=20when?= =?UTF-8?q?=20adding=20image=20in=20tweeet=20compose.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/TheAlphamerc/flutter_twitter_clone/issues/227 --- .../page/feed/composeTweet/widget/composeTweetImage.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ui/page/feed/composeTweet/widget/composeTweetImage.dart b/lib/ui/page/feed/composeTweet/widget/composeTweetImage.dart index 6075f85..4e677a6 100644 --- a/lib/ui/page/feed/composeTweet/widget/composeTweetImage.dart +++ b/lib/ui/page/feed/composeTweet/widget/composeTweetImage.dart @@ -4,8 +4,9 @@ import 'package:flutter_twitter_clone/ui/theme/theme.dart'; class ComposeTweetImage extends StatelessWidget { final File? image; - final Function? onCrossIconPressed; - const ComposeTweetImage({Key? key, this.image, this.onCrossIconPressed}) + final VoidCallback onCrossIconPressed; + const ComposeTweetImage( + {Key? key, this.image, required this.onCrossIconPressed}) : super(key: key); @override Widget build(BuildContext context) { @@ -39,7 +40,7 @@ class ComposeTweetImage extends StatelessWidget { child: IconButton( padding: const EdgeInsets.all(0), iconSize: 20, - onPressed: onCrossIconPressed!(), + onPressed: onCrossIconPressed, icon: Icon( Icons.close, color: Theme.of(context).colorScheme.onPrimary,