|
20 | 20 | import 'dart:math' as math; |
21 | 21 |
|
22 | 22 | import 'package:boxbox/api/services/formulae.dart'; |
23 | | -import 'package:boxbox/helpers/bottom_sheet.dart'; |
24 | | -import 'package:boxbox/helpers/constants.dart'; |
25 | 23 | import 'package:boxbox/l10n/app_localizations.dart'; |
26 | 24 | import 'package:flutter/material.dart'; |
27 | 25 | import 'package:fluttertoast/fluttertoast.dart'; |
@@ -108,119 +106,6 @@ class _OtherSettingsScreenState extends State<OtherSettingsScreen> { |
108 | 106 | ); |
109 | 107 | }, |
110 | 108 | ), |
111 | | - if (championship == 'Formula 1') |
112 | | - ListTile( |
113 | | - title: Text( |
114 | | - AppLocalizations.of(context)!.apiKey, |
115 | | - ), |
116 | | - onTap: () { |
117 | | - final TextEditingController controller = |
118 | | - TextEditingController(); |
119 | | - showCustomBottomSheet( |
120 | | - context, |
121 | | - StatefulBuilder( |
122 | | - builder: (context, setState) => Padding( |
123 | | - padding: EdgeInsets.fromLTRB( |
124 | | - 20, |
125 | | - 15, |
126 | | - 20, |
127 | | - 15, |
128 | | - ), |
129 | | - child: Column( |
130 | | - mainAxisAlignment: MainAxisAlignment.center, |
131 | | - crossAxisAlignment: CrossAxisAlignment.center, |
132 | | - mainAxisSize: MainAxisSize.min, |
133 | | - children: <Widget>[ |
134 | | - Text( |
135 | | - AppLocalizations.of(context)!.updateApiKey, |
136 | | - style: TextStyle( |
137 | | - fontSize: 20.0, |
138 | | - ), // here |
139 | | - textAlign: TextAlign.center, |
140 | | - ), |
141 | | - Padding( |
142 | | - padding: EdgeInsets.only(top: 15, bottom: 10), |
143 | | - child: Text( |
144 | | - AppLocalizations.of(context)!.updateApiKeySub, |
145 | | - textAlign: TextAlign.justify, |
146 | | - ), |
147 | | - ), |
148 | | - TextField( |
149 | | - controller: controller, |
150 | | - autofocus: true, |
151 | | - decoration: InputDecoration( |
152 | | - border: OutlineInputBorder(), |
153 | | - hintText: AppLocalizations.of(context)!.apiKey, |
154 | | - hintStyle: TextStyle( |
155 | | - fontWeight: FontWeight.w100, |
156 | | - ), |
157 | | - ), |
158 | | - ), |
159 | | - Padding( |
160 | | - padding: EdgeInsets.only(top: 20, bottom: 7), |
161 | | - child: Container( |
162 | | - width: double.infinity, |
163 | | - height: 50, |
164 | | - child: FilledButton.tonal( |
165 | | - onPressed: () { |
166 | | - Hive.box('settings').put( |
167 | | - 'officialApiKey', |
168 | | - controller.text, |
169 | | - ); |
170 | | - Navigator.of(context).pop(); |
171 | | - setState(() {}); |
172 | | - }, |
173 | | - child: Text( |
174 | | - AppLocalizations.of(context)!.save, |
175 | | - ), |
176 | | - ), |
177 | | - ), |
178 | | - ), |
179 | | - Padding( |
180 | | - padding: EdgeInsets.only(top: 7, bottom: 7), |
181 | | - child: Container( |
182 | | - width: double.infinity, |
183 | | - height: 50, |
184 | | - child: OutlinedButton( |
185 | | - onPressed: () { |
186 | | - Hive.box('settings').put( |
187 | | - 'officialApiKey', |
188 | | - Constants().F1_API_KEY, |
189 | | - ); |
190 | | - Navigator.of(context).pop(); |
191 | | - setState(() {}); |
192 | | - }, |
193 | | - child: Text( |
194 | | - AppLocalizations.of(context)!.reset, |
195 | | - ), |
196 | | - ), |
197 | | - ), |
198 | | - ), |
199 | | - Padding( |
200 | | - padding: EdgeInsets.only(top: 7, bottom: 20), |
201 | | - child: Container( |
202 | | - width: double.infinity, |
203 | | - height: 50, |
204 | | - child: OutlinedButton( |
205 | | - onPressed: () { |
206 | | - Navigator.of(context).pop(); |
207 | | - }, |
208 | | - child: Text( |
209 | | - AppLocalizations.of(context)!.close, |
210 | | - ), |
211 | | - ), |
212 | | - ), |
213 | | - ), |
214 | | - ], |
215 | | - ), |
216 | | - ), |
217 | | - ), |
218 | | - ); |
219 | | - }, |
220 | | - trailing: Icon( |
221 | | - Icons.key_outlined, |
222 | | - ), |
223 | | - ), |
224 | 109 | if (championship == 'Formula 1') |
225 | 110 | ListTile( |
226 | 111 | title: Text( |
|
0 commit comments