Bmob API 接口封装,包含加密传输,包含用户管理、ACL和角色、地理位置、条件查询、数据关联、数组、对象操作。
Bmob API interface encapsulation, including encrypted transmission, including user management, ACL and role, geographic location, conditional query, data association, array and object operation.
flutter pub add mini_bmob
import 'package:mini_bmob/mini_bmob.dart';
- 非加密形式
可查看测试代码
no_safe_test.dart
BmobConfig.init(
appId,
apiKey,
masterKey: masterKey,
printError: (object, extra) =>L.e(object),
printResponse: (object, extra) =>L.d(object)
);
- 加密形式
可查看测试代码
safe_test.dart
BmobConfig.initSafe(
secretKey,
'JsonYe-',
masterKey: masterKey,
printError: (object, extra) => L.e(object),
printResponse: (object, extra) => L.d(object),
);
BmobUserTable _user = BmobUserTable(username:'JsonYe',password:'123456');
await _user.login(); // 登陆后会自动更新sessionToken
class BookTable extends BmobTable{}
BookTable _table = BookTable();
await _table.install();
await _table.update();
await _table.delete();
BmobWhereBuilder _where = BmobWhereBuilder();
_where.whereBasic('name').contain(['Flutter']);
await BmobQueryHelper.list(BookTable(),(json)=>BmobTable().fromJson(json),where:_where);
BookTable _book = BookTable()..objectId='69a8a68a10';
await _book.getInfo();