backendless_sdk 0.3.0

Backendless SDK for Flutter #

pub package

A Flutter plugin enabling integration with Backendless.

Note: This plugin is still under active development. Some APIs may not be available yet while others may change. We will be updating the release history of the plugin and as soon as it reaches the general availability (GA) state, the APIs will be consistent for backward-compatibility.

Feedback and Pull Requests are most welcome!

Getting Started #

Follow the steps below to get started with Backendless Flutter SDK:

STEP 1. Register the plugin #

To use this plugin in your Flutter project, add backendless_sdk as a dependency in your pubspec.yaml file:

dependencies:
  backendless_sdk: ^0.3.0

STEP 2. Import the Backendless SDK: #

Add the following import to your Dart code

import 'package:backendless_sdk/backendless_sdk.dart';

STEP 3: Initialize the Backendless SDK #

Use the following call in your code:

@override
void initState() {
  super.initState();
  Backendless.initApp(APPLICATION_ID, ANDROID_API_KEY, IOS_API_KEY);
}

The APPLICATION_ID, ANDROID_API_KEY and IOS_API_KEY values must be obtained in Backendless Console:

  1. Login to your Backendless account and select the application.
  2. Click the Manage icon from the vertical icon-menu on the left.
  3. The App Settings section is selected by default. The interface contains values for Application ID and API keys for each supported client-side environment.
  4. Use the Copy icon to copy the value into the system clipboard.

STEP 4. Use the Backendless APIs. #

For example, here is a sample code which stores an object in Backendless database:

Backendless.initApp(APPLICATION_ID, ANDROID_API_KEY, IOS_API_KEY);
// create a Map object. This will become a record in a database table
Map testObject = new Map();

// add a property to the object. 
// The property name ("foo") will become a column in the database table
// The property value ("bar") will be stored as a value for the stored record
testObject["foo"] = "bar";

// Save the object in the database. The name of the database table is "TestTable".
Backendless.data.of("TestTable").save(testObject).then(
  (response) => print("Object is saved in Backendless. Please check in the console."));

0.3.0 #

  • Added Class to Table Mapping and Column Name Mapping.
  • Added FlutterBackendlessFCMService. Now you can handle notifications from Flutter.
  • Added the ability to publish and subscribe to custom classes.
  • A lot of fixes and improvements.

0.2.0 #

  • Add support for custom classes. To start working with custom classes, use the following method: Backendless.data.withClass<TestTable>().
  • Add methods Backendless.getHeaders, Backendless.setHeader, Backendless.removeHeader, and also Backendless.userService.getUserToken, Backendless.UserService.setUserToken.
  • Fixes and optimizations.

0.1.1 #

  • Remove redundant methods.
  • Fix encoding issues.

0.1.0 #

  • Add support for iOS.

0.0.4 #

  • Fixes and improvements.

0.0.3 #

  • Restructure the plugin.

0.0.2 #

  • Fix all analyzer hints.

0.0.1 #

  • Initial version for Android.

example/README.md

backendless_sdk_example #

Demonstrates how to use the backendless_sdk plugin.

Getting Started #

The sample code to store an object in Backendless database:

Backendless.initApp(APPLICATION_ID, ANDROID_API_KEY, IOS_API_KEY);
// create a Map object. This will become a record in a database table
Map testObject = new Map();

// add a property to the object. 
// The property name ("foo") will become a column in the database table
// The property value ("bar") will be stored as a value for the stored record
testObject["foo"] = "bar";

// Save the object in the database. The name of the database table is "TestTable".
Backendless.data.of("TestTable").save(testObject).then(
  (response) => print("Object is saved in Backendless. Please check in the console."));

Use this package as a library

1. Depend on it

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


dependencies:
  backendless_sdk: ^0.3.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support 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:backendless_sdk/backendless_sdk.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
73
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
86
Learn more about scoring.

We analyzed this package on Sep 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-0.42 points)

838 out of 855 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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
collection ^1.14.11 1.14.11 1.14.12
flutter 0.0.0
reflectable ^2.0.12 2.1.0
Transitive dependencies
analyzer 0.37.1+1 0.38.3
args 1.5.2
async 2.3.0
build 1.1.6 1.2.0
build_config 0.4.1+1
build_daemon 2.1.0
build_resolvers 1.0.8
build_runner_core 3.1.1 4.1.0
built_collection 4.2.2
built_value 6.7.1
charcode 1.1.2
checked_yaml 1.0.2
code_builder 3.2.0
convert 2.1.1
crypto 2.1.3
csslib 0.16.1
dart_style 1.2.10
fixnum 0.10.9
front_end 0.1.21+1 0.1.25
glob 1.1.7
graphs 0.2.0
html 0.14.0+2
http 0.12.0+2
http_multi_server 2.1.0
http_parser 3.1.3
io 0.3.3
js 0.6.1+1
json_annotation 3.0.0
kernel 0.3.21+1 0.3.25
logging 0.11.3+2
matcher 0.12.5
meta 1.1.7
mime 0.9.6+3
package_config 1.1.0
package_resolver 1.0.10
path 1.6.4
pedantic 1.8.0+1
pool 1.4.0
pub_semver 1.4.2
pubspec_parse 0.1.5
quiver 2.0.5
shelf 0.7.5
shelf_web_socket 0.2.3
sky_engine 0.0.99
source_span 1.5.5
stack_trace 1.9.3
stream_channel 2.0.0
stream_transform 0.0.19
string_scanner 1.0.5
term_glyph 1.1.0
timing 0.1.1+2
typed_data 1.1.6
vector_math 2.0.8
watcher 0.9.7+12
web_socket_channel 1.0.15
yaml 2.2.0
Dev dependencies
build_runner ^1.0.0 1.6.9 1.7.1
flutter_test