File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,14 @@ Future<void> createColors({
171171 final androidValuesFolder = isDark
172172 ? CmdStrings .androidDarkValuesDirectory
173173 : CmdStrings .androidValuesDirectory;
174+
175+ /// Create the directory if it doesn't exist (needed for values-night)
176+ final directory = Directory (androidValuesFolder);
177+ if (! await directory.exists ()) {
178+ await directory.create (recursive: true );
179+ log ('Created $androidValuesFolder directory' );
180+ }
181+
174182 final colorsFilePath = '$androidValuesFolder /${AndroidStrings .colorXml }' ;
175183
176184 final xmlFile = File (colorsFilePath);
@@ -304,13 +312,14 @@ Future<void> createAndroid12Styles({
304312 },
305313 nest: () {
306314 /// Creating a item element for color
315+ /// Use color reference from colors.xml so Android uses light/dark mode colors
307316 if (color != null ) {
308317 builder.element (
309318 AndroidStrings .itemElement,
310319 attributes: {
311320 AndroidStrings .nameAttr: AndroidStrings .windowSplashScreenBG,
312321 },
313- nest: color ,
322+ nest: AndroidStrings .androidDrawableAttrVal ,
314323 );
315324 }
316325
You can’t perform that action at this time.
0 commit comments