swiss_public_transport_plugin 0.1.8

  • Readme
  • Changelog
  • Example
  • Installing
  • 53

swiss_public_transport_plugin #

A plugin to communicate directly with the Swiss Public Transport backend.

0.0.1 #

  • Inital release

0.0.2 #

  • Updated pugin info

0.0.3 #

  • Updated pugin info
  • Added Licence

0.0.4 #

  • Added repository

0.0.5 #

  • Removed mock implementations

0.0.6 #

  • Improved Packages

0.0.7 #

  • Fixed issue where Android would not build

0.0.8 #

  • Fixed issue where Android would not build

0.1.0 #

  • Fixed issue where number is not a number

0.1.1 #

  • Fixed issue where number is not a number

0.1.2 #

  • Removed debug logs

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:swiss_public_transport_plugin/swiss_public_transport_plugin.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String platformVersion;
    // Platform messages may fail, so we use a try/catch PlatformException.
    
    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_platformVersion\n'),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  swiss_public_transport_plugin: ^0.1.8

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:swiss_public_transport_plugin/swiss_public_transport_plugin.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
12
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
53
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health issues and suggestions

Document public APIs. (-1 points)

105 out of 105 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/models/journey.dart. (-0.50 points)

Analysis of lib/models/journey.dart reported 1 hint:

line 9 col 31: 'onError' is deprecated and shouldn't be used.

Fix lib/swiss_public_transport_plugin.dart. (-0.50 points)

Analysis of lib/swiss_public_transport_plugin.dart reported 1 hint:

line 8 col 30: The value of the field '_channel' isn't used.

Format lib/models/pass.dart.

Run flutter format to format lib/models/pass.dart.

Format lib/models/sections.dart.

Run flutter format to format lib/models/sections.dart.

Format lib/models/walk.dart.

Run flutter format to format lib/models/walk.dart.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (location).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
http ^0.12.0+2 0.12.0+4
location ^2.3.5 2.5.4 3.0.1
Transitive dependencies
async 2.4.1
charcode 1.1.3
collection 1.14.11 1.14.12
http_parser 3.1.4
meta 1.1.8
path 1.6.4
pedantic 1.9.0
sky_engine 0.0.99
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test