playx_theme library

Classes

AndroidOptions
Specific options for Android platform.
AppleOptions
Specific options for Apple platform.
Blend
Functions for blending in HCT and CAM16.
Cam16
CAM16, a color appearance model. Colors are not just defined by their hex code, but rather, a hex code and viewing conditions.
Cancelable<R>
CorePalette
An intermediate concept between the key color for a UI theme, and a full color scheme. 5 tonal palettes are generated, all except one use the same hue as the key color, and all vary in chroma.
DefaultAppScrollBehavior
Describes how Scrollable widgets behave for MaterialApps. Defaults to use touch, mouse, and trackpad.
DefaultColoredLoggerFormatter
A default logger formatter that uses colored output for log messages.
DefaultColors
Disposable
If objects that are registered inside GetIt implements Disposable the onDispose method will be called whenever that Object is unregistered, reset or its enclosing Scope is popped
DynamicColor
A color that adjusts itself based on UI state provided by DynamicScheme.
DynamicScheme
Constructed by a set of values representing the current UI state (such as whether or not its dark theme, what the theme style is, etc.), and provides a set of TonalPalettes that can create colors that fit in with the theme style. Used by DynamicColor to resolve into a color.
Equatable
A base class to facilitate operator == and hashCode overrides.
EquatableConfig
The default configuration for all Equatable instances.
FlexCorePalette
An intermediate concept between the key color for a UI theme, and a full color scheme. Five tonal palettes are generated, plus a default error palette if not provided.
FlexTonalPalette
A convenience class for retrieving colors that are constant in hue and chroma, but vary in tone.
FlexTones
Configuration data class that defines which tone to use from each FlexTonalPalette when assigning used color to each ColorScheme color.
FlutterSecureStorage
A class to manage secure storage in a Flutter application across multiple platforms.
Gentle
GetIt
Very simple and easy to use service locator You register your object creation factory or an instance of an object with registerFactory, registerSingleton or registerLazySingleton And retrieve the desired object using get or call your locator as function as its a callable class Additionally GetIt offers asynchronous creation functions as well as functions to synchronize the async initialization of multiple Singletons
Hct
HCT, hue, chroma, and tone. A color system that provides a perceptually accurate color measurement system that can also accurately render what colors will appear as in different lighting environments.
ImageTheme
Widget that is themed by image content by providing image provider. As it generates color scheme from image content.
InitDependency
Data structure used to identify a dependency by type and instanceName
IOSOptions
Specific options for iOS platform. Currently there are no specific ios options available, but only shared options from apple options.
LinuxOptions
Specific options for Linux platform. Currently there are no specific linux options available.
MacOsOptions
Specific options for macOS platform. Extends AppleOptions and adds the usesDataProtectionKeychain parameter.
MapUtils
MaterialDynamicColors
Tokens, or named colors, in the Material Design system.
Mixinable<T>
ObjectRegistration<T extends Object>
PlayxAsyncPrefs
An abstract class that provides an asynchronous interface for accessing and manipulating SharedPreferences data.
PlayxBaseLogger
Abstract logger interface used by PlayxLogger. Can be implemented with any backend (e.g., Talker, Logger, etc.).
PlayxColors
Base class for defining custom colors for each theme.
PlayxCore
Core of the playx_core plugin.
PlayxEnv
Wrapper for configure any the application with global variables using a .env file.
PlayxEnvSettings
Settings for PlayxEnvSettings.
PlayxLogger
A centralized static logger utility for Playx-based applications.
PlayxLoggerSettings
Settings for initializing a logger without depending on any implementation.
PlayxPlatform
Utility class for determining the current platform type and characteristics.
PlayxPrefs
Wrapper for handling shared preferences to save and retrieve data.
PlayxPrefsSettings
PlayxPrefsWithCache
Provides a persistent store for simple data with caching capabilities.
PlayxSecurePrefs
Wrapper for handling secure preferences to save and get preferences.
PlayxSecurePrefsSettings
Settings for PlayxSecurePrefsSettings .
PlayxTheme
Manages the app's theme and provides methods to update it.
PlayxThemeAnimation
Base class that defines theme animations and their settings in the Playx theme package.
PlayxThemeBuilder
A widget that provides a way to build a subtree with the current theme.
PlayxThemeClipperAnimation
Defines a clipping-based theme animation using a custom clipper.
PlayxThemeConfig
Theme config : Used to configure the app's theme by specifying the available themes, the initial theme index, and whether to save the selected theme to device storage.
PlayxThemeFadeAnimation
Defines a fade animation effect with adjustable opacity levels.
PlayxThemeHorizontalSlideAnimation
Defines a horizontal slide animation effect with adjustable start and end offsets.
PlayxThemeScaleAnimation
Defines a scale animation effect with adjustable scale values.
PlayxThemeSwitcher
A StatelessWidget that allows for building widgets based on the current XTheme.
PlayxThemeSwitchingArea
PlayxThemeVerticalSlideAnimation
Defines a vertical slide animation effect with adjustable start and end offsets.
Scheme
This class is the same concept as Flutter's ColorScheme class.
SendPort
Sends messages to its ReceivePorts.
ShadowChangeHandlers
If an object implements the ShadowChangeHandler if will get notified if an Object with the same registration type and name is registered on a higher scope which will shadow it. It also will get notified if the shadowing object is removed from GetIt
SharedPreferences
Wraps NSUserDefaults (on iOS) and SharedPreferences (on Android), providing a persistent store for simple data.
SharedPreferencesAsync
Provides a persistent store for simple data.
SharedPreferencesOptions
Basic options for creating SharedPreferencesAsync classes.
SharedPreferencesWithCache
Provides a persistent store for simple data.
SharedPreferencesWithCacheOptions
Options necessary to create a SharedPreferencesWithCache.
TalkerPlayxLogger
Task<R>
TaskGentle<R>
TaskGentleWithPort<R>
TaskRegular<R>
TaskWithPort<R>
ThemeSwitcherBoxClipper
ThemeSwitcherCircleClipper
ThemeSwitcherClipper
ThemeSwitcherClipperBridge
TonalPalette
A convenience class for retrieving colors that are constant in hue and chroma, but vary in tone.
ViewingConditions
In traditional color spaces, a color can be identified solely by the observer's measurement of the color. Color appearance models such as CAM16 also use information about the environment where the color was observed, known as the viewing conditions.
WebOptions
Specific options for web platform.
WebUtils
A stubbed version of WebUtils for non-web platforms (e.g. mobile, desktop).
WillSignalReady
If your singleton that you register wants to use the manually signalling of its ready state, it can implement this interface class instead of using the signalsReady parameter of the registration functions (you don't really have to implement much ;-) )
WindowsOptions
Specific options for Windows platform.
WithPort
WorkManagerSettings
XDefaultThemeConfig
Default theme configuration.
XTheme
A class that defines the theme settings for the application.

Enums

AccessControlFlag
Keychain access control flags that define security conditions for accessing items. These flags can be combined to create complex access control policies.
AndroidBiometricType
Controls which authentication methods are accepted when biometric authentication is used.
FlexPaletteType
Enum used to select tones included in produced FlexTonalPalette.
FlexSchemeVariant
Enum used to return and describe properties of the FlexSchemeVariant variants to invoke different color scheme generation algorithms in SeedColorScheme.fromSeeds, when passed to its FlexSchemeVariant property variant.
KeychainAccessibility
KeyChain accessibility attributes as defined here: https://developer.apple.com/documentation/security/ksecattraccessible?language=objc
KeyCipherAlgorithm
Algorithm used to encrypt/wrap the secret key in Android KeyStore.
Month
ObjectRegistrationType
You will see a rather esoteric looking test (const Object() is! T) at several places. It tests if T is a real type and not Object or dynamic. For each registered factory/singleton an ObjectRegistration<T> is created it holds either the instance of a Singleton or/and the creation functions for creating an instance when get is called
StorageCipherAlgorithm
Algorithm used to encrypt stored data.
Weekday
WorkPriority

Mixins

EquatableMixin
A mixin that helps implement equality without needing to explicitly override operator == and hashCode.

Extensions

BoolExtensions on bool
BuildContextExtension on BuildContext
ContextColorsExtensions on BuildContext
ContextLocalizationExtensions on BuildContext
  • Localization shortcuts
  • ContextMediaQueryExtensions on BuildContext
  • MediaQuery shortcuts
  • ContextNavigatorExtensions on BuildContext
  • Navigation shortcuts
  • ContextThemeExtensions on BuildContext
    DateTimeExtensions on DateTime
    Extensions for DateTime
    DurationExtensions on Duration
    Extension functions to convert duration to formatted hours, minutes, seconds and milliseconds.
    FlexColorSeedColorExtensions on Color
    Public extensions on Color.
    LocaleExtensions on Locale
    extensions on the locale
    MapAsync on T
    NestedIterablesExtensions on Iterable<Iterable<T>>
    NullableBoolExtensions on bool?
    Extensions for nullable booleans.
    NullableStringExtensions on String?
    Extension functions on a nullable String.
    PlayxColorExtensions on Color
    PlayxIterableExtensions on Iterable<T>
    Extensions on Iterable class to make it easier to work with.
    PlayxIterableNumExtensions on Iterable<T>
    Extensions for Iterables of numbers.
    SeedColorScheme on ColorScheme
    Extension on ColorScheme to provide a more flexible alternative to Flutter's Material 3 ColorScheme.fromSeed.
    StringExtensions on String
    Extension function on string.

    Properties

    getIt GetIt
    Returns the instance of GetIt used by the playx_core plugin.
    no setter
    workerManager → _Executor
    final

    Functions

    asBool(dynamic json, String key) bool
    Returns a bool for the value at key. Throws a FormatException if the value cannot be converted.
    asBoolOr(dynamic json, String key, {bool fallback = false}) bool
    Returns a bool for the value at key, or fallback if conversion fails.
    asBoolOrNull(dynamic json, String key) bool?
    ==================== bool conversions
    asDateTime(dynamic json, String key) DateTime
    Returns a DateTime for the value at key. Throws a FormatException if the value cannot be parsed.
    asDateTimeOr(dynamic json, String key, {required DateTime fallback}) DateTime
    Returns a DateTime for the value at key, or fallback if parsing fails.
    asDateTimeOrNull(dynamic json, String key) DateTime?
    ==================== DateTime conversions
    asDouble(dynamic json, String key) double
    Returns a double for the value at key. Throws a FormatException if the value cannot be converted.
    asDoubleOr(dynamic json, String key, {double fallback = 0.0}) double
    Returns a double for the value at key, or fallback if conversion fails.
    asDoubleOrNull(dynamic json, String key) double?
    ==================== double conversions
    asEnum<T extends Enum>(dynamic json, String key, List<T> values) → T
    Returns an enum for the value at key. Throws a FormatException if the value cannot be matched.
    asEnumOr<T extends Enum>(dynamic json, String key, List<T> values, {required T fallback}) → T
    Returns an enum for the value at key, or fallback if parsing fails.
    asEnumOrNull<T extends Enum>(dynamic json, String key, List<T> values) → T?
    ==================== Enum conversions
    asInt(dynamic json, String key) int
    Returns an int for the value at key. Throws a FormatException if the value cannot be converted.
    asIntOr(dynamic json, String key, {int fallback = 0}) int
    Returns an int for the value at key, or fallback if conversion fails.
    asIntOrNull(dynamic json, String key) int?
    ==================== int conversions
    asList<T>(dynamic json, String key, {T fromJson(dynamic json)?}) List<T>
    Converts the value at key to a List.
    asListInt(dynamic json, String key, {int fromJson(dynamic json)?}) List<int>
    Returns a Listint for the value at key. Throws a FormatException if the value is not a list of ints.
    asListIntOr(dynamic json, String key, {List<int> fallback = const [], int fromJson(dynamic json)?}) List<int>
    Returns a Listint for the value at key, or fallback if conversion fails.
    asListIntOrNull(dynamic json, String key, {int fromJson(dynamic json)?}) List<int>?
    ==================== Listint conversions
    asListOr<T>(dynamic json, String key, {List<T> fallback = const [], T fromJson(dynamic json)?}) List<T>
    Converts the value at key to a List.
    asListOrNull<T>(dynamic json, String key, {T fromJson(dynamic json)?}) List<T>?
    ==================== List conversions (generic)
    asListString(dynamic json, String key, {String fromJson(dynamic json)?}) List<String>
    Returns a List for the value at key. Throws a FormatException if the value is not a list of strings.
    asListStringOr(dynamic json, String key, {List<String> fallback = const [], String fromJson(dynamic json)?}) List<String>
    Returns a List for the value at key, or fallback if conversion fails.
    asListStringOrNull(dynamic json, String key, {String fromJson(dynamic json)?}) List<String>?
    ==================== ListString conversions
    asLocalDateTime(dynamic json, String key) DateTime
    Returns a local DateTime for the value at key. Throws a FormatException if the value cannot be parsed.
    asLocalDateTimeOr(dynamic json, String key, {required DateTime fallback}) DateTime
    Returns a local DateTime for the value at key, or fallback if parsing fails.
    asLocalDateTimeOrNull(dynamic json, String key) DateTime?
    Returns a local DateTime with current timezone if the value at key can be parsed, otherwise null.
    asMap<T, S>(dynamic json, String key) Map<T, S>
    Returns a Map for the value at key. Throws a FormatException if the value is not a map.
    asMapOr<T, S>(dynamic json, String key, {Map<T, S> fallback = const {}}) Map<T, S>
    Returns a Map for the value at key, or fallback if conversion fails.
    asMapOrNull<T, S>(dynamic json, String key) Map<T, S>?
    ==================== Map conversions
    asNum(dynamic json, String key) num
    Returns a num (int or double) for the value at key. Throws a FormatException if the value cannot be converted.
    asNumOr(dynamic json, String key, {num fallback = 0}) num
    Returns a num (int or double) for the value at key, or fallback if conversion fails.
    asNumOrNull(dynamic json, String key) num?
    ==================== num conversions
    asString(dynamic json, String key) String
    Returns a String for the value at key. Throws a FormatException if the value cannot be converted.
    asStringOr(dynamic json, String key, {String fallback = ''}) String
    Returns a String for the value at key, or fallback if conversion fails.
    asStringOrNull(dynamic json, String key) String?
    ==================== String conversions
    asT<T>(dynamic json, String key, {T fromJson(dynamic json)?}) → T
    asTOr<T>(dynamic json, String key, {T fromJson(dynamic json)?, required T fallback}) → T
    asTOrNull<T>(dynamic json, String key, {T fromJson(dynamic json)?}) → T?
    ==================== Generic conversion
    asUri(dynamic json, String key) Uri
    Returns an Uri for the value at key. Throws a FormatException if the value cannot be parsed.
    asUriOr(dynamic json, String key, {required Uri fallback}) Uri
    Returns an Uri for the value at key, or fallback if parsing fails.
    asUriOrNull(dynamic json, String key) Uri?
    ==================== Uri conversions
    clearClipboard() Future<void>
    Clear the clipboard.
    copyToClipboard(String text) Future<void>
    Copies text to clipboard.
    enterFullScreen() → void
    Enables full-screen immersive mode (hides status and navigation bars).
    exitFullScreen() → void
    Exits full-screen and restores system overlays (status and navigation bars).
    getBlendedColorScheme(ColorScheme firstColorScheme, ColorScheme secondColorScheme) ColorScheme
    getClipboardText() Future<String?>
    Retrieves text from clipboard.
    hideKeyboard() → void
    Hides the on-screen keyboard, if visible.
    setNavigationBarColor({Color color = Colors.black, bool isDark = false}) → void
    Sets the navigation bar color and icon brightness (usually at the bottom).
    setOrientation({bool isPortrait = true, bool allowRotation = false}) → void
    Locks the screen orientation.
    setStatusBarColor({Color color = Colors.transparent, bool isDark = false}) → void
    Sets the status bar color and icon brightness.
    showKeyboard() → void
    Attempts to show the keyboard by requesting focus from the current primary focus node.
    throwIf(bool condition, Object error) → void
    Two handy functions that help me to express my intention clearer and shorter to check for runtime errors
    throwIfNot(bool condition, Object error) → void
    toBool(dynamic value) bool
    Converts value to bool or throws FormatException if conversion fails.
    toBoolOr(dynamic value, {bool fallback = false}) bool
    Converts value to bool or returns fallback if conversion fails.
    toBoolOrNull(dynamic value) bool?
    Safely converts value to bool, or returns null if conversion fails.
    toDateTime(dynamic value) DateTime
    Converts value to DateTime or throws FormatException if conversion fails.
    toDateTimeOr(dynamic value, {required DateTime fallback}) DateTime
    Converts value to DateTime or returns fallback if conversion fails.
    toDateTimeOrNull(dynamic value) DateTime?
    Safely converts value to DateTime, or returns null if conversion fails.
    toDouble(dynamic value) double
    Converts value to double or throws FormatException if conversion fails.
    toDoubleOr(dynamic value, {double fallback = 0.0}) double
    Converts value to double or returns fallback if conversion fails.
    toDoubleOrNull(dynamic value) double?
    Safely converts value to double, or returns null if conversion fails.
    toEnum<T extends Enum>(dynamic value, List<T> values) → T
    Converts value to an enum or throws FormatException if conversion fails.
    toEnumOr<T extends Enum>(dynamic value, List<T> values, {required T fallback}) → T
    Converts value to an enum or returns fallback if conversion fails.
    toEnumOrNull<T extends Enum>(dynamic value, List<T> values) → T?
    Safely converts value to an enum of type T, or returns null if conversion fails. Requires the list of all enum values (e.g., MyEnum.values).
    toInt(dynamic value) int
    Converts value to int or throws FormatException if conversion fails.
    toIntOr(dynamic value, {int fallback = 0}) int
    Converts value to int or returns fallback if conversion fails.
    toIntOrNull(dynamic value) int?
    Safely converts value to an int, or returns null if conversion fails.
    toList<T>(dynamic value, {T fromJson(dynamic json)?}) List<T>
    Converts value to List or throws FormatException if conversion fails.
    toListOr<T>(dynamic value, {List<T> fallback = const [], T fromJson(dynamic json)?}) List<T>
    Converts value to List or returns fallback if conversion fails.
    toListOrNull<T>(dynamic value, {T fromJson(dynamic json)?}) List<T>?
    Safely converts value to List, or returns null if conversion fails.
    toLocalDateTime(dynamic value) DateTime
    Converts value to DateTime in local time zone or throws FormatException if conversion fails.
    toLocalDateTimeOr(dynamic value, {required DateTime fallback}) DateTime
    Converts value to DateTime in local time zone or returns fallback if conversion fails.
    toLocalDateTimeOrNull(dynamic value) DateTime?
    Safely converts value to DateTime in local time zone, or returns null if conversion fails.
    toMap<T, S>(dynamic value) Map<T, S>
    Converts value to Map or throws FormatException if conversion fails.
    toMapOr<T, S>(dynamic value, {Map<T, S> fallback = const {}}) Map<T, S>
    Converts value to Map or returns fallback if conversion fails.
    toMapOrNull<T, S>(dynamic value) Map<T, S>?
    Safely converts value to a Map, or returns null if conversion fails.
    toNum(dynamic value) num
    Converts value to num or throws FormatException if conversion fails.
    toNumOr(dynamic value, {num fallback = 0}) num
    Converts value to num or returns fallback if conversion fails.
    toNumOrNull(dynamic value) num?
    Safely converts value to num, or returns null if conversion fails.
    toString(dynamic value) String
    Converts value to String or throws FormatException if conversion fails.
    toStringOr(dynamic value, {String fallback = ''}) String
    Converts value to String or returns fallback if conversion fails.
    toStringOrNull(dynamic value) String?
    Safely converts value to String, or returns null if conversion fails.
    toT<T>(dynamic value, {required T fromJson(dynamic json)}) → T
    Converts value to T using fromJson or throws FormatException if conversion fails.
    toTOr<T>(dynamic value, {required T fromJson(dynamic json), required T fallback}) → T
    Converts value to T using fromJson or returns fallback if conversion fails.
    toTOrNull<T>(dynamic value, {required T fromJson(dynamic json)}) → T?
    Safely converts value to type T using the fromJson function, or returns null if conversion fails.
    toUri(dynamic value) Uri
    Converts value to Uri or throws FormatException if conversion fails.
    toUriOr(dynamic value, {required Uri fallback}) Uri
    Converts value to Uri or returns fallback if conversion fails.
    toUriOrNull(dynamic value) Uri?
    Safely converts value to Uri, or returns null if conversion fails.
    twoDigits(int n) String

    Typedefs

    DisposingFunc<T> = FutureOr Function(T param)
    Signature for disposing function because closures like (x){} have a return type of Null we don't use FutureOr<void>
    Execute<R> = FutureOr<R> Function()
    ExecuteGentle<R> = FutureOr<R> Function(bool ())
    ExecuteGentleWithPort<R> = FutureOr<R> Function(SendPort port, bool ())
    ExecuteWithPort<R> = FutureOr<R> Function(SendPort port)
    FactoryFunc<T> = T Function()
    Signature of the factory function used by non async factories
    FactoryFuncAsync<T> = Future<T> Function()
    Signature of the factory function used by async factories
    FactoryFuncParam<T, P1, P2> = T Function(P1 param1, P2 param2)
    For Factories that expect up to two parameters if you need only one use void for the one you don't use
    FactoryFuncParamAsync<T, P1, P2> = Future<T> Function(P1 param1, P2 param2)
    For async Factories that expect up to two parameters if you need only one use void for the one you don't use
    Mapper<T, S> = FutureOr<S> Function(T data)
    ScopeDisposeFunc = FutureOr Function()
    Signature for disposing function on scope level
    ThemeBuilder = Widget Function(BuildContext, XTheme theme)
    A function that takes the BuildContext and the current XTheme, and returns a Widget to be built with the current theme.
    ThemeSwitcherBuilder = Widget Function(BuildContext context, XTheme theme)
    Defines a callback function that takes the current XTheme and builds a widget based on that theme.