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
2021-04-23 06:44:54 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
45a9de7ec69dec81157e7379061a46ccdb52d6cb
45a9de7e
1 parent
594ca5d8
Fix Scrollbar positionning and default margins
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
printing/CHANGELOG.md
printing/lib/src/pdf_preview.dart
printing/CHANGELOG.md
View file @
45a9de7
...
...
@@ -3,6 +3,8 @@
## 5.2.0
-
Improve Android page format detection
[
Deepak
]
-
Add previewPageMargin and padding parameters
[
Deepak
]
-
Fix Scrollbar positionning and default margins
## 5.1.0
...
...
printing/lib/src/pdf_preview.dart
View file @
45a9de7
...
...
@@ -115,7 +115,7 @@ class PdfPreview extends StatefulWidget {
/// margin for the document preview page
///
/// defaults to [EdgeInsets.only(left:
8, top: 8, right: 8, bottom: 12,
)],
/// defaults to [EdgeInsets.only(left:
20, top: 8, right: 20, bottom: 12
)],
final
EdgeInsets
?
previewPageMargin
;
/// padding for the pdf_preview widget
...
...
@@ -146,7 +146,9 @@ class _PdfPreviewState extends State<PdfPreview> {
double
?
updatePosition
;
final
scrollController
=
ScrollController
();
final
scrollController
=
ScrollController
(
keepScrollOffset:
true
,
);
final
transformationController
=
TransformationController
();
...
...
@@ -355,8 +357,7 @@ class _PdfPreviewState extends State<PdfPreview> {
return
const
Center
(
child:
CircularProgressIndicator
());
}
return
Scrollbar
(
child:
ListView
.
builder
(
return
ListView
.
builder
(
controller:
scrollController
,
padding:
widget
.
padding
,
itemCount:
pages
.
length
,
...
...
@@ -370,7 +371,6 @@ class _PdfPreviewState extends State<PdfPreview> {
},
child:
pages
[
index
],
),
),
);
}
...
...
@@ -554,7 +554,10 @@ class _PdfPreviewState extends State<PdfPreview> {
return
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Expanded
(
child:
scrollView
),
Expanded
(
child:
scrollController
.
hasClients
?
Scrollbar
(
controller:
scrollController
,
child:
scrollView
)
:
scrollView
),
if
(
actions
.
isNotEmpty
&&
widget
.
useActions
)
Material
(
elevation:
4
,
...
...
@@ -568,6 +571,7 @@ class _PdfPreviewState extends State<PdfPreview> {
),
),
),
),
)
],
);
...
...
@@ -643,13 +647,18 @@ class _PdfPreviewPage extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
final
im
=
PdfRasterImage
(
page
!);
final
scrollbarTrack
=
Theme
.
of
(
context
)
.
scrollbarTheme
.
thickness
?.
resolve
({
MaterialState
.
hovered
})
??
12
;
return
Container
(
margin:
pageMargin
??
const
EdgeInsets
.
only
(
left:
8
,
EdgeInsets
.
only
(
left:
8
+
scrollbarTrack
,
top:
8
,
right:
8
,
right:
8
+
scrollbarTrack
,
bottom:
12
,
),
decoration:
pdfPreviewPageDecoration
??
...
...
Please
register
or
login
to post a comment