Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit daa0c0e

Browse files
authored
✨ feat: default to user-selected country when fetching content bundles, fall back to locale country (#1284)
1 parent 9b0222c commit daa0c0e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

client/flutter/lib/api/content/content_loading.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dart:io';
22
import 'package:who_app/api/endpoints.dart';
3+
import 'package:who_app/api/user_preferences.dart';
34
import 'package:who_app/api/who_service.dart';
45
import 'package:flutter/services.dart' show rootBundle;
56
import 'package:flutter/cupertino.dart';
@@ -27,7 +28,8 @@ class ContentLoading {
2728
/// to a local asset. If no bundle can be found with the specified name an exception is thrown.
2829
Future<ContentBundle> load(Locale locale, String name) async {
2930
var languageCode = locale.languageCode;
30-
var countryCode = locale.countryCode;
31+
var countryCode =
32+
(await UserPreferences().getCountryIsoCode()) ?? locale.countryCode;
3133
var languageAndCountry = "${languageCode}_${countryCode}";
3234
var unsupportedSchemaVersionAvailable = false;
3335

0 commit comments

Comments
 (0)