mirror of
https://github.com/foss42/apidash.git
synced 2025-06-06 19:38:58 +08:00
Update platform_specific_instructions.md
This commit is contained in:
@ -44,16 +44,21 @@ For more information on multidex support, you can refer to the Android developer
|
|||||||
|
|
||||||
### Web
|
### Web
|
||||||
|
|
||||||
If you're building a Flutter app for the web using the `printing` package, you may encounter a build error like:
|
If you're building a Flutter app for the web, you may encounter a build error like:
|
||||||
|
|
||||||
```
|
```
|
||||||
Error: A value of type 'JSString' can't be assigned to a variable of type 'String'.
|
Launching lib/main.dart on Chrome in debug mode...
|
||||||
|
../../../.pub-cache/hosted/pub.dev/printing-5.13.4/lib/printing_web.dart:218:16: Error:
|
||||||
|
A value of type 'JSString' can't be assigned to a variable of type 'String'.
|
||||||
|
.toJS;
|
||||||
|
^
|
||||||
|
Failed to compile application.
|
||||||
```
|
```
|
||||||
|
|
||||||
This happens because `.toJS` is no longer required for converting Dart strings to JavaScript strings in recent Dart versions.
|
This happens because `.toJS` is no longer required for converting Dart strings to JavaScript strings in recent Dart versions.
|
||||||
|
|
||||||
**Fix:**
|
**Fix:**
|
||||||
Update the `printing_web.dart` file in the `printing` package by removing `.toJS` from:
|
Update the `printing_web.dart` file in the cached `printing` package by removing `.toJS` as done in the PR [here](https://github.com/DavBfr/dart_pdf/pull/1739/files)
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
script.innerHTML =
|
script.innerHTML =
|
||||||
@ -67,5 +72,4 @@ script.innerHTML =
|
|||||||
'''function ${_frameId}_print(){var f=document.getElementById('$_frameId');f.focus();f.contentWindow.print();}''';
|
'''function ${_frameId}_print(){var f=document.getElementById('$_frameId');f.focus();f.contentWindow.print();}''';
|
||||||
```
|
```
|
||||||
|
|
||||||
This fix ensures compatibility with the latest Dart runtime. For more details, refer to [GitHub Issue #1791](https://github.com/DavBfr/dart_pdf/issues/1791).
|
|
||||||
Read more about it here - https://github.com/DavBfr/dart_pdf/issues/1791
|
Read more about it here - https://github.com/DavBfr/dart_pdf/issues/1791
|
||||||
|
Reference in New Issue
Block a user