Skip to content

Commit 50dabbb

Browse files
committed
feat: migrate to bottom sheets
1 parent f52afbe commit 50dabbb

File tree

7 files changed

+561
-488
lines changed

7 files changed

+561
-488
lines changed

lib/Screens/Racing/circuit.dart

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import 'package:boxbox/classes/article.dart';
2222
import 'package:boxbox/classes/driver.dart';
2323
import 'package:boxbox/classes/event_tracker.dart';
2424
import 'package:boxbox/classes/race.dart';
25+
import 'package:boxbox/helpers/bottom_sheet.dart';
2526
import 'package:boxbox/helpers/buttons.dart';
2627
import 'package:boxbox/helpers/divider.dart';
2728
import 'package:boxbox/helpers/loading_indicator_util.dart';
@@ -354,75 +355,74 @@ class SessionItemForCircuit extends StatelessWidget {
354355
? IconButton(
355356
icon: Icon(Icons.link_outlined),
356357
iconSize: 25,
357-
onPressed: () async => await showModalBottomSheet(
358-
context: context,
359-
isScrollControlled: true,
360-
builder: (context) => BottomSheet(
361-
shape: RoundedRectangleBorder(
362-
borderRadius: BorderRadius.circular(10.0),
363-
),
364-
onClosing: () {},
365-
builder: (context) {
366-
return SizedBox(
367-
child: ListView.builder(
368-
shrinkWrap: true,
369-
itemCount: links!.length + 1,
370-
itemBuilder: (context, index) => index == 0
371-
? Padding(
372-
padding: EdgeInsets.only(top: 5),
373-
child: ListTile(
374-
title: Text(
375-
AppLocalizations.of(context)!
376-
.links,
377-
style: Theme.of(context)
378-
.textTheme
379-
.headlineMedium,
380-
),
381-
),
382-
)
383-
: ListTile(
358+
onPressed: () async => await showCustomBottomSheet(
359+
context,
360+
SizedBox(
361+
child: Padding(
362+
padding: EdgeInsets.fromLTRB(
363+
30,
364+
15,
365+
30,
366+
MediaQuery.of(context).viewInsets.bottom,
367+
),
368+
child: ListView.builder(
369+
shrinkWrap: true,
370+
itemCount: links!.length + 1,
371+
itemBuilder: (context, index) => index == 0
372+
? Padding(
373+
padding: EdgeInsets.only(top: 5),
374+
child: ListTile(
384375
title: Text(
385-
links![index - 1].text == 'report'
386-
? 'Report'
387-
: links![index - 1].text ==
388-
'highlights'
389-
? 'Highlights'
390-
: links![index - 1].text ==
391-
'lapByLap'
392-
? 'Lap-by-lap'
393-
: links![index - 1]
394-
.text
395-
.contains(
396-
'Grid')
397-
? AppLocalizations
398-
.of(
399-
context)!
400-
.startingGrid
401-
: links![index - 1]
402-
.text,
376+
AppLocalizations.of(context)!.links,
377+
style: TextStyle(fontSize: 20),
403378
),
404-
leading: links![index - 1].text ==
405-
'report'
406-
? Icon(Icons.analytics_outlined)
379+
),
380+
)
381+
: ListTile(
382+
title: Text(
383+
links![index - 1].text == 'report'
384+
? 'Report'
407385
: links![index - 1].text ==
408386
'highlights'
409-
? Icon(
410-
Icons.play_arrow_outlined,
411-
)
412-
: Icon(
413-
Icons.article_outlined,
414-
),
415-
onTap: () =>
416-
CircuitUIProvider().linkTapAction(
417-
links![index - 1].type,
418-
links![index - 1].url,
419-
context,
420-
meetingId,
421-
),
387+
? 'Highlights'
388+
: links![index - 1].text ==
389+
'lapByLap'
390+
? 'Lap-by-lap'
391+
: links![index - 1]
392+
.text
393+
.contains('Grid')
394+
? AppLocalizations.of(
395+
context)!
396+
.startingGrid
397+
: links![index - 1]
398+
.text ==
399+
'driverOfTheDay'
400+
? 'Driver of the Day'
401+
: links![
402+
index - 1]
403+
.text,
404+
),
405+
leading: links![index - 1].text ==
406+
'report'
407+
? Icon(Icons.analytics_outlined)
408+
: links![index - 1].text ==
409+
'highlights'
410+
? Icon(
411+
Icons.play_arrow_outlined,
412+
)
413+
: Icon(
414+
Icons.article_outlined,
415+
),
416+
onTap: () =>
417+
CircuitUIProvider().linkTapAction(
418+
links![index - 1].type,
419+
links![index - 1].url,
420+
context,
421+
meetingId,
422422
),
423-
),
424-
);
425-
},
423+
),
424+
),
425+
),
426426
),
427427
),
428428
)

lib/Screens/Settings/championship.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ class _ChampionshipScreenState extends State<ChampionshipScreen> {
109109
SizedBox(
110110
child: Padding(
111111
padding: EdgeInsets.fromLTRB(
112-
30,
112+
20,
113113
15,
114-
30,
114+
20,
115115
MediaQuery.of(context).viewInsets.bottom,
116116
),
117117
child: Column(

0 commit comments

Comments
 (0)