dart_n26 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

Dart N26 Api Client #

Tests codecov
Unofficial dart client for the N26 api. The purpose of this client is only to retrieve data, not to send payments or change settings.

Authentication #

To get a valid token from the API a 2-factor authentication is required. After calling the 'authorize' method, you will receive a pop-up message on your paired smartphone, which will ask you to tap to confirm that the sign in attempt is legitimate. confirm that and complete the completer passed to the authorize method.

Example Usage #

import 'dart:async';
import 'package:http/http.dart';
import 'package:dart_n26/dart_n26.dart';

void main() async {
  // Replace these variables with your real credentials
  var email = 'YOUR N26 LOGIN EMAIL';
  var password = 'YOUR PASSWORD';

  var client = Client();
  var api = Api(client, Auth(client));

  var completer = Completer();
  completer.complete(Future.delayed(Duration(seconds: 20)));

  await api.authorize(email, password, completer);

  var transactions = await api.getTransactions(
    from: DateTime.now().subtract(Duration(days: 1)),
    to: DateTime.now(),
  );
  var profile = await api.getProfile();
  var accounts = await api.getAccounts();
  var statuses = await api.getStatuses();
  var addresses = await api.getAddresses();
  var cards = await api.getCards();
  var limits = await api.getLimits();
  var spaces = await api.getSpaces();
  var contacts = await api.getContacts();
  var statements = await api.getStatements();
  var statement = await api.getStatement(statements[0].id);
}

Changelog #

0.1.2 #

  • Fix formatting issues and re-add example

0.1.0 #

  • Initial Version

example/main.dart

import 'dart:async';
import 'package:http/http.dart';
import 'package:dart_n26/dart_n26.dart';

void main() async {
  // Replace these variables with your real credentials
  var email = 'YOUR N26 LOGIN EMAIL';
  var password = 'YOUR PASSWORD';

  var client = Client();
  var api = Api(client, Auth(client));

  var completer = Completer();
  completer.complete(Future.delayed(Duration(seconds: 20)));

  await api.authorize(email, password, completer);

  var transactions = await api.getTransactions(
    from: DateTime.now().subtract(Duration(days: 1)),
    to: DateTime.now(),
  );
  var profile = await api.getProfile();
  var accounts = await api.getAccounts();
  var statuses = await api.getStatuses();
  var addresses = await api.getAddresses();
  var cards = await api.getCards();
  var limits = await api.getLimits();
  var spaces = await api.getSpaces();
  var contacts = await api.getContacts();
  var statements = await api.getStatements();
  var statement = await api.getStatement(statements[0].id);
}

Use this package as a library

1. Depend on it

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


dependencies:
  dart_n26: ^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:dart_n26/dart_n26.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
1
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]
50
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.13

Health issues and suggestions

Document public APIs. (-0.12 points)

480 out of 495 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.7.0 <3.0.0
http ^0.12.0 0.12.1
Transitive dependencies
charcode 1.1.3
collection 1.14.13
http_parser 3.1.4
meta 1.1.8
path 1.7.0
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0
Dev dependencies
mockito ^4.1.1
pedantic ^1.8.0 1.9.0 1.9.1
test ^1.6.0
test_coverage ^0.3.0