LokotroPayThemeConfig class
Theme configuration for Lokotro Pay.
Pass this to LokotroPayCheckout(themeConfig: ...) to brand the widget.
All color fields are optional — anything left null falls back to:
Theme.of(context).colorScheme.*from the host app, or- a clean white-background / near-black-text default if the host has no theme.
Typical usage from a merchant integration:
LokotroPayCheckout(
configs: LokotroPayConfigs(token: 'app-key'),
themeConfig: const LokotroPayThemeConfig(
primaryColor: Color(0xFF2563EB),
secondaryColor: Color(0xFF1E40AF),
tertiaryColor: Color(0xFF3BFBDA),
),
...
)
Constructors
- LokotroPayThemeConfig({LokotroPayTheme theme = LokotroPayTheme.light, Color? primaryColor, Color? secondaryColor, Color? tertiaryColor, Color? backgroundColor, Color? surfaceColor, Color? textColor, Color? secondaryTextColor, Color? borderColor, Color? errorColor, Color? successColor, double? borderRadius, EdgeInsetsGeometry? inputPadding})
-
const
- LokotroPayThemeConfig.dark({Color? primaryColor, Color? secondaryColor, Color? tertiaryColor, Color? backgroundColor, double? borderRadius})
-
Dark theme — kept for opt-in use, no longer the default.
factory
- LokotroPayThemeConfig.light({Color? primaryColor, Color? secondaryColor, Color? tertiaryColor, Color? backgroundColor, double? borderRadius})
-
Light theme — clean white background, near-black text.
Brand colors fall back to host app's
Theme.of(context).colorSchemeif null.factory - LokotroPayThemeConfig.lightLokotroBrand({double? borderRadius})
-
Create light theme configuration with Lokotro brand colors (legacy entry).
factory
- LokotroPayThemeConfig.system({Color? primaryColor, Color? secondaryColor, Color? tertiaryColor, double? borderRadius})
-
System theme — follows host device brightness.
factory
Properties
- backgroundColor → Color?
-
final
- borderColor → Color?
-
final
- borderRadius → double?
-
final
- errorColor → Color?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- inputPadding → EdgeInsetsGeometry?
-
final
- primaryColor → Color?
-
Brand primary — used for primary buttons, focused inputs, key accents.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondaryColor → Color?
-
Brand secondary — used for gradient companion to primary, secondary actions.
final
- secondaryTextColor → Color?
-
final
- successColor → Color?
-
final
- surfaceColor → Color?
-
final
- tertiaryColor → Color?
-
Brand tertiary — used for highlights, OTP focus rings, gradient end stop.
final
- textColor → Color?
-
final
- theme → LokotroPayTheme
-
final
Methods
-
buildThemeData(
BuildContext context) → ThemeData -
Build a
ThemeDatato wrap the checkout widget so child screens automatically inherit brand colors viaTheme.of(context). -
getCardDecoration(
{double? elevation}) → BoxDecoration - Get card decoration based on theme
-
getEffectiveTheme(
Brightness brightness) → LokotroPayThemeConfig - Get effective theme colors based on brightness
-
getInputDecoration(
{required String labelText, String? hintText, Widget? prefixIcon, Widget? suffixIcon, String? errorText}) → InputDecoration - Get input decoration based on theme with Comfortaa font
-
getPrimaryButtonStyle(
) → ButtonStyle - Get button style based on theme with Comfortaa font
-
getSecondaryButtonStyle(
) → ButtonStyle - Get secondary button style based on theme with Comfortaa font
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
comfortaa(
{double fontSize = 14, FontWeight fontWeight = FontWeight.w400, Color? color, double? height, TextDecoration? decoration, FontStyle? fontStyle, double? letterSpacing}) → TextStyle - Get Comfortaa text style backed by the bundled package font.
-
getTextTheme(
Color textColor) → TextTheme - Get Comfortaa text theme backed by the bundled package font.