Skip to content

Commit f52afbe

Browse files
committed
feat: filter bottom sheet, improve poll/quiz button
1 parent c60f25d commit f52afbe

32 files changed

+357
-155
lines changed

lib/Screens/Settings/championship.dart

Lines changed: 95 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -98,85 +98,112 @@ class _ChampionshipScreenState extends State<ChampionshipScreen> {
9898
trailing: Row(
9999
mainAxisSize: MainAxisSize.min,
100100
children: [
101-
IconButton(
102-
onPressed: () async {
103-
final TextEditingController controller =
104-
TextEditingController();
105-
await showCustomBottomSheet(
106-
context,
107-
SizedBox(
108-
child: Padding(
109-
padding: EdgeInsets.fromLTRB(
110-
30,
111-
15,
112-
30,
113-
MediaQuery.of(context).viewInsets.bottom,
114-
),
115-
child: Column(
116-
mainAxisSize: MainAxisSize.min,
117-
children: [
118-
Padding(
119-
padding: EdgeInsets.only(bottom: 20),
120-
child: Text(
121-
AppLocalizations.of(context)!
122-
.customErgastUrl,
123-
style: TextStyle(fontSize: 20),
101+
Padding(
102+
padding: EdgeInsets.only(right: 5),
103+
child: IconButton(
104+
onPressed: () async {
105+
final TextEditingController controller =
106+
TextEditingController();
107+
await showCustomBottomSheet(
108+
context,
109+
SizedBox(
110+
child: Padding(
111+
padding: EdgeInsets.fromLTRB(
112+
30,
113+
15,
114+
30,
115+
MediaQuery.of(context).viewInsets.bottom,
116+
),
117+
child: Column(
118+
mainAxisSize: MainAxisSize.min,
119+
children: [
120+
Padding(
121+
padding: EdgeInsets.only(bottom: 20),
122+
child: Text(
123+
AppLocalizations.of(context)!
124+
.customErgastUrl,
125+
style: TextStyle(fontSize: 20),
126+
),
127+
),
128+
TextField(
129+
controller: controller,
130+
decoration: InputDecoration(
131+
border: OutlineInputBorder(),
132+
hintText: ergastUrl,
133+
hintStyle: TextStyle(
134+
fontWeight: FontWeight.w100,
135+
),
136+
),
124137
),
125-
),
126-
TextField(
127-
controller: controller,
128-
decoration: InputDecoration(
129-
border: OutlineInputBorder(),
130-
hintText: ergastUrl,
131-
hintStyle: TextStyle(
132-
fontWeight: FontWeight.w100,
138+
Padding(
139+
padding:
140+
EdgeInsets.only(top: 20, bottom: 7),
141+
child: Container(
142+
width: double.infinity,
143+
height: 50,
144+
child: FilledButton.tonal(
145+
onPressed: () {
146+
Hive.box('settings').put(
147+
'ergastUrl',
148+
controller.text,
149+
);
150+
Navigator.of(context).pop();
151+
setState(() {});
152+
},
153+
child: Text(
154+
AppLocalizations.of(context)!
155+
.save,
156+
),
157+
),
133158
),
134159
),
135-
),
136-
Padding(
137-
padding:
138-
EdgeInsets.only(top: 20, bottom: 7),
139-
child: Container(
140-
width: double.infinity,
141-
height: 50,
142-
child: FilledButton.tonal(
143-
onPressed: () {
144-
Hive.box('settings').put(
145-
'ergastUrl',
146-
controller.text,
147-
);
148-
Navigator.of(context).pop();
149-
setState(() {});
150-
},
151-
child: Text(
152-
AppLocalizations.of(context)!.save,
160+
Padding(
161+
padding:
162+
EdgeInsets.only(top: 7, bottom: 7),
163+
child: Container(
164+
width: double.infinity,
165+
height: 50,
166+
child: OutlinedButton(
167+
onPressed: () {
168+
Hive.box('settings').put(
169+
'ergastUrl',
170+
Constants().ERGAST_API_URL,
171+
);
172+
Navigator.of(context).pop();
173+
setState(() {});
174+
},
175+
child: Text(
176+
AppLocalizations.of(context)!
177+
.reset,
178+
),
153179
),
154180
),
155181
),
156-
),
157-
Padding(
158-
padding:
159-
EdgeInsets.only(top: 7, bottom: 20),
160-
child: Container(
161-
width: double.infinity,
162-
height: 50,
163-
child: OutlinedButton(
164-
onPressed: () {
165-
Navigator.of(context).pop();
166-
},
167-
child: Text(
168-
AppLocalizations.of(context)!.close,
182+
Padding(
183+
padding:
184+
EdgeInsets.only(top: 7, bottom: 20),
185+
child: Container(
186+
width: double.infinity,
187+
height: 50,
188+
child: OutlinedButton(
189+
onPressed: () {
190+
Navigator.of(context).pop();
191+
},
192+
child: Text(
193+
AppLocalizations.of(context)!
194+
.close,
195+
),
169196
),
170197
),
171198
),
172-
),
173-
],
199+
],
200+
),
174201
),
175202
),
176-
),
177-
);
178-
},
179-
icon: Icon(Icons.settings_outlined),
203+
);
204+
},
205+
icon: Icon(Icons.settings_outlined),
206+
),
180207
),
181208
Radio(
182209
value: false,

lib/api/atom_article_parts.dart

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,24 @@ class AtomInteractiveExperience extends StatelessWidget {
183183
@override
184184
Widget build(BuildContext context) {
185185
return BoxBoxButton(
186-
AppLocalizations.of(context)!.openLiveBlog,
186+
element['fields']['experienceType'] == 'Quiz'
187+
? AppLocalizations.of(context)!.openQuiz
188+
: element['fields']['experienceType'] == 'Poll'
189+
? AppLocalizations.of(context)!.openPoll
190+
: AppLocalizations.of(context)!.openLiveBlog,
187191
SizedBox(
188192
width: 24.0,
189193
height: 24.0,
190-
child: LoadingIndicator(
191-
indicatorType: Indicator.ballScaleMultiple,
192-
colors: [
193-
Theme.of(context).colorScheme.onPrimary,
194-
],
195-
),
194+
child: element['fields']['experienceType'] == 'Quiz'
195+
? Icon(Icons.quiz_outlined)
196+
: element['fields']['experienceType'] == 'Poll'
197+
? Icon(Icons.poll_outlined)
198+
: LoadingIndicator(
199+
indicatorType: Indicator.ballScaleMultiple,
200+
colors: [
201+
Theme.of(context).colorScheme.onPrimary,
202+
],
203+
),
196204
),
197205
isRoute: false,
198206
widget: Scaffold(

lib/l10n/app_en.arb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@
261261
"@openInBrowser": {},
262262
"openLiveBlog": "Open live blog",
263263
"@openLiveBlog": {},
264-
"openQuiz": "Open quiz",
264+
"openPoll": "Take the survey",
265+
"@openPoll": {},
266+
"openQuiz": "Take the quiz",
265267
"@openQuiz": {},
266268
"openingWithInAppBrowser": "Opening with the in-app browser",
267269
"@openingWithInAppBrowser": {},
@@ -325,6 +327,8 @@
325327
"@requestError": {},
326328
"requiredNetworkConnection": "Required network connection",
327329
"@requiredNetworkConnection": {},
330+
"reset": "Reset",
331+
"@reset": {},
328332
"results": "Results",
329333
"@results": {},
330334
"running": "Running",

lib/l10n/app_fr.arb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@country": {},
5858
"crashError": "Erreur :",
5959
"@crashError": {},
60-
"customErgastUrl": "Ergast URL personnalisée",
60+
"customErgastUrl": "URL Ergast personnalisée",
6161
"@customErgastUrl": {},
6262
"customFeed": "Flux personnalisé",
6363
"@customFeed": {},
@@ -260,7 +260,9 @@
260260
"@openInBrowser": {},
261261
"openLiveBlog": "Ouvrir le blog en direct",
262262
"@openLiveBlog": {},
263-
"openQuiz": "Ouvrir le quiz",
263+
"openPoll": "Répondre au sondage",
264+
"@openPoll": {},
265+
"openQuiz": "Jouer au quiz",
264266
"@openQuiz": {},
265267
"openingWithInAppBrowser": "Ouverture dans le navigateur intégré",
266268
"@openingWithInAppBrowser": {},
@@ -326,6 +328,8 @@
326328
"@requestError": {},
327329
"requiredNetworkConnection": "Connexion réseau nécessaire",
328330
"@requiredNetworkConnection": {},
331+
"reset": "Réinitialiser",
332+
"@reset": {},
329333
"results": "Résultats",
330334
"@results": {},
331335
"running": "En cours",

lib/l10n/app_localizations.dart

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,10 +922,16 @@ abstract class AppLocalizations {
922922
/// **'Open live blog'**
923923
String get openLiveBlog;
924924

925+
/// No description provided for @openPoll.
926+
///
927+
/// In en, this message translates to:
928+
/// **'Take the survey'**
929+
String get openPoll;
930+
925931
/// No description provided for @openQuiz.
926932
///
927933
/// In en, this message translates to:
928-
/// **'Open quiz'**
934+
/// **'Take the quiz'**
929935
String get openQuiz;
930936

931937
/// No description provided for @openingWithInAppBrowser.
@@ -1114,6 +1120,12 @@ abstract class AppLocalizations {
11141120
/// **'Required network connection'**
11151121
String get requiredNetworkConnection;
11161122

1123+
/// No description provided for @reset.
1124+
///
1125+
/// In en, this message translates to:
1126+
/// **'Reset'**
1127+
String get reset;
1128+
11171129
/// No description provided for @results.
11181130
///
11191131
/// In en, this message translates to:

lib/l10n/app_localizations_ar.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ class AppLocalizationsAr extends AppLocalizations {
398398
@override
399399
String get openLiveBlog => 'افتح المدونة المباشرة';
400400

401+
@override
402+
String get openPoll => 'Take the survey';
403+
401404
@override
402405
String get openQuiz => 'افتح الإختبار';
403406

@@ -494,6 +497,9 @@ class AppLocalizationsAr extends AppLocalizations {
494497
@override
495498
String get requiredNetworkConnection => 'Required network connection';
496499

500+
@override
501+
String get reset => 'Reset';
502+
497503
@override
498504
String get results => 'نتائج';
499505

lib/l10n/app_localizations_bn.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ class AppLocalizationsBn extends AppLocalizations {
398398
@override
399399
String get openLiveBlog => 'লাইভ ব্লগ খুলুন';
400400

401+
@override
402+
String get openPoll => 'Take the survey';
403+
401404
@override
402405
String get openQuiz => 'কুইজ খুলুন';
403406

@@ -494,6 +497,9 @@ class AppLocalizationsBn extends AppLocalizations {
494497
@override
495498
String get requiredNetworkConnection => 'নেটওয়ার্ক সংযোগ প্রয়োজনীয়';
496499

500+
@override
501+
String get reset => 'Reset';
502+
497503
@override
498504
String get results => 'ফলাফল';
499505

lib/l10n/app_localizations_de.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ class AppLocalizationsDe extends AppLocalizations {
398398
@override
399399
String get openLiveBlog => 'Live-Blog öffnen';
400400

401+
@override
402+
String get openPoll => 'Take the survey';
403+
401404
@override
402405
String get openQuiz => 'Quiz öffnen';
403406

@@ -494,6 +497,9 @@ class AppLocalizationsDe extends AppLocalizations {
494497
@override
495498
String get requiredNetworkConnection => 'Required network connection';
496499

500+
@override
501+
String get reset => 'Reset';
502+
497503
@override
498504
String get results => 'Ergebnisse';
499505

lib/l10n/app_localizations_el.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,10 @@ class AppLocalizationsEl extends AppLocalizations {
399399
String get openLiveBlog => 'Open live blog';
400400

401401
@override
402-
String get openQuiz => 'Open quiz';
402+
String get openPoll => 'Take the survey';
403+
404+
@override
405+
String get openQuiz => 'Take the quiz';
403406

404407
@override
405408
String get openingWithInAppBrowser => 'Opening with the in-app browser';
@@ -494,6 +497,9 @@ class AppLocalizationsEl extends AppLocalizations {
494497
@override
495498
String get requiredNetworkConnection => 'Required network connection';
496499

500+
@override
501+
String get reset => 'Reset';
502+
497503
@override
498504
String get results => 'Results';
499505

lib/l10n/app_localizations_en.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,10 @@ class AppLocalizationsEn extends AppLocalizations {
399399
String get openLiveBlog => 'Open live blog';
400400

401401
@override
402-
String get openQuiz => 'Open quiz';
402+
String get openPoll => 'Take the survey';
403+
404+
@override
405+
String get openQuiz => 'Take the quiz';
403406

404407
@override
405408
String get openingWithInAppBrowser => 'Opening with the in-app browser';
@@ -494,6 +497,9 @@ class AppLocalizationsEn extends AppLocalizations {
494497
@override
495498
String get requiredNetworkConnection => 'Required network connection';
496499

500+
@override
501+
String get reset => 'Reset';
502+
497503
@override
498504
String get results => 'Results';
499505

0 commit comments

Comments
 (0)