From 7fe66d1562afa29873582a6330172b45593972ba Mon Sep 17 00:00:00 2001 From: Bo Lopker Date: Sun, 18 Feb 2024 12:29:49 -0800 Subject: [PATCH] Fix new lints --- lib/edit_bike.dart | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/lib/edit_bike.dart b/lib/edit_bike.dart index dc1f67c..7dffd63 100644 --- a/lib/edit_bike.dart +++ b/lib/edit_bike.dart @@ -223,7 +223,7 @@ class _CompleteFormState extends ConsumerState { onTap: () async { if (await _showMyDialog() ?? false) { bikeNotifier.deleteStateData(widget.bike); - if (mounted) { + if (context.mounted) { Navigator.pop(context); } } @@ -264,31 +264,29 @@ Future _showColorPicker(BuildContext context, int currentIndex) async { final answer = await showModalBottomSheet( context: context, builder: (BuildContext context) { - return Container( - child: ListView.builder( - itemCount: colors.length, - itemBuilder: (BuildContext context, int index) { - return ListTile( - title: Container( - height: 50, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(26), - gradient: LinearGradient( - colors: [ - Color(colors[index].start), - Color(colors[index].end), - ], - begin: Alignment.bottomLeft, - end: Alignment.topRight, - ), + return ListView.builder( + itemCount: colors.length, + itemBuilder: (BuildContext context, int index) { + return ListTile( + title: Container( + height: 50, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(26), + gradient: LinearGradient( + colors: [ + Color(colors[index].start), + Color(colors[index].end), + ], + begin: Alignment.bottomLeft, + end: Alignment.topRight, ), ), - onTap: () { - Navigator.pop(context, index); // return the color index - }, - ); - }, - ), + ), + onTap: () { + Navigator.pop(context, index); // return the color index + }, + ); + }, ); }, );