@@ -102,6 +102,8 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
102
102
@override
103
103
Widget build (BuildContext context) {
104
104
final ThemeData theme = Theme .of (context);
105
+ final AppBarTheme appBarTheme = theme.appBarTheme;
106
+
105
107
final Widget ? titleWidget;
106
108
if (centerTitle) {
107
109
titleWidget = Center (child: title);
@@ -118,7 +120,10 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
118
120
PositionedDirectional (
119
121
top: 0.0 ,
120
122
bottom: 0.0 ,
121
- child: leading ?? const BackButton (),
123
+ child: IconTheme .merge (
124
+ data: appBarTheme.iconTheme ?? theme.iconTheme,
125
+ child: leading ?? const BackButton (),
126
+ ),
122
127
),
123
128
if (titleWidget != null )
124
129
PositionedDirectional (
@@ -131,7 +136,8 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
131
136
? Alignment .center
132
137
: AlignmentDirectional .centerStart,
133
138
child: DefaultTextStyle (
134
- style: theme.textTheme.titleLarge! .copyWith (fontSize: 23.0 ),
139
+ style: appBarTheme.titleTextStyle ??
140
+ theme.textTheme.titleLarge! .copyWith (fontSize: 23.0 ),
135
141
maxLines: 1 ,
136
142
softWrap: false ,
137
143
overflow: TextOverflow .ellipsis,
@@ -146,9 +152,15 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
146
152
top: 0.0 ,
147
153
end: 0.0 ,
148
154
height: _barHeight,
149
- child: Padding (
150
- padding: actionsPadding ?? EdgeInsets .zero,
151
- child: Row (mainAxisSize: MainAxisSize .min, children: actions! ),
155
+ child: IconTheme .merge (
156
+ data: appBarTheme.actionsIconTheme ?? theme.iconTheme,
157
+ child: Padding (
158
+ padding: actionsPadding ?? EdgeInsets .zero,
159
+ child: Row (
160
+ mainAxisSize: MainAxisSize .min,
161
+ children: actions! ,
162
+ ),
163
+ ),
152
164
),
153
165
),
154
166
],
@@ -172,20 +184,19 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
172
184
);
173
185
}
174
186
175
- final AppBarTheme appBarTheme = theme.appBarTheme;
176
-
177
187
/// Apply the icon theme data.
178
188
child = IconTheme .merge (
179
189
data: iconTheme ?? appBarTheme.iconTheme ?? theme.iconTheme,
180
190
child: child,
181
191
);
182
192
183
193
// Set [SystemUiOverlayStyle] according to the brightness.
194
+ final Color effectiveBackgroundColor = backgroundColor ??
195
+ appBarTheme.backgroundColor ??
196
+ theme.colorScheme.surface;
184
197
final Brightness effectiveBrightness = brightness ??
185
198
appBarTheme.systemOverlayStyle? .statusBarBrightness ??
186
199
theme.brightness;
187
- final Color effectiveBackgroundColor =
188
- backgroundColor ?? theme.colorScheme.surface;
189
200
final SystemUiOverlayStyle overlayStyle = appBarTheme.systemOverlayStyle ??
190
201
SystemUiOverlayStyle (
191
202
statusBarColor: effectiveBackgroundColor,
@@ -199,7 +210,7 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
199
210
);
200
211
201
212
final Widget result = Material (
202
- // Wrap to ensure the child rendered correctly
213
+ // Wrap to ensure the child rendered correctly.
203
214
color: Color .lerp (
204
215
effectiveBackgroundColor,
205
216
Colors .transparent,
@@ -209,7 +220,11 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
209
220
child: child,
210
221
);
211
222
return semanticsBuilder? .call (result) ??
212
- Semantics (sortKey: const OrdinalSortKey (0 ), child: result);
223
+ Semantics (
224
+ sortKey: const OrdinalSortKey (0 ),
225
+ explicitChildNodes: true ,
226
+ child: result,
227
+ );
213
228
}
214
229
}
215
230
0 commit comments