ncmb 0.0.8 copy "ncmb: ^0.0.8" to clipboard
ncmb: ^0.0.8 copied to clipboard

outdated

Dart and Flutter library for Nifcloud mobile backend(NCMB). Nifcloud mobile backend is a web service of mBaaS.

NCMB for Dart w/ Flutter #

Dart and Flutter library for Nifcloud mobile backend(NCMB).

Usage #

Init #

import 'package:ncmb/ncmb.dart';
NCMB ncmb = new NCMB('YOUR_APPLICATION_KEY', 'YOUR_CLIENT_KEY');

DataStore #

Create data

NCMBObject item = ncmb.Object('Item')
  ..set('msg', 'Hello World')
  ..set('array', ['a', 'b'])
  ..set('int', 1)
  ..set('name', 'Atsushi');
await item.save();
debugPrint(item.get('objectId'));

Update data

await item.set('name', 'goofmint');
await item.save();

Delete data

await item.destroy();

Retribe data

NCMBQuery query = ncmb.Query('Item');

// All data
var items = await query.fetchAll();
print(items[0].get('msg'));

// First data
var item2 = await query.fetch();
print(item2.get('msg'));

// Query (Equal)
query.equalTo('objectId', item.get('objectId'));
var item3 = await query.fetch();
print(item3.get('objectId'));

query.clear();
query
  ..notEqualTo('array', ['a', 'b', 'c'])
  ..limit(2)
  ..lessThan('int', 4);
items = await query.fetchAll();
print(items.length);

ACL

var acl = NCMBAcl();
acl
  ..setPublicReadAccess(true)
  ..setPublicWriteAccess(false)
  ..setRoleWriteAccess('Admin', true)
  ..setUserWriteAccess('aaaaa', true);
item3.set('acl', acl);

Special type

items[0]
  // Class of Datastore
  ..set('item', items[1])
  // DateTime
  ..set('time', DateTime.now())
  // Geo location
  ..set('geo', NCMBGeoPoint(35.658611, 139.745556));

LICENSE #

MIT.

3
likes
0
pub points
49%
popularity

Publisher

unverified uploader

Dart and Flutter library for Nifcloud mobile backend(NCMB). Nifcloud mobile backend is a web service of mBaaS.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

crypto, http, intl

More

Packages that depend on ncmb