Skip to content

Commit

Permalink
fix displying current locale when it is default
Browse files Browse the repository at this point in the history
  • Loading branch information
smart7even committed Aug 6, 2023
1 parent 210079e commit 79802a7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/feature/settings/widget/settings_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand Down Expand Up @@ -38,6 +40,11 @@ class _SettingsPageState extends State<SettingsPage> {
setState(() {
_selectedLanguage = 1;
});
} else {
setState(() {
final defaultLocale = Platform.localeName;
_selectedLanguage = defaultLocale.split('_')[0] == 'ru' ? 0 : 1;
});
}
});
}
Expand Down

0 comments on commit 79802a7

Please sign in to comment.