Null safety access to WidgetsBinding.instance
jiazhengshi opened this issue · comments
J. Shi commented
https://github.com/Jesway/Flutter-Translate/blob/master/lib/src/utils/device_locale.dart#L13
Try accessing using ?. instead.
final deviceLocales = WidgetsBinding.instance.window.locales;
Florin Bratan commented
It's not necessary, neither the instance nor the window can be null. If this was the case it wouldn't compile otherwise.
Florin Bratan commented
@jiazhengshi - It seems this issue occurs in the stable channel and #85 fixes it.
J. Shi commented
thanks