clever_settings_flutter 0.1.1+1 copy "clever_settings_flutter: ^0.1.1+1" to clipboard
clever_settings_flutter: ^0.1.1+1 copied to clipboard

A flutter package that provides useful flutter utilities for clever_settings.

Clever Settings Flutter #

style: very good analysis Powered by Mason License: MIT

A flutter package that provides useful flutter utilities for clever_settings.

Installation 💻 #

Add clever_settings_flutter and clever_settings to your pubspec.yaml:

dependencies: 
  clever_settings: ^[version]
  clever_settings_flutter: ^[version]

Install it:

flutter packages get

Initialization 🚀 #

Before you can start using Clever Settings, you need to initialize it first. Call the init function once at the start of your application:

await CleverSettingsFlutter.init();

This will initialize Hive and open the settings database. If you want to configure Hive yourself, you can use CleverSettings.open() after initializing Hive.

Usage 💡 #

This will only focus on the additional features of clever_settings_flutter. The readme for the basic usage of clever_settings can be found here.

SettingsValueBuilder #

The SettingsValueBuilder is a widget used for building other widgets that depend on a SettingsValue object. It rebuilds whenever the value of the setting changes.

Example:

class Settings {
  static const mySetting =
      SettingsValue<bool>(name: 'mySetting', defaultValue: true);
}

...

SettingsValueBuilder(
  setting: Settings.mySetting,
  builder: (context, value, child) {
    return Text(value.toString());
  },
),

MultiSettingsValueBuilder #

The MultiSettingsValueBuilder is a widget that allows you to listen to and combine multiple SettingsValue objects to build a widget that depends on all of them.

Example:

MultiSettingsValueBuilder(
  settings: [
    Settings.mySetting,
    Settings.myOtherSetting,
  ],
  builder: (context, child) {
    // Updates when one of the settings changes.
    return Text('${Settings.mySetting.value} ${Settings.myOtherSetting.value}');
  },
)

1
likes
140
pub points
0%
popularity

Publisher

verified publisherclevertasks.de

A flutter package that provides useful flutter utilities for clever_settings.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

clever_settings, flutter, hive, hive_flutter

More

Packages that depend on clever_settings_flutter