You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds new theme properties to CheckoutTheme (paymentItemBackgroundColor, paymentItemDescriptionTextColor, selectorIconColor, savePhoneNumberIconColor, font selection for buttons) and wires them through the Android and iOS native layers. The Flutter-side changes look structurally sound, but there are several bugs and incomplete implementations that need attention before merging.
Bugs
1. ColorState.copyWith has inverted colorDisabled logic
checkout_theme.dart:188:
ColorStatecopyWith({Color? color, Color? colorDisabled}) {
returnColorState(
color: color ??this.color,
colorDisabled:this.colorDisabled ?? colorDisabled // ← BUG: should be colorDisabled ?? this.colorDisabled
);
}
The colorDisabled argument is silently ignored whenever this.colorDisabled is already set. Any call to copyWith(colorDisabled: newColor) on an instance that already has a colorDisabled value will produce the wrong result. Fix this →
2. iOS SwitchComponent.toCheckoutSwitch() is incomplete
ext.swift:237-255: Only checkedThumbTintColor is mapped — the other 5 properties (uncheckedThumbTintColor, checkedTrackTintColor, etc.) are dropped via a large commented-out block. This creates a silent Android/iOS divergence where Android applies all 6 switch colors and iOS only applies 1. The commented-out code shows this was never finished.
3. iOS TextFieldStyle.toCheckoutTextField() is incomplete
ext.swift:149-174: primaryColor, focusedColor, and error text styling are all commented out. Only text.textColor is partially applied. The Android equivalent maps all 5 fields. Again a silent platform divergence.
4. savePhoneNumberIconColor silently discarded on iOS
CheckoutPlatformView.swift:370-374:
iflet color = theme?.savePhoneNumberIconColor?.toUIColors(){iflet cc = color.color {
//cht.savePhoneNumberIconColor = cc ← commented out, never applied
}}
The color is parsed but then thrown away. This property has no effect on iOS. (Note: selectorIconColor has a similar redundant block at line 376 but is correctly applied at line 410.)
5. paymentItemDescriptionTextColor missing from Android appearanceDark
CheckoutView.kt:331-360: The appearanceDark block is an almost-exact copy of appearanceLight, but paymentItemDescriptionTextColor is omitted from dark mode. This means setting this color will have no effect when the device is in dark mode on Android.
6. Font family name transformation inconsistency between platforms
Extensions.kt:89: Android converts spaces to underscores ("My Font" → "my_font") ext.swift:225: iOS converts spaces to hyphens ("My Font" → "My-Font")
The same theme JSON will resolve to different font resource names on each platform, making custom font selection unreliable. One or both platforms needs to be corrected to use the same convention.
Code Quality
7. Unguarded println in production code
Extensions.kt:90:
println("findFontResId, with name: $sanitized")
No debug/release guard. This will appear in production logcat for every font resolution call.
8. Dead code: String.toUIColor() nil check on non-optional
ext.swift:31-39: self != nil on a non-optional String is always true. This extension is either dead code or the guard is meaningless. Should be removed or simplified.
9. Large commented-out Color extension
ext.swift:114-147: ~35 lines of commented-out Color extension code should be removed rather than left as dead code in the repository.
10. TextStyle name shadows Flutter's built-in TextStyle
checkout_theme.dart:220: The local class TextStyle shadows flutter/material.dart's TextStyle. Since this file imports flutter/material.dart, any future code mixing the two types will be confusing and error-prone. Consider renaming to CheckoutTextStyle or similar.
11. BrandingPaymentMethods constructor missing tamara and jamiawallet
branding_options_request.dart:43-54: Both fields are declared but excluded from the constructor. They're mutable and set post-construction in home_screen_cubit.dart, but a complete constructor would be more consistent.
Android: Dark Mode Appearance is Identical to Light Mode
CheckoutView.kt:300-360: The appearanceDark block is a copy of appearanceLight with no separate dark-mode colors wired up. There is currently no way for a merchant to set different colors for dark mode vs. light mode — both appearances will always receive the same values. This may be intentional as a placeholder, but if so, it should be documented or the duplication should be eliminated.
Minor
pubspec.yaml SDK constraint bumped from ^3.6.0 to ^3.8.0 — confirm this is actually required by new code and not an accidental bump.
Sample/pubspec.yaml bumped to ^3.10.0 with Flutter >=3.38.0 — Flutter 3.38.0 is a very recent version constraint for a sample app that may limit contributors' ability to run it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@jab3z ready for review MS-503MS-503