clever_settings_flutter

Creator: coderz1093

Last updated:

0 purchases

clever_settings_flutter Image
clever_settings_flutter Images

Languages

Categories

Add to Cart

Description:

clever settings flutter

Clever Settings Flutter #



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]
copied to clipboard
Install it:
flutter packages get
copied to clipboard

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();
copied to clipboard
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());
},
),
copied to clipboard
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}');
},
)

copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.