From 06718b84fd689af4784478f016215048206443a8 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 19 Mar 2021 16:37:59 +0100 Subject: [PATCH] fix locale --- packages/stream_chat_flutter/lib/src/stream_chat.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/stream_chat.dart b/packages/stream_chat_flutter/lib/src/stream_chat.dart index 8ad751b0..470591e7 100644 --- a/packages/stream_chat_flutter/lib/src/stream_chat.dart +++ b/packages/stream_chat_flutter/lib/src/stream_chat.dart @@ -7,6 +7,7 @@ import 'package:jiffy/jiffy.dart'; import 'package:stream_chat_flutter/src/stream_chat_theme.dart'; import 'package:stream_chat_flutter/stream_chat_flutter.dart'; import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart'; +import 'dart:ui' as ui; /// Widget used to provide information about the chat to the widget tree /// @@ -125,8 +126,8 @@ class StreamChatState extends State { @override void didChangeDependencies() { - final locals = Localizations.localeOf(context); - Jiffy.locale(locals.languageCode); + final locale = ui.window.locale; + Jiffy.locale(locale.languageCode); super.didChangeDependencies(); } }