David PHAM-VAN

Fix PdfPreview default locale

1 # Changelog 1 # Changelog
2 2
  3 +## 5.0.0-nullsafety.1
  4 +
  5 +- Fix PdfPreview default locale
  6 +
3 ## 5.0.0-nullsafety.0 7 ## 5.0.0-nullsafety.0
4 8
5 - Remove useless files 9 - Remove useless files
@@ -169,8 +169,8 @@ class _PdfPreviewState extends State<PdfPreview> { @@ -169,8 +169,8 @@ class _PdfPreviewState extends State<PdfPreview> {
169 void initState() { 169 void initState() {
170 if (widget.initialPageFormat == null) { 170 if (widget.initialPageFormat == null) {
171 final locale = WidgetsBinding.instance!.window.locale; 171 final locale = WidgetsBinding.instance!.window.locale;
172 - // ignore: invalid_null_aware_operator  
173 - final cc = locale?.countryCode ?? 'US'; 172 + // ignore: unnecessary_cast, avoid_as
  173 + final cc = (locale as Locale?)?.countryCode ?? 'US';
174 174
175 if (cc == 'US' || cc == 'CA' || cc == 'MX') { 175 if (cc == 'US' || cc == 'CA' || cc == 'MX') {
176 pageFormat = PdfPageFormat.letter; 176 pageFormat = PdfPageFormat.letter;
@@ -4,7 +4,7 @@ description: Plugin that allows Flutter apps to generate and print documents to @@ -4,7 +4,7 @@ description: Plugin that allows Flutter apps to generate and print documents to
4 homepage: https://github.com/DavBfr/dart_pdf/tree/master/printing 4 homepage: https://github.com/DavBfr/dart_pdf/tree/master/printing
5 repository: https://github.com/DavBfr/dart_pdf 5 repository: https://github.com/DavBfr/dart_pdf
6 issue_tracker: https://github.com/DavBfr/dart_pdf/issues 6 issue_tracker: https://github.com/DavBfr/dart_pdf/issues
7 -version: 5.0.0-nullsafety.0 7 +version: 5.0.0-nullsafety.1
8 8
9 environment: 9 environment:
10 sdk: ">=2.12.0-0 <3.0.0" 10 sdk: ">=2.12.0-0 <3.0.0"