ncmb 0.1.2

  • Readme
  • Changelog
  • Installing
  • new59

NCMB for Dart w/ Flutter #

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

Usage #

Init #

import 'package:ncmb/ncmb.dart';

DataStore #

Create data #

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

Update data #

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

Delete data #

await item.destroy();

Retribe data #

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

// All data
var items = await query.fetchAll();

// First data
var item2 = await query.fetch();

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

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


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

Special type #

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

User #

Register #

var userName = 'aaa';
var password = 'bbb';
var user = await ncmb.User.signUpByAccount(userName, password);

Login #

user = await ncmb.User.login(userName, password);

Logout #


File #

Upload #

Upload binary file

var fileName = 'dart.png';
var blob = await File(fileName).readAsBytes();
var file = await ncmb.File.upload(fileName, blob);

Upload text data as text file.

test("Upload text file", () async {
var fileName = 'dart.txt';
var file = await ncmb.File.upload(fileName, 'Hello world');

Custom mime type.

var fileName = 'dart.csv';
var file = await ncmb.File.upload(fileName, 'a,b,c', mimeType: 'text/csv');




0.0.1 #


  • Supporting save data to datastore.

0.0.2 #

Add example folder.

0.0.3 #

Add description to pubspec.yaml.

0.0.4 #

Update description. Maintenance code.

0.0.5 #

Support updating and deleting method at NCMBObject.

0.0.6 #

Support Retribing data.

0.0.7 #

Support Acl.

0.0.8 #

Support GeoPoint, DateTime and Class of DataStore.

0.0.9 #

Supprt user login and logout.

0.1.0 #

Support push notification.

0.1.1 #

Delete debug print.

0.1.2 #

Support upload file.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  ncmb: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:ncmb/ncmb.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health issues and suggestions

Document public APIs. (-1 points)

103 out of 103 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/main.dart. (-3.45 points)

Analysis of lib/src/main.dart reported 7 hints, including:

line 9 col 12: Name non-constant identifiers using lowerCamelCase.

line 10 col 20: Name non-constant identifiers using lowerCamelCase.

line 11 col 12: Name non-constant identifiers using lowerCamelCase.

line 21 col 14: Name non-constant identifiers using lowerCamelCase.

line 25 col 13: Name non-constant identifiers using lowerCamelCase.

Fix lib/src/user.dart. (-0.50 points)

Analysis of lib/src/user.dart reported 1 hint:

line 24 col 12: Name non-constant identifiers using lowerCamelCase.

Format lib/ncmb.dart.

Run flutter format to format lib/ncmb.dart.

Fix additional 8 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/acl.dart (Run flutter format to format lib/src/acl.dart.)
  • lib/src/file.dart (Run flutter format to format lib/src/file.dart.)
  • lib/src/geopoint.dart (Run flutter format to format lib/src/geopoint.dart.)
  • lib/src/installation.dart (Run flutter format to format lib/src/installation.dart.)
  • lib/src/object.dart (Run flutter format to format lib/src/object.dart.)
  • lib/src/query.dart (Run flutter format to format lib/src/query.dart.)
  • lib/src/request.dart (Run flutter format to format lib/src/request.dart.)
  • lib/src/signature.dart (Run flutter format to format lib/src/signature.dart.)

Maintenance suggestions

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and ncmb.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.5.0 <3.0.0
crypto ^2.1.3 2.1.4
dio ^3.0.8 3.0.8
http_parser ^3.1.3 3.1.3
intl ^0.16.1 0.16.1
mime ^0.9.6+3 0.9.6+3
notification_reactor ^0.0.3+1 0.0.3+1
package_info ^0.4.0+13 0.4.0+13
plain_notification_token ^0.0.1 0.0.1
Transitive dependencies
charcode 1.1.2
collection 1.14.11 1.14.12
convert 2.1.1
flutter 0.0.0
meta 1.1.8
path 1.6.4
platform 2.2.1
sky_engine 0.0.99
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies