Skip to content

Commit

Permalink
fix types of countries selector (#6365)
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k authored Feb 10, 2025
1 parent 75fc7b5 commit 4adbd94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:smooth_app/generic_lib/design_constants.dart';
import 'package:smooth_app/generic_lib/dialogs/smooth_alert_dialog.dart';
import 'package:smooth_app/helpers/provider_helper.dart';
import 'package:smooth_app/pages/prices/emoji_helper.dart';
import 'package:smooth_app/services/smooth_services.dart';
import 'package:smooth_app/widgets/selector_screen/smooth_screen_list_choice.dart';
import 'package:smooth_app/widgets/selector_screen/smooth_screen_selector_provider.dart';
import 'package:smooth_app/widgets/smooth_text.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ class _CountrySelectorProvider extends PreferencesSelectorProvider<Country> {

@override
Future<List<Country>> onLoadValues() async {
final List<Country> localizedCountries = CountriesHelper.getCountries(
userAppLanguageCode,
) as List<Country>;
final List<Country> localizedCountries = await CountriesHelper.getCountries(
userAppLanguageCode,
) ??
<Country>[];

final List<Country> countries = await compute(
_reformatCountries,
Expand Down Expand Up @@ -183,7 +184,8 @@ class CountriesHelper {
const Country(name: 'Germany', countryCode: 'DE'),
const Country(name: 'India', countryCode: 'IN'),
];
} catch (_) {
} catch (e) {
Logs.e('Failed to load countries', ex: e);
return null;
}
}
Expand Down

0 comments on commit 4adbd94

Please sign in to comment.