Skip to content

Commit

Permalink
Fix new lints
Browse files Browse the repository at this point in the history
  • Loading branch information
blopker committed Feb 18, 2024
1 parent 22cea46 commit 7fe66d1
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions lib/edit_bike.dart
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class _CompleteFormState extends ConsumerState<CompleteForm> {
onTap: () async {
if (await _showMyDialog() ?? false) {
bikeNotifier.deleteStateData(widget.bike);
if (mounted) {
if (context.mounted) {
Navigator.pop(context);
}
}
Expand Down Expand Up @@ -264,31 +264,29 @@ Future<int> _showColorPicker(BuildContext context, int currentIndex) async {
final answer = await showModalBottomSheet<int>(
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
},
);
},
);
},
);
Expand Down

0 comments on commit 7fe66d1

Please sign in to comment.