Appearance and Strings

Theme tokens, icons, copy and sizing for the Flutter SDK's reveal, collect, 3DS and wallet surfaces.

Before You Start

Read the following guides before proceeding:

GuideWhy
Flutter SDKSurfaces, isolation model and flows

Overview

Every surface takes an appearance object and a strings object. The SDK ships no copy — your app supplies
every word the views draw. The card surfaces share one set of token names; the wallet checkout takes CSS
variables.


Card Surfaces

import 'package:wirex_mobile_sdk/wirex_mobile_sdk.dart';

const WirexThemeMode themeMode = WirexThemeMode.dark;

const WirexRevealAppearance revealAppearance = WirexRevealAppearance(
  colorText: '#FFFFFF', colorLabel: '#9AA0B5', colorFocus: '#5753EA', colorBackground: '#1B1E2B',
  fontFamily: 'Inter', fontSizeBase: 16, fontWeightBase: '500', borderRadius: 8, controlMinHeight: 44,
);

const Map<String, Object?> collectAppearance = <String, Object?>{
  'colorText': '#FFFFFF', 'colorFocus': '#5753EA', 'borderRadius': 8, 'fontSizeBase': 16,
};
SurfaceAppearance type
RevealTyped WirexRevealAppearance
Collect, 3-D SecureMap<String, Object?> with the same token names

themeMode is a parameter on every card view: WirexThemeMode.light or dark. Colours are '#RRGGBB'
strings; sizes are logical pixels.

GroupTokens
ColourscolorText, colorLabel, colorPlaceholder, colorError, colorFocus, colorBackground, colorBorder, surfaceColor
TypographyfontFamily, fontSizeBase, fontSizeLabel, lineHeightBase, lineHeightLabel, fontWeightBase, fontWeightLabel
GeometryborderRadius, borderWidth, spacingUnit, paddingHorizontal, paddingVertical, spacingLabel, spacingError, iconSize, controlMinHeight

Icons are PNG bytes wrapped in WirexArtwork:

TypeConstructor
WirexRevealIconsWirexRevealIcons(copy:, copied:)
WirexCollectIconsWirexCollectIcons.brands(visa:, mastercard:)
WirexThreeDSIconsWirexThreeDSIcons(close:)

Strings

const WirexRevealStrings revealStrings = WirexRevealStrings(
  fieldLabels: <WirexRevealField, String>{WirexRevealField.pan: 'Card number', WirexRevealField.cvv: 'CVV'},
  maskedSegmentGlyph: '*', copy: 'Copy', copied: 'Copied',
);

const WirexCollectStrings collectStrings = WirexCollectStrings(
  labels: <WirexCollectField, String>{WirexCollectField.number: 'Card number', WirexCollectField.expiry: 'Expiry'},
  errors: <WirexCollectField?, Map<WirexCollectFieldError, String?>>{
    null: <WirexCollectFieldError, String?>{
      WirexCollectFieldError.incomplete: 'Required',
      WirexCollectFieldError.invalid: 'Check this field',
    },
    WirexCollectField.expiry: <WirexCollectFieldError, String?>{WirexCollectFieldError.expired: 'Card expired'},
  },
);
TypeKeys
WirexRevealStringsfieldLabels, maskedPlaceholder (plain fields), maskedSegmentGlyph (every PIN cell while masked, default '*'), copy, copied
WirexCollectStringslabels, placeholders, errors — per field, with the null key as the default for every field
WirexThreeDSStringstitle, close, loading

Wallet Checkout

const WirexWalletAppearance walletAppearance =
    WirexWalletAppearance(theme: WirexWalletTheme.dark, variables: <String, String>{'--wx-accent': '#5753EA'});
const WirexWalletButtons walletButtons = WirexWalletButtons(
  applePay: WirexWalletApplePayButton(style: SpecWalletApplePayButtonStyle.black, type: SpecWalletApplePayButtonType.topUp),
  googlePay: WirexWalletGooglePayButton(color: SpecWalletGooglePayButtonColor.black, type: SpecWalletGooglePayButtonType.pay),
);
const WirexWalletBranding walletBranding =
    WirexWalletBranding(logo: WirexWalletLogo.hidden(), processingDisclosurePartnerName: 'Acme');
ParameterDescription
appearancetheme and CSS variables passed to the checkout
buttonsApple Pay style / type, Google Pay color / type
brandingLogo — WirexWalletLogo.wirex(), hidden() or custom(dataUri); processing disclosure; privacy URL
stringsMap<SpecWalletStringKey, String> overriding the 11 labels of the checkout

Sizing

SurfaceHeight source
Reveal rowSizes itself from its content
Collect formSizes itself from its content
Wallet checkoutWirexWalletCheckoutNaturalHeight event or controller.naturalHeight

Apply the reported heights instead of hardcoding them. A PIN row fills the row at controlMinHeight in a host
box of exactly that height.


Did this page help you?