cmdb 0.0.2
cmdb: ^0.0.2 copied to clipboard

A Flutter plugin to store and get access to information to/from Firebase Realtime database

cmdb #

A Flutter plugin to store and get access to information to/from Firebase Realtime database.

Getting Started #

Example #

CMDB database = CMDB();
  Map<String, dynamic> _users = {};

  int _counter = 1;

  @override
  void initState() {
    super.initState();
    //Use initialize function only in the main. Once it is initialized you do not need to use initialize('url') in other pages.
    // You only use CMDB database = CMDB() and use the other functions;
    database
        .initialize('https://cmdatabase-xxxxx-default-rtdb.firebaseio.com/');
  }

  void getUsers() {
    String path = 'Users/';
    database.get<Map<String, dynamic>>(path).then((value) {
      if (value != null)
        setState(() {
          _users = value;
        });
    });
  }

  void createUserWithUniqueKey(String username, String password) {
    String path = 'Users';
    database.create(path, {'username': username, 'password': password}).then(
        (response) {
      if (response != null) _counter++;
    });
  }

  void createUser(String username, String password) {
    String path = 'Users/$username';
    database.update(path,
        {'username': username, 'password': password}).then((response) {
      if (response) _counter++;
    });
  }

0
likes
120
pub points
39%
popularity

Publisher

codingminds.academy

A Flutter plugin to store and get access to information to/from Firebase Realtime database

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, http

More

Packages that depend on cmdb