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
2023-12-22 11:31:08 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
David PHAM-VAN
2024-01-27 12:11:28 -0400
Commit
692e61dbb04677fe771d4a0e00e469f310ec3b50
692e61db
1 parent
4348f87c
Implement `crossAxisAlignment` for actions
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
printing/lib/src/preview/action_bar_theme.dart
printing/lib/src/preview/pdf_preview.dart
printing/lib/src/preview/action_bar_theme.dart
View file @
692e61d
...
...
@@ -10,6 +10,7 @@ class PdfActionBarTheme with Diagnosticable {
this
.
textStyle
,
this
.
elevation
=
4
,
this
.
alignment
=
WrapAlignment
.
spaceAround
,
this
.
crossAxisAlignment
=
WrapCrossAlignment
.
center
,
});
final
Color
?
backgroundColor
;
...
...
@@ -18,6 +19,7 @@ class PdfActionBarTheme with Diagnosticable {
final
TextStyle
?
textStyle
;
final
double
elevation
;
final
WrapAlignment
alignment
;
final
WrapCrossAlignment
crossAxisAlignment
;
/// Creates a copy of this object but with the given fields replaced with the
/// new values.
...
...
@@ -28,6 +30,7 @@ class PdfActionBarTheme with Diagnosticable {
TextStyle
?
textStyle
,
double
?
elevation
,
WrapAlignment
?
alignment
,
WrapCrossAlignment
?
crossAxisAlignment
,
})
{
return
PdfActionBarTheme
(
backgroundColor:
backgroundColor
??
this
.
backgroundColor
,
...
...
@@ -36,12 +39,20 @@ class PdfActionBarTheme with Diagnosticable {
textStyle:
textStyle
??
this
.
textStyle
,
elevation:
elevation
??
this
.
elevation
,
alignment:
alignment
??
this
.
alignment
,
crossAxisAlignment:
crossAxisAlignment
??
this
.
crossAxisAlignment
,
);
}
@override
int
get
hashCode
=>
Object
.
hashAll
(
[
backgroundColor
,
iconColor
,
height
,
textStyle
,
elevation
,
alignment
]);
int
get
hashCode
=>
Object
.
hashAll
([
backgroundColor
,
iconColor
,
height
,
textStyle
,
elevation
,
alignment
,
crossAxisAlignment
]);
@override
bool
operator
==(
Object
other
)
{
...
...
@@ -57,7 +68,8 @@ class PdfActionBarTheme with Diagnosticable {
other
.
height
==
height
&&
other
.
textStyle
==
textStyle
&&
other
.
elevation
==
elevation
&&
other
.
alignment
==
alignment
;
other
.
alignment
==
alignment
&&
other
.
crossAxisAlignment
==
crossAxisAlignment
;
}
@override
...
...
@@ -70,5 +82,8 @@ class PdfActionBarTheme with Diagnosticable {
properties
.
add
(
DoubleProperty
(
'elevation'
,
elevation
));
properties
.
add
(
DiagnosticsProperty
<
WrapAlignment
>(
'alignment'
,
alignment
,
defaultValue:
WrapAlignment
.
spaceAround
));
properties
.
add
(
DiagnosticsProperty
<
WrapCrossAlignment
>(
'crossAxisAlignment'
,
crossAxisAlignment
,
defaultValue:
WrapCrossAlignment
.
center
));
}
}
...
...
printing/lib/src/preview/pdf_preview.dart
View file @
692e61d
...
...
@@ -425,6 +425,8 @@ class PdfPreviewState extends State<PdfPreview> {
child:
SafeArea
(
child:
Wrap
(
alignment:
widget
.
actionBarTheme
.
alignment
,
crossAxisAlignment:
widget
.
actionBarTheme
.
crossAxisAlignment
,
children:
actions
,
),
),
...
...
Please
register
or
login
to post a comment