Committed by
David PHAM-VAN
Apply additional `Wrap` properties
Showing
2 changed files
with
20 additions
and
2 deletions
@@ -8,8 +8,10 @@ class PdfActionBarTheme with Diagnosticable { | @@ -8,8 +8,10 @@ class PdfActionBarTheme with Diagnosticable { | ||
8 | this.iconColor, | 8 | this.iconColor, |
9 | this.height, | 9 | this.height, |
10 | this.textStyle, | 10 | this.textStyle, |
11 | - this.elevation = 4, | 11 | + this.elevation = 4.0, |
12 | + this.actionSpacing = 0.0, | ||
12 | this.alignment = WrapAlignment.spaceAround, | 13 | this.alignment = WrapAlignment.spaceAround, |
14 | + this.runAlignment = WrapAlignment.center, | ||
13 | this.crossAxisAlignment = WrapCrossAlignment.center, | 15 | this.crossAxisAlignment = WrapCrossAlignment.center, |
14 | }); | 16 | }); |
15 | 17 | ||
@@ -18,7 +20,9 @@ class PdfActionBarTheme with Diagnosticable { | @@ -18,7 +20,9 @@ class PdfActionBarTheme with Diagnosticable { | ||
18 | final double? height; | 20 | final double? height; |
19 | final TextStyle? textStyle; | 21 | final TextStyle? textStyle; |
20 | final double elevation; | 22 | final double elevation; |
23 | + final double actionSpacing; | ||
21 | final WrapAlignment alignment; | 24 | final WrapAlignment alignment; |
25 | + final WrapAlignment runAlignment; | ||
22 | final WrapCrossAlignment crossAxisAlignment; | 26 | final WrapCrossAlignment crossAxisAlignment; |
23 | 27 | ||
24 | /// Creates a copy of this object but with the given fields replaced with the | 28 | /// Creates a copy of this object but with the given fields replaced with the |
@@ -29,7 +33,9 @@ class PdfActionBarTheme with Diagnosticable { | @@ -29,7 +33,9 @@ class PdfActionBarTheme with Diagnosticable { | ||
29 | double? height, | 33 | double? height, |
30 | TextStyle? textStyle, | 34 | TextStyle? textStyle, |
31 | double? elevation, | 35 | double? elevation, |
36 | + double? actionSpacing, | ||
32 | WrapAlignment? alignment, | 37 | WrapAlignment? alignment, |
38 | + WrapAlignment? runAlignment, | ||
33 | WrapCrossAlignment? crossAxisAlignment, | 39 | WrapCrossAlignment? crossAxisAlignment, |
34 | }) { | 40 | }) { |
35 | return PdfActionBarTheme( | 41 | return PdfActionBarTheme( |
@@ -38,7 +44,9 @@ class PdfActionBarTheme with Diagnosticable { | @@ -38,7 +44,9 @@ class PdfActionBarTheme with Diagnosticable { | ||
38 | height: height ?? this.height, | 44 | height: height ?? this.height, |
39 | textStyle: textStyle ?? this.textStyle, | 45 | textStyle: textStyle ?? this.textStyle, |
40 | elevation: elevation ?? this.elevation, | 46 | elevation: elevation ?? this.elevation, |
47 | + actionSpacing: actionSpacing ?? this.actionSpacing, | ||
41 | alignment: alignment ?? this.alignment, | 48 | alignment: alignment ?? this.alignment, |
49 | + runAlignment: runAlignment ?? this.runAlignment, | ||
42 | crossAxisAlignment: crossAxisAlignment ?? this.crossAxisAlignment, | 50 | crossAxisAlignment: crossAxisAlignment ?? this.crossAxisAlignment, |
43 | ); | 51 | ); |
44 | } | 52 | } |
@@ -50,8 +58,10 @@ class PdfActionBarTheme with Diagnosticable { | @@ -50,8 +58,10 @@ class PdfActionBarTheme with Diagnosticable { | ||
50 | height, | 58 | height, |
51 | textStyle, | 59 | textStyle, |
52 | elevation, | 60 | elevation, |
61 | + actionSpacing, | ||
53 | alignment, | 62 | alignment, |
54 | - crossAxisAlignment | 63 | + runAlignment, |
64 | + crossAxisAlignment, | ||
55 | ]); | 65 | ]); |
56 | 66 | ||
57 | @override | 67 | @override |
@@ -68,7 +78,9 @@ class PdfActionBarTheme with Diagnosticable { | @@ -68,7 +78,9 @@ class PdfActionBarTheme with Diagnosticable { | ||
68 | other.height == height && | 78 | other.height == height && |
69 | other.textStyle == textStyle && | 79 | other.textStyle == textStyle && |
70 | other.elevation == elevation && | 80 | other.elevation == elevation && |
81 | + other.actionSpacing == actionSpacing && | ||
71 | other.alignment == alignment && | 82 | other.alignment == alignment && |
83 | + other.runAlignment == runAlignment && | ||
72 | other.crossAxisAlignment == crossAxisAlignment; | 84 | other.crossAxisAlignment == crossAxisAlignment; |
73 | } | 85 | } |
74 | 86 | ||
@@ -80,8 +92,12 @@ class PdfActionBarTheme with Diagnosticable { | @@ -80,8 +92,12 @@ class PdfActionBarTheme with Diagnosticable { | ||
80 | properties.add(DoubleProperty('height', height)); | 92 | properties.add(DoubleProperty('height', height)); |
81 | properties.add(DiagnosticsProperty<TextStyle>('textStyle', textStyle)); | 93 | properties.add(DiagnosticsProperty<TextStyle>('textStyle', textStyle)); |
82 | properties.add(DoubleProperty('elevation', elevation)); | 94 | properties.add(DoubleProperty('elevation', elevation)); |
95 | + properties.add(DoubleProperty('actionSpacing', actionSpacing)); | ||
83 | properties.add(DiagnosticsProperty<WrapAlignment>('alignment', alignment, | 96 | properties.add(DiagnosticsProperty<WrapAlignment>('alignment', alignment, |
84 | defaultValue: WrapAlignment.spaceAround)); | 97 | defaultValue: WrapAlignment.spaceAround)); |
98 | + properties.add(DiagnosticsProperty<WrapAlignment>( | ||
99 | + 'runAlignment', runAlignment, | ||
100 | + defaultValue: WrapAlignment.center)); | ||
85 | properties.add(DiagnosticsProperty<WrapCrossAlignment>( | 101 | properties.add(DiagnosticsProperty<WrapCrossAlignment>( |
86 | 'crossAxisAlignment', crossAxisAlignment, | 102 | 'crossAxisAlignment', crossAxisAlignment, |
87 | defaultValue: WrapCrossAlignment.center)); | 103 | defaultValue: WrapCrossAlignment.center)); |
@@ -424,7 +424,9 @@ class PdfPreviewState extends State<PdfPreview> { | @@ -424,7 +424,9 @@ class PdfPreviewState extends State<PdfPreview> { | ||
424 | height: widget.actionBarTheme.height, | 424 | height: widget.actionBarTheme.height, |
425 | child: SafeArea( | 425 | child: SafeArea( |
426 | child: Wrap( | 426 | child: Wrap( |
427 | + spacing: widget.actionBarTheme.actionSpacing, | ||
427 | alignment: widget.actionBarTheme.alignment, | 428 | alignment: widget.actionBarTheme.alignment, |
429 | + runAlignment: widget.actionBarTheme.runAlignment, | ||
428 | crossAxisAlignment: | 430 | crossAxisAlignment: |
429 | widget.actionBarTheme.crossAxisAlignment, | 431 | widget.actionBarTheme.crossAxisAlignment, |
430 | children: actions, | 432 | children: actions, |
-
Please register or login to post a comment