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
Aleksei
2024-01-19 17:23:57 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
David PHAM-VAN
2024-01-27 12:11:28 -0400
Commit
9599e41dcf4b337c87738c69be9797588d1974b7
9599e41d
1 parent
1b9e77e5
Init pages keys after `pages` is populated
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
printing/lib/src/preview/custom.dart
printing/lib/src/preview/custom.dart
View file @
9599e41
...
...
@@ -110,7 +110,7 @@ class PdfPreviewCustomState extends State<PdfPreviewCustom>
with
PdfPreviewRaster
{
final
listView
=
GlobalKey
();
late
List
<
GlobalKey
>
_pageGlobalKeys
;
late
final
List
<
GlobalKey
>
_pageGlobalKeys
;
bool
infoLoaded
=
false
;
...
...
@@ -174,15 +174,6 @@ class PdfPreviewCustomState extends State<PdfPreviewCustom>
super
.
didChangeDependencies
();
}
@override
void
initState
()
{
super
.
initState
();
_pageGlobalKeys
=
List
.
generate
(
pages
.
length
,
(
index
)
=>
GlobalKey
(
debugLabel:
'pdf-page-
$index
'
),
);
}
void
scrollToPage
(
int
index
,
{
Duration
duration
=
Duration
.
zero
,
...
...
@@ -221,9 +212,15 @@ class PdfPreviewCustomState extends State<PdfPreviewCustom>
);
}
_pageGlobalKeys
=
List
.
generate
(
pages
.
length
,
(
index
)
=>
GlobalKey
(
debugLabel:
'pdf-page-
$index
'
),
);
if
(
widget
.
pagesBuilder
!=
null
)
{
return
widget
.
pagesBuilder
!(
context
,
pages
);
}
return
ListView
.
builder
(
controller:
scrollController
,
shrinkWrap:
widget
.
shrinkWrap
,
...
...
Please
register
or
login
to post a comment