Theme class

The Tiki SDK theme for pre-built UIs.

The pre-built UI styles are defined by a Theme object. To configure a theme, chain calls to the TikiSdk.config method. For example:

TikiSdk.config()
    .theme
        .primaryTextColor(Colors.black)
        .primaryBackgroundColor(Colors.white)
        .accentColor(Colors.blue)
        .fontFamily("test")

To configure a dark theme, use the TikiSdk.dark property or chain calls to the config() method:

TikiSdk.config()
    .theme
        .primaryTextColor(Colors.black)
        .primaryBackgroundColor(Colors.white)
        .accentColor(Colors.blue)
        .fontFamily("test")
    .and()
    .dark
        .primaryTextColor(Colors.white)
        .primaryBackgroundColor(Colors.black)
        .accentColor(Colors.white)
        .fontFamily("test")

The dark theme is only used if explicitly configured and if the OS is using a dark theme.

To configure fonts, first load the font assets files with pubsbec.yaml and set the fontFamily and fontPackage.

Constructors

Theme()
Builds a default TikiTheme.

Properties

getAccentColor Color
Accent color. Used to decorate or highlight items.
no setter
getFontFamily String?
The default font family for all texts.
no setter
getFontPackage String?
The package to which the font asset belongs.
no setter
getPrimaryBackgroundColor Color
Primary background color. The default color for backgrounds.
no setter
getPrimaryTextColor Color
Primary text color. Used in the default text items.
no setter
getSecondaryBackgroundColor Color
Secondary background color.
no setter
getSecondaryTextColor Color
Secondary text color. Used in specific text items.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

accentColor(Color accentColor) Theme
Sets the _accentColor
and() TikiSdk
Returns the TikiSdk instance to simplify the chaining of methods in SDK configuration and initialization.
fontFamily(String fontFamily) Theme
Sets the _fontFamily
fontPackage(String fontPackage) Theme
Sets the _fontPackage
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
primaryBackgroundColor(Color primaryBackgroundColor) Theme
Sets the _primaryBackgroundColor
primaryTextColor(Color primaryTextColor) Theme
Sets the _primaryTextColor
secondaryBackgroundColor(Color secondaryBackgroundColor) Theme
Sets the _secondaryBackgroundColor
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited