@@ -47,9 +47,11 @@ public AppBar(
47
47
Widget flexibleSpace = null ,
48
48
PreferredSizeWidget bottom = null ,
49
49
float ? elevation = null ,
50
+ ShapeBorder shape = null ,
50
51
Color backgroundColor = null ,
51
52
Brightness ? brightness = null ,
52
53
IconThemeData iconTheme = null ,
54
+ IconThemeData actionsIconTheme = null ,
53
55
TextTheme textTheme = null ,
54
56
bool primary = true ,
55
57
bool ? centerTitle = null ,
@@ -65,9 +67,11 @@ public AppBar(
65
67
this . flexibleSpace = flexibleSpace ;
66
68
this . bottom = bottom ;
67
69
this . elevation = elevation ;
70
+ this . shape = shape ;
68
71
this . backgroundColor = backgroundColor ;
69
72
this . brightness = brightness ;
70
73
this . iconTheme = iconTheme ;
74
+ this . actionsIconTheme = actionsIconTheme ;
71
75
this . textTheme = textTheme ;
72
76
this . primary = primary ;
73
77
this . centerTitle = centerTitle ;
@@ -91,12 +95,16 @@ public AppBar(
91
95
92
96
public readonly float ? elevation ;
93
97
98
+ public readonly ShapeBorder shape ;
99
+
94
100
public readonly Color backgroundColor ;
95
101
96
102
public readonly Brightness ? brightness ;
97
103
98
104
public readonly IconThemeData iconTheme ;
99
105
106
+ public readonly IconThemeData actionsIconTheme ;
107
+
100
108
public readonly TextTheme textTheme ;
101
109
102
110
public readonly bool primary ;
@@ -153,9 +161,12 @@ public override Widget build(BuildContext context) {
153
161
bool canPop = parentRoute ? . canPop ?? false ;
154
162
bool useCloseButton = parentRoute is PageRoute && ( ( PageRoute ) parentRoute ) . fullscreenDialog ;
155
163
156
- IconThemeData appBarIconTheme = this . widget . iconTheme
164
+ IconThemeData overallIconTheme = this . widget . iconTheme
157
165
?? appBarTheme . iconTheme
158
166
?? themeData . primaryIconTheme ;
167
+ IconThemeData actionsIconTheme = this . widget . actionsIconTheme
168
+ ?? appBarTheme . actionsIconTheme
169
+ ?? overallIconTheme ;
159
170
TextStyle centerStyle = this . widget . textTheme ? . title
160
171
?? appBarTheme . textTheme ? . title
161
172
?? themeData . primaryTextTheme . title ;
@@ -174,8 +185,11 @@ public override Widget build(BuildContext context) {
174
185
sideStyle = sideStyle . copyWith ( color : sideStyle . color . withOpacity ( opacity ) ) ;
175
186
}
176
187
177
- appBarIconTheme = appBarIconTheme . copyWith (
178
- opacity : opacity * ( appBarIconTheme . opacity ?? 1.0f )
188
+ overallIconTheme = overallIconTheme . copyWith (
189
+ opacity : opacity * ( overallIconTheme . opacity ?? 1.0f )
190
+ ) ;
191
+ actionsIconTheme = actionsIconTheme . copyWith (
192
+ opacity : opacity * ( actionsIconTheme . opacity ?? 1.0f )
179
193
) ;
180
194
}
181
195
@@ -223,6 +237,13 @@ public override Widget build(BuildContext context) {
223
237
tooltip : MaterialLocalizations . of ( context ) . openAppDrawerTooltip ) ;
224
238
}
225
239
240
+ if ( actions != null ) {
241
+ actions = IconTheme . merge (
242
+ data : actionsIconTheme ,
243
+ child : actions
244
+ ) ;
245
+ }
246
+
226
247
Widget toolbar = new NavigationToolbar (
227
248
leading : leading ,
228
249
middle : title ,
@@ -234,7 +255,7 @@ public override Widget build(BuildContext context) {
234
255
child : new CustomSingleChildLayout (
235
256
layoutDelegate : new _ToolbarContainerLayout ( ) ,
236
257
child : IconTheme . merge (
237
- data : appBarIconTheme ,
258
+ data : overallIconTheme ,
238
259
child : new DefaultTextStyle (
239
260
style : sideStyle ,
240
261
child : toolbar )
@@ -299,6 +320,7 @@ public override Widget build(BuildContext context) {
299
320
elevation : this . widget . elevation
300
321
?? appBarTheme . elevation
301
322
?? _defaultElevation ,
323
+ shape : this . widget . shape ,
302
324
child : appBar
303
325
) ) ;
304
326
}
@@ -379,6 +401,7 @@ public _SliverAppBarDelegate(
379
401
Color backgroundColor ,
380
402
Brightness ? brightness ,
381
403
IconThemeData iconTheme ,
404
+ IconThemeData actionsIconTheme ,
382
405
TextTheme textTheme ,
383
406
bool primary ,
384
407
bool ? centerTitle ,
@@ -402,6 +425,7 @@ FloatingHeaderSnapConfiguration snapConfiguration
402
425
this . backgroundColor = backgroundColor ;
403
426
this . brightness = brightness ;
404
427
this . iconTheme = iconTheme ;
428
+ this . actionsIconTheme = actionsIconTheme ;
405
429
this . textTheme = textTheme ;
406
430
this . primary = primary ;
407
431
this . centerTitle = centerTitle ;
@@ -426,6 +450,7 @@ FloatingHeaderSnapConfiguration snapConfiguration
426
450
public readonly Color backgroundColor ;
427
451
public readonly Brightness ? brightness ;
428
452
public readonly IconThemeData iconTheme ;
453
+ public readonly IconThemeData actionsIconTheme ;
429
454
public readonly TextTheme textTheme ;
430
455
public readonly bool primary ;
431
456
public readonly bool ? centerTitle ;
@@ -506,6 +531,7 @@ public override bool shouldRebuild(SliverPersistentHeaderDelegate _oldDelegate)
506
531
|| this . backgroundColor != oldDelegate . backgroundColor
507
532
|| this . brightness != oldDelegate . brightness
508
533
|| this . iconTheme != oldDelegate . iconTheme
534
+ || this . actionsIconTheme != oldDelegate . actionsIconTheme
509
535
|| this . textTheme != oldDelegate . textTheme
510
536
|| this . primary != oldDelegate . primary
511
537
|| this . centerTitle != oldDelegate . centerTitle
@@ -537,6 +563,7 @@ public SliverAppBar(
537
563
Color backgroundColor = null ,
538
564
Brightness ? brightness = null ,
539
565
IconThemeData iconTheme = null ,
566
+ IconThemeData actionsIconTheme = null ,
540
567
TextTheme textTheme = null ,
541
568
bool primary = true ,
542
569
bool ? centerTitle = null ,
@@ -558,6 +585,7 @@ public SliverAppBar(
558
585
this . backgroundColor = backgroundColor ;
559
586
this . brightness = brightness ;
560
587
this . iconTheme = iconTheme ;
588
+ this . actionsIconTheme = actionsIconTheme ;
561
589
this . textTheme = textTheme ;
562
590
this . primary = primary ;
563
591
this . centerTitle = centerTitle ;
@@ -590,6 +618,8 @@ public SliverAppBar(
590
618
public readonly Brightness ? brightness ;
591
619
592
620
public readonly IconThemeData iconTheme ;
621
+
622
+ public readonly IconThemeData actionsIconTheme ;
593
623
594
624
public readonly TextTheme textTheme ;
595
625
@@ -666,6 +696,7 @@ public override Widget build(BuildContext context) {
666
696
backgroundColor : this . widget . backgroundColor ,
667
697
brightness : this . widget . brightness ,
668
698
iconTheme : this . widget . iconTheme ,
699
+ actionsIconTheme : this . widget . actionsIconTheme ,
669
700
textTheme : this . widget . textTheme ,
670
701
primary : this . widget . primary ,
671
702
centerTitle : this . widget . centerTitle ,
0 commit comments