easy_setting_v2 0.0.1 copy "easy_setting_v2: ^0.0.1" to clipboard
easy_setting_v2: ^0.0.1 copied to clipboard

Easy setting management. It provides UI widgets and logics that work on Firestore

Easy settings #

easy_setting package provides an easy and nice UI/UX and the logic to manage user's settings in Firestore.

How to use #

  • To display and update a value, see the code below.
Setting(
  id: 'system',
  builder: (sm) {
    return ListTile(
      title: Text('System count: ${sm.value<int>('count') ?? 0}'),
      onTap: () {
        sm.update({'count': (sm.value<int>('count') ?? 0) + 1});
      },
    );
  },
),
  • For incrementing or decremeting an integer value, you can use below
sm.increment('count');
  • For user settings, you can use the user's firebase auth uid like below.
Setting(
  id: FirebaseAuth.instance.currentUser!.uid,
  builder: (sm) {
    return ListTile(
      title: Text('I like: ${sm.value<String>('fruit') ?? '...'}'),
      subtitle: Row(
        children: [
          TextButton(
            child: const Text('Apple'),
            onPressed: () {
              sm.update({'fruit': 'Apple'});
            },
          ),
          TextButton(
            child: const Text('Banna'),
            onPressed: () {
              sm.update({'fruit': 'Banana'});
            },
          ),
        ],
      ),
    );
  },
),
0
likes
0
points
38
downloads

Publisher

verified publishersonub.com

Weekly Downloads

Easy setting management. It provides UI widgets and logics that work on Firestore

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cloud_firestore, flutter

More

Packages that depend on easy_setting_v2