@@ -102,6 +102,8 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
102102 @override
103103 Widget build (BuildContext context) {
104104 final ThemeData theme = Theme .of (context);
105+ final AppBarTheme appBarTheme = theme.appBarTheme;
106+
105107 final Widget ? titleWidget;
106108 if (centerTitle) {
107109 titleWidget = Center (child: title);
@@ -118,7 +120,10 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
118120 PositionedDirectional (
119121 top: 0.0 ,
120122 bottom: 0.0 ,
121- child: leading ?? const BackButton (),
123+ child: IconTheme .merge (
124+ data: appBarTheme.iconTheme ?? theme.iconTheme,
125+ child: leading ?? const BackButton (),
126+ ),
122127 ),
123128 if (titleWidget != null )
124129 PositionedDirectional (
@@ -131,7 +136,8 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
131136 ? Alignment .center
132137 : AlignmentDirectional .centerStart,
133138 child: DefaultTextStyle (
134- style: theme.textTheme.titleLarge! .copyWith (fontSize: 23.0 ),
139+ style: appBarTheme.titleTextStyle ??
140+ theme.textTheme.titleLarge! .copyWith (fontSize: 23.0 ),
135141 maxLines: 1 ,
136142 softWrap: false ,
137143 overflow: TextOverflow .ellipsis,
@@ -146,9 +152,15 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
146152 top: 0.0 ,
147153 end: 0.0 ,
148154 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+ ),
152164 ),
153165 ),
154166 ],
@@ -172,20 +184,19 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
172184 );
173185 }
174186
175- final AppBarTheme appBarTheme = theme.appBarTheme;
176-
177187 /// Apply the icon theme data.
178188 child = IconTheme .merge (
179189 data: iconTheme ?? appBarTheme.iconTheme ?? theme.iconTheme,
180190 child: child,
181191 );
182192
183193 // Set [SystemUiOverlayStyle] according to the brightness.
194+ final Color effectiveBackgroundColor = backgroundColor ??
195+ appBarTheme.backgroundColor ??
196+ theme.colorScheme.surface;
184197 final Brightness effectiveBrightness = brightness ??
185198 appBarTheme.systemOverlayStyle? .statusBarBrightness ??
186199 theme.brightness;
187- final Color effectiveBackgroundColor =
188- backgroundColor ?? theme.colorScheme.surface;
189200 final SystemUiOverlayStyle overlayStyle = appBarTheme.systemOverlayStyle ??
190201 SystemUiOverlayStyle (
191202 statusBarColor: effectiveBackgroundColor,
@@ -199,7 +210,7 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
199210 );
200211
201212 final Widget result = Material (
202- // Wrap to ensure the child rendered correctly
213+ // Wrap to ensure the child rendered correctly.
203214 color: Color .lerp (
204215 effectiveBackgroundColor,
205216 Colors .transparent,
@@ -209,7 +220,11 @@ class AssetPickerAppBar extends StatelessWidget implements PreferredSizeWidget {
209220 child: child,
210221 );
211222 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+ );
213228 }
214229}
215230
0 commit comments