Visual Customization: Colors, Shapes, and Specific UI Components
You can customize the Flutter Unified Checkout to support visual customization, allowing you to match the design of your app.
Appearance class.
Colors
Customize the colors in the mobile Payment Element by modifying the color categories. Each color category determines the color of one or more components in the UI. For example,primary defines the color of the Pay button.
To use custom colors for the SDK, you should create an instance of the
ColorsObject class by passing the above attributes to its constructor. Next, create an instance of the DynamicColors class by invoking its constructor and passing the ColorsObject instance created earlier. Finally, create an instance of the Appearance class by passing the DynamicColors object.
Consider the below code for your reference:
Configuration and Appearance
Create an instance of theConfiguration class by invoking its constructor and passing the Appearance object created above. Then, create an instance of the PaymentSheetParams class by invoking its constructor and passing the Configuration object created earlier.
Consider the below code for your reference:
Configuration Options
- Set
displaySavedPaymentMethodstofalseto disable saved cards - Set
displaySavedPaymentMethodsCheckboxtofalseto stop your users from saving their payment methods - Set
disableBrandingtofalseto disable Pesaswap branding - Set
primaryButtonLabelto “Pay Button Text” to display custom text - Set
paymentSheetHeaderLabelto “Heading Text” to display custom heading
Custom Placeholders and Branding
To set custom placeholder text for card number, expiry date, or CVV input fields, you may set the placeholder property for these as shown below:disableBranding property to true:
PaymentSheetParams object to initPaymentSheet as shown in the previous section.
Dark Mode Support
To support dark mode, pass objects of the
ColorsObject class for both light and dark colors to the constructor of the DynamicColors class like below:Shadow
You can customize the shadow used throughout the mobile Payment Element using an object of the built-inShadow class.
Shapes
You can customize the border radius, border width, and shadow used throughout the mobile Payment Element using an object of the built-inShapes class.
Languages
The Pesaswap Flutter SDK supports localization in multiple languages. The default locale is English (en). To override, you can send the locale in the appearance object. You may refer to the below code for your reference:Supported Locales
- Arabic (ar)
- Bosnian (bs)
- Catalan (ca)
- Czech (cs)
- Danish (da)
- Dutch (nl)
- Dutch (Belgium) (nl-BE)
- English (en)
- English (en-GB)
- Estonian (et)
- Finnish (fi)
- French (fr)
- French (Belgium) (fr-BE)
- German (de)
- Greek (el)
- Hebrew (he)
- Icelandic (is)
- Italian (it)
- Japanese (ja)
- Lithuanian (lt)
- Malay (ms)
- Norwegian (nb)
- Polish (pl)
- Portuguese (pt)
- Russian (ru)
- Slovak (sk)
- Spanish (es)
- Swedish (sv)
- Turkish (tr-CY)
- Welsh (cy)