Skip to content

Commit

Permalink
[api] use official api by default on fresh install (ergast not really…
Browse files Browse the repository at this point in the history
… maintained...)
  • Loading branch information
BrightDV committed Oct 29, 2024
1 parent 7e1c783 commit e7a2f5b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/Screens/race_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ class _RaceResultsProviderState extends State<RaceResultsProvider> {
}
} else {
bool useOfficialDataSoure = Hive.box('settings')
.get('useOfficialDataSoure', defaultValue: false) as bool;
.get('useOfficialDataSoure', defaultValue: true) as bool;
String championship = Hive.box('settings')
.get('championship', defaultValue: 'Formula 1') as String;
if (championship == 'Formula 1') {
Expand Down Expand Up @@ -884,7 +884,7 @@ class _SprintResultsProviderState extends State<SprintResultsProvider> {
return await Formula1().getSprintStandings(meetingId);
} else {
bool useOfficialDataSoure = Hive.box('settings')
.get('useOfficialDataSoure', defaultValue: false) as bool;
.get('useOfficialDataSoure', defaultValue: true) as bool;
if (useOfficialDataSoure) {
return await Formula1().getSprintStandings(race!.meetingId);
} else {
Expand Down Expand Up @@ -1022,7 +1022,7 @@ class _QualificationResultsProviderState
.get('championship', defaultValue: 'Formula 1') as String;
if (championship == 'Formula 1') {
bool useOfficialDataSoure = Hive.box('settings')
.get('useOfficialDataSoure', defaultValue: false) as bool;
.get('useOfficialDataSoure', defaultValue: true) as bool;
if (widget.isSprintQualifying ?? false) {
return await Formula1().getSprintQualifyingStandings(race!.meetingId);
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/Screens/schedule.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ScheduleWidget extends StatelessWidget {
.get('championship', defaultValue: 'Formula 1') as String;
if (championship == 'Formula 1') {
bool useOfficialDataSoure = Hive.box('settings')
.get('useOfficialDataSoure', defaultValue: false) as bool;
.get('useOfficialDataSoure', defaultValue: true) as bool;
if (useOfficialDataSoure) {
return await Formula1().getLastSchedule(toCome);
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/Screens/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ class _OtherCardstate extends State<OtherCard> {
bool useOfficialWebview = Hive.box('settings')
.get('useOfficialWebview', defaultValue: true) as bool;
bool useOfficialDataSoure = Hive.box('settings')
.get('useOfficialDataSoure', defaultValue: false) as bool;
.get('useOfficialDataSoure', defaultValue: true) as bool;
bool shouldUse12HourClock = Hive.box('settings')
.get('shouldUse12HourClock', defaultValue: false) as bool;
bool enableExperimentalFeatures = Hive.box('settings')
Expand Down
4 changes: 2 additions & 2 deletions lib/Screens/standings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class DriversStandingsWidget extends StatelessWidget {
.get('championship', defaultValue: 'Formula 1') as String;
if (championship == 'Formula 1') {
bool useOfficialDataSoure = Hive.box('settings')
.get('useOfficialDataSoure', defaultValue: false) as bool;
.get('useOfficialDataSoure', defaultValue: true) as bool;
if (useOfficialDataSoure) {
return await Formula1().getLastStandings();
} else {
Expand Down Expand Up @@ -185,7 +185,7 @@ class TeamsStandingsWidget extends StatelessWidget {
.get('championship', defaultValue: 'Formula 1') as String;
if (championship == 'Formula 1') {
bool useOfficialDataSoure = Hive.box('settings')
.get('useOfficialDataSoure', defaultValue: false) as bool;
.get('useOfficialDataSoure', defaultValue: true) as bool;
if (useOfficialDataSoure) {
return await Formula1().getLastTeamsStandings();
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/api/event_tracker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class EventTracker {
String endpoint = Hive.box('settings')
.get('server', defaultValue: defaultEndpoint) as String;
bool useOfficialDataSoure = Hive.box('settings')
.get('useOfficialDataSoure', defaultValue: false) as bool;
.get('useOfficialDataSoure', defaultValue: true) as bool;

Uri uri = Uri.parse(
endpoint != defaultEndpoint
Expand Down

0 comments on commit e7a2f5b

Please sign in to comment.