@@ -57,96 +57,29 @@ class RaceListHeaderItem extends StatelessWidget {
5757
5858 @override
5959 Widget build (BuildContext context) {
60- String championship = Hive .box ('settings' )
61- .get ('championship' , defaultValue: 'Formula 1' ) as String ;
62- String scheduleLastSavedFormat = '' ;
63- if (championship == 'Formula 1' ) {
64- scheduleLastSavedFormat = Hive .box ('requests' )
65- .get ('f1ScheduleLastSavedFormat' , defaultValue: 'ergast' );
66- }
67- bool shouldUse12HourClock = Hive .box ('settings' )
68- .get ('shouldUse12HourClock' , defaultValue: false ) as bool ;
69- List months = [
70- AppLocalizations .of (context)? .monthAbbreviationJanuary,
71- AppLocalizations .of (context)? .monthAbbreviationFebruary,
72- AppLocalizations .of (context)? .monthAbbreviationMarch,
73- AppLocalizations .of (context)? .monthAbbreviationApril,
74- AppLocalizations .of (context)? .monthAbbreviationMay,
75- AppLocalizations .of (context)? .monthAbbreviationJune,
76- AppLocalizations .of (context)? .monthAbbreviationJuly,
77- AppLocalizations .of (context)? .monthAbbreviationAugust,
78- AppLocalizations .of (context)? .monthAbbreviationSeptember,
79- AppLocalizations .of (context)? .monthAbbreviationOctober,
80- AppLocalizations .of (context)? .monthAbbreviationNovember,
81- AppLocalizations .of (context)? .monthAbbreviationDecember,
82- ];
83- int month;
84- String day;
85- DateTime raceDate;
86- String formatedRaceDate;
87-
88- if (scheduleLastSavedFormat == 'ergast' ) {
89- month = int .parse (item.date.split ("-" )[1 ]);
90- day = item.date.split ("-" )[2 ];
91- raceDate = DateTime .parse ('${item .date } ${item .raceHour }' ).toLocal ();
92-
93- formatedRaceDate = shouldUse12HourClock
94- ? DateFormat .jm ().format (raceDate)
95- : DateFormat .Hm ().format (raceDate);
96- } else {
97- raceDate = DateTime .parse (item.date);
98- month = raceDate.month;
99- day = raceDate.day.toString ();
100- formatedRaceDate = shouldUse12HourClock
101- ? DateFormat .jm ().format (raceDate)
102- : DateFormat .Hm ().format (raceDate);
103- }
104-
105- return Stack (
106- alignment: Alignment .center,
60+ return Column (
61+ mainAxisSize: MainAxisSize .min,
10762 children: [
108- ClipRRect (
109- borderRadius: const BorderRadius .only (
110- topLeft: Radius .circular (10 ),
111- topRight: Radius .circular (10 ),
112- ),
113- child: ImageRenderer (
114- item.raceCoverUrl != null
115- ? item.raceCoverUrl!
116- : RaceTracksUrls ().getRaceCoverImageUrl (item.circuitId),
117- inSchedule: true ,
118- ),
119- ),
120- Column (
63+ Stack (
64+ alignment: Alignment .center,
12165 children: [
122- Text (
123- item.country,
124- style: TextStyle (
125- fontSize: 80 ,
126- fontWeight: FontWeight .normal,
127- fontFamily: 'Northwell' ,
128- ),
129- ),
130- Padding (
131- padding: EdgeInsets .only (bottom: 5 , top: 15 ),
132- child: Text (
133- formatedRaceDate +
134- ' ∙ ' +
135- day +
136- ' ' +
137- months[month - 1 ].toLowerCase (),
138- style: TextStyle (fontSize: 18 ),
139- ),
66+ ImageRenderer (
67+ item.raceCoverUrl != null
68+ ? item.raceCoverUrl!
69+ : RaceTracksUrls ().getRaceCoverImageUrl (item.circuitId),
70+ inSchedule: true ,
14071 ),
14172 Text (
142- item.circuitName ,
73+ item.country ,
14374 style: TextStyle (
144- fontSize: 15 ,
145- fontStyle: FontStyle .italic,
75+ fontSize: 60 ,
76+ fontWeight: FontWeight .w800,
77+ color: Colors .white.withAlpha (170 ),
14678 ),
14779 ),
14880 ],
14981 ),
82+ RaceListItem (item, index),
15083 ],
15184 );
15285 }
0 commit comments