use async / await

This commit is contained in:
Seth Ladd
2015-12-08 14:16:14 -08:00
parent 724388d24f
commit 2666628b12

View File

@@ -94,12 +94,11 @@ class StocksAppState extends State<StocksApp> {
return null;
}
Future<LocaleQueryData> _onLocaleChanged(ui.Locale locale) {
Future<LocaleQueryData> _onLocaleChanged(ui.Locale locale) async {
String localeString = locale.toString();
return initializeMessages(localeString).then((_) {
Intl.defaultLocale = localeString;
return StockStrings.instance;
});
await initializeMessages(localeString);
Intl.defaultLocale = localeString;
return StockStrings.instance;
}
Widget build(BuildContext context) {