Skip to content

fix:🐛️ sync iOS storyboard resources, keep Android generation on iOS-only warnings, and default Android light splash to white#91

Merged
apurva010 merged 2 commits intofeature/dark-theme-supportfrom
fix/ios-resource-gen-update
Apr 14, 2026
Merged

fix:🐛️ sync iOS storyboard resources, keep Android generation on iOS-only warnings, and default Android light splash to white#91
apurva010 merged 2 commits intofeature/dark-theme-supportfrom
fix/ios-resource-gen-update

Conversation

@lavigarg-simform
Copy link
Copy Markdown
Contributor

@lavigarg-simform lavigarg-simform commented Apr 13, 2026

Description

This PR improves splash generation reliability across iOS and Android in three areas:

  1. iOS storyboard resource generation is now aggressively synchronized with the actual splash configuration.
  2. iOS-only dark asset constraints are reported as warnings, and Android generation continues instead of aborting.
  3. Android light mode now defaults to a white background when color is not provided, preventing black launch screens.

What Changed

1) iOS storyboard resource sync

  • Added a dedicated storyboard resource sync step after content updates.
  • Ensures resources is created when needed.
  • Removes stale managed image resource entries (launch/background) before re-adding valid ones.
  • Adds launch/background image resources only when configured.
  • Removes resources entirely if no managed image resources remain.
  • Added colorSpace="custom" in generated storyboard color attributes for better consistency.

2) iOS warnings without blocking Android

  • Replaced hard-stop validation for iOS dark-only asset cases with warning logs.
  • If iOS requirements are incomplete (for example image_dark without image), iOS generation is skipped with clear reasons.
  • Android generation continues in the same run.

3) Android light fallback to white

  • When splash_master.color is omitted, Android now uses #FFFFFF as the light-mode fallback.
  • Applies to generated light splash resources so launch no longer defaults to black.

Why

  • Prevents stale or mismatched iOS LaunchScreen resource references across repeated runs.
  • Improves DX by allowing Android output even when iOS-only configuration is incomplete.
  • Aligns Android light default behavior with expected white splash behavior when color is omitted.

Validation

  • Generated splash resources with dark-only iOS and Android inputs:
    • iOS: warnings shown and generation skipped as expected.
    • Android: resources still generated successfully.
  • Verified Android light-mode resource output includes white fallback when no light color is configured.
  • Verified dark-only Android image paths are handled without missing drawable failures.

Breaking Change?

  • No

Related Issues

  • None

@lavigarg-simform lavigarg-simform marked this pull request as ready for review April 13, 2026 07:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the idempotency and correctness of iOS LaunchScreen.storyboard updates during splash generation by explicitly synchronizing <resources> image entries and tightening color attribute output.

Changes:

  • Adds a dedicated synchronization step to keep storyboard <resources> image entries aligned with the configured launch/background images.
  • Ensures stale managed image resources are removed before re-adding only the valid/required ones (and removes <resources> if none remain).
  • Adds colorSpace="custom" to generated inline storyboard color attributes for improved consistency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/cmd/ios_splash.dart Outdated
@lavigarg-simform lavigarg-simform force-pushed the fix/ios-resource-gen-update branch from ac4761b to 7791d92 Compare April 13, 2026 07:50
…only warnings, and default Android light splash to white
@lavigarg-simform lavigarg-simform force-pushed the fix/ios-resource-gen-update branch from 7791d92 to de17227 Compare April 13, 2026 12:25
@lavigarg-simform lavigarg-simform changed the title fix:🐛️ improve storyboard image resource handling fix:🐛️ sync iOS storyboard resources, keep Android generation on iOS-only warnings, and default Android light splash to white Apr 13, 2026
Comment thread lib/cmd/command_line.dart Outdated
Comment thread lib/cmd/command_line.dart Outdated
Comment thread lib/cmd/command_line.dart

if (iosSkipReasons.isNotEmpty) {
log('Skipping iOS splash generation: ${iosSkipReasons.join(' ')}');
log('Continuing with Android generation.');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check whether this Android generation log displays first and then Android generation starts.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes working as expected
Screenshot 2026-04-14 at 4 58 03 PM

Comment thread lib/cmd/ios_splash.dart
Comment thread lib/cmd/ios_splash.dart
Comment thread lib/cmd/ios_splash.dart
Comment thread lib/cmd/ios_splash.dart
/// Default storyboard image resource width metadata.
///
/// This is metadata for LaunchScreen.storyboard resources and not a layout size.
static const storyboardImageResourceWidth = '720';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check and confirm if this width and height is given then will it affect the content mode or not?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it will not affect the content miode. The resource width/height are asset metadata and only describe the image, they don't override the view's scaling behavior.

/// Default storyboard image resource height metadata.
///
/// This is metadata for LaunchScreen.storyboard resources and not a layout size.
static const storyboardImageResourceHeight = '1280';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@lavigarg-simform lavigarg-simform force-pushed the fix/ios-resource-gen-update branch 2 times, most recently from 9411c71 to c3cf77e Compare April 14, 2026 12:23
Comment thread lib/cmd/android_splash.dart Outdated
// `@drawable/splash_screen_dark` and points night styles to the light
// drawable instead so resource linking succeeds.
try {
const nightValuesPath =
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just asking, don't we need to add the condition above it to check whether the darkImage is provided or not? If not, then only fall back to a light means a drawable splash screen of light.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a code block in updateDarkStylesXml that will create or update the dark file if dark resources are present. so adding the condition here can save one unnecessary deletion but wont affect the final output

@lavigarg-simform lavigarg-simform force-pushed the fix/ios-resource-gen-update branch from c3cf77e to 879cf38 Compare April 14, 2026 13:05
@apurva010 apurva010 merged commit 1f5712a into feature/dark-theme-support Apr 14, 2026
@apurva010 apurva010 deleted the fix/ios-resource-gen-update branch April 14, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants