Error when building iOS app
JanBrin opened this issue · comments
Jan Brinkmann commented
Getting the following error after upgrading to 4.0.0:
../../../Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_translate-4.0.0/lib/src/utils/device_locale.dart:11:49: Error: Property 'window' cannot be accessed on 'WidgetsBinding?' because it is potentially null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../Flutter/flutter/packages/flutter/lib/src/widgets/binding.dart').
Try accessing using ?. instead.
final deviceLocales = WidgetsBinding.instance.window.locales;
Flutter Doctor output:
Flutter (Channel stable, 2.10.5, on macOS 12.3.1 21E258 darwin-arm, locale
en-DE)
• Flutter version 2.10.5 at /Users/janbrinkmann/Flutter/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 5464c5bac7 (2 weeks ago), 2022-04-18 09:55:37 -0700
• Engine revision 57d3bac3dd
• Dart version 2.16.2
• DevTools version 2.9.2
Florin Bratan commented
Yes it seems this issue occurs in stable channel.
Jan Brinkmann commented
Seems like 4.0.1 doesn't contain the changes i made
Florin Bratan commented
Fixed now in 4.0.2
Jan Brinkmann commented
Confirm, thanks for the quick response!
Fabio Biola commented
Hello, it seems like this bug is present again in 4.0.3