wonders/lib/ui/common/controls/locale_switcher.dart
Jared Bell 1eae15a1a8 Menu screen enhancements
* Increase background blur
* Reduce overlay transparency
* Override local button padding to reduce size
2023-01-04 21:32:50 -07:00

17 lines
572 B
Dart

import 'package:wonders/common_libs.dart';
class LocaleSwitcher extends StatelessWidget with GetItMixin {
LocaleSwitcher({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final locale = watchX((SettingsLogic s) => s.currentLocale);
Future<void> handleSwapLocale() async {
final newLocale = Locale(locale == 'en' ? 'zh' : 'en');
await settingsLogic.changeLocale(newLocale);
}
return AppBtn.from(text: $strings.localeSwapButton, onPressed: handleSwapLocale, padding: EdgeInsets.all($styles.insets.sm));
}
}