BaseBeautyStore class abstract

Basic beauty related interfaces, managing the adjustment and state synchronization of smooth, whiteness, ruddy and other basic beauty effects.

BaseBeautyStore BaseBeautyStore manages the adjustment and state synchronization of smooth, whiteness, ruddy and other basic beauty effects. Basic beauty functionality achieves real-time beauty effect adjustment through easy-to-use APIs. BaseBeautyStore provides a complete set of interfaces to manage beauty effect settings and state subscriptions.

Key Features

  • Smooth Effect:Supports 0-9 level smooth effect adjustment
  • Whiteness Effect:Supports 0-9 level whiteness effect adjustment
  • Ruddy Effect:Supports 0-9 level ruddy effect adjustment
  • State Subscription:Real-time subscription to beauty state changes, synchronizing UI display with actual effects

Note: Beauty state updates are delivered through the baseBeautyState publisher. Subscribe to it to receive real-time updates about beauty effect levels.

Usage Example

// Get singleton instance
final store = BaseBeautyStore.shared;

// Define listeners
late final VoidCallback smoothLevelListener = _onSmoothLevelChanged;
late final VoidCallback whitenessLevelListener = _onWhitenessLevelChanged;
late final VoidCallback ruddyLevelListener = _onRuddyLevelChanged;

void _onSmoothLevelChanged() {
    print('Smooth level: ${store.baseBeautyState.smoothLevel.value}');
}

void _onWhitenessLevelChanged() {
    print('Whiteness level: ${store.baseBeautyState.whitenessLevel.value}');
}

void _onRuddyLevelChanged() {
    print('Ruddy level: ${store.baseBeautyState.ruddyLevel.value}');
}

// Subscribe to state changes
store.baseBeautyState.smoothLevel.addListener(smoothLevelListener);
store.baseBeautyState.whitenessLevel.addListener(whitenessLevelListener);
store.baseBeautyState.ruddyLevel.addListener(ruddyLevelListener);

// Set beauty effects
store.setSmoothLevel(5.0);
store.setWhitenessLevel(3.0);
store.setRuddyLevel(2.0);

// Reset all beauty effects
store.reset();

// Unsubscribe when done
store.baseBeautyState.smoothLevel.removeListener(smoothLevelListener);
store.baseBeautyState.whitenessLevel.removeListener(whitenessLevelListener);
store.baseBeautyState.ruddyLevel.removeListener(ruddyLevelListener);

Topics

Getting Instance

  • shared : Get singleton instance

Observing State

Beauty Adjustment

See Also

Constructors

BaseBeautyStore()

Properties

baseBeautyState BaseBeautyState
Beauty state subscription, including smooth, whiteness, ruddy and other beauty effect levels. By subscribing to this state, you can get real-time updates of beauty data.
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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Reset all beauty parameters (smooth, whiteness, ruddy) to default off state (value 0).
setRuddyLevel(double ruddyLevel) → void
Set ruddy level
setSmoothLevel(double smoothLevel) → void
Set smooth level
setWhitenessLevel(double whitenessLevel) → void
Set whiteness level
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

shared BaseBeautyStore
Singleton object
no setter