free_mobile 3.2.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 49

Free Mobile for Dart

Runtime Release License Coverage Build

Send SMS messages to your Free Mobile account, in Dart.

To use this library, you must have enabled SMS Notifications in the Options of your Subscriber Area.

Requirements

The latest Dart SDK and Pub versions. If you plan to play with the sources, you will also need the latest Grinder version.

Installing via Pub

1. Depend on it

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

dependencies:
  free_mobile: *
  http: *

2. Install it

Install this package and its dependencies from a command prompt:

$ pub get

3. Import it

Now in your Dart code, you can use:

import 'package:free_mobile/free_mobile.dart';
import 'package:http/http.dart' as http;

Usage

This package provides a single class, Client, which allow to send messages to your mobile phone by using the sendMessage() method:

try {
  var client = new Client('your user name', 'your identification key');
  await client.sendMessage('Hello World!');
  print('The message was sent successfully.');
}

on http.ClientException catch (err) {
  print('An error occurred: $err');
}

The method returns a Future that completes when the message has been sent. If an error occurred, a ClientException is thrown.

The text of the messages will be automatically truncated to 160 characters: you can't send multipart messages using this library.

Events

The Client class triggers some events during its life cycle:

  • request : emitted every time a request is made to the remote service.
  • response : emitted every time a response is received from the remote service.

These events are exposed as Stream, you can listen to them using the on<EventName> properties:

client.onRequest.listen((request) => print('Client request: ${request.url}'));
client.onResponse.listen((response) => print('Server response: ${response.statusCode}'));

Unit tests

In order to run the tests, you must set two environment variables:

$ export FREEMOBILE_USERNAME="<your Free Mobile user name>"
$ export FREEMOBILE_PASSWORD="<your Free Mobile identification key>"

Then, you can run the test script from the command prompt:

$ pub run test

See also

License

Free Mobile for Dart is distributed under the MIT License.

Changelog

This file contains highlights of what changes on each version of the Free Mobile for Dart library.

Version 3.2.0

  • Added support for browser platform.

Version 3.1.0

  • Updated the package dependencies.

Version 3.0.0

  • Breaking change: changed the signature of the constructor.
  • Breaking change: raised the required Dart version.
  • Breaking change: the class properties are now read-only.
  • Breaking change: removed the toJson() and toString() methods.
  • Changed licensing for the MIT License.
  • Updated the package dependencies.

Version 2.0.0

  • Breaking change: renamed the endPoint constant to defaultEndPoint.
  • Added the endPoint property.

Version 1.0.0

  • Breaking change: raised the required Dart version.
  • Updated the package dependencies.

Version 0.1.0

  • Initial release.

1. Depend on it

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


dependencies:
  free_mobile: "^3.2.0"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:free_mobile/free_mobile.dart';
        
Version Uploaded Documentation Archive
3.2.0 Dec 7, 2017 Go to the documentation of free_mobile 3.2.0 Download free_mobile 3.2.0 archive
3.1.0 Nov 3, 2017 Go to the documentation of free_mobile 3.1.0 Download free_mobile 3.1.0 archive
3.0.0 Oct 4, 2017 Go to the documentation of free_mobile 3.0.0 Download free_mobile 3.0.0 archive
2.0.0 May 27, 2017 Go to the documentation of free_mobile 2.0.0 Download free_mobile 2.0.0 archive
1.0.0 Mar 25, 2017 Go to the documentation of free_mobile 1.0.0 Download free_mobile 1.0.0 archive
0.1.0 Dec 29, 2016 Go to the documentation of free_mobile 0.1.0 Download free_mobile 0.1.0 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
96 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
49

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:free_mobile/free_mobile.dart.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use free_mobile.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.24.0 <2.0.0
http ^0.11.3 0.11.3+16
Transitive dependencies
async 2.0.3
charcode 1.1.1
collection 1.14.5
http_parser 3.1.1
path 1.5.1
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
coverage ^0.9.3
coveralls ^2.1.0
grinder ^0.8.0
test ^0.12.29