cmdb 0.0.2 copy "cmdb: ^0.0.2" to clipboard
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
110
pub points
0%
popularity

Publisher

verified publishercodingminds.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