Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
dart_pdf
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
David PHAM-VAN
2023-05-11 10:06:02 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c2f7b27ccfdbc39d906bf11fd7b827a8b9aa47f6
c2f7b27c
1 parent
f29c3b9f
Fix web builds with Flutter 3.10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
printing/CHANGELOG.md
printing/lib/printing_web.dart
printing/CHANGELOG.md
View file @
c2f7b27
...
...
@@ -3,6 +3,7 @@
## 5.11.0
-
Set Flutter 3.10 as the minimum version
-
Fix web builds with Flutter 3.10
## 5.10.4
...
...
printing/lib/printing_web.dart
View file @
c2f7b27
...
...
@@ -67,6 +67,8 @@ class PrintingPlugin extends PrintingPlatform {
if
(!
_hasPdfJsLib
)
{
dynamic
amd
;
dynamic
define
;
dynamic
module
;
dynamic
exports
;
if
(
js
.
context
[
'define'
]
!=
null
)
{
// In dev, requireJs is loaded in. Disable it here.
define
=
js
.
JsObject
.
fromBrowserObject
(
js
.
context
[
'define'
]);
...
...
@@ -74,6 +76,17 @@ class PrintingPlugin extends PrintingPlatform {
define
[
'amd'
]
=
false
;
}
// Save Webpack values and make typeof module != object
if
(
js
.
context
[
'exports'
]
!=
null
)
{
exports
=
js
.
JsObject
.
fromBrowserObject
(
js
.
context
[
'exports'
]);
}
js
.
context
[
'exports'
]
=
0
;
if
(
js
.
context
[
'module'
]
!=
null
)
{
module
=
js
.
JsObject
.
fromBrowserObject
(
js
.
context
[
'module'
]);
}
js
.
context
[
'module'
]
=
0
;
final
script
=
ScriptElement
()
..
type
=
'text/javascript'
..
async
=
true
...
...
@@ -89,6 +102,14 @@ class PrintingPlugin extends PrintingPlatform {
js
.
context
[
'pdfjsLib'
][
'GlobalWorkerOptions'
][
'workerSrc'
]
=
'
$_pdfJsUrlBase
/build/pdf.worker.min.js'
;
// Restore module and exports
if
(
module
!=
null
)
{
js
.
context
[
'module'
]
=
module
;
}
if
(
exports
!=
null
)
{
js
.
context
[
'exports'
]
=
exports
;
}
}
_loading
.
release
();
...
...
Please
register
or
login
to post a comment