navigine_sdk 1.0.1+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 61

navigine #

A new flutter plugin project.

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

1.0.1+1 #

  • Fixed type conversion issue on java file

1.0.1 #

  • Added addTarget and makeRoute function on NavigationThread

1.0.0+1 #

  • Minor parameter value altered

1.0.0 #

  • Final stable release

0.0.1 #

  • TODO: Describe initial release.

example/lib/main.dart

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

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

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

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: HomeScreen(),
      ),
    );
  }
}

class HomeScreen extends StatefulWidget {
  @override
  _HomeScreenState createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  NavigineSDK navigine;
  NavigationThread thread;

  double progress = 0.0;

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

  Future<void> initPlatformState() async {
    navigine = await NavigineSDK.initializeSDK(
      userHash: "3F77-4634-FCEE-2423",
    );
    loadLocation();
  }

  loadLocation() async {
    await navigine.loadLocation(
      locationId: 31027,
      onSuccess: () {
        print('Success');
        // This is a test.
        startNavigation();
      },
      onFailed: (code) {
        print("Failed $code");
      },
      onUpdate: (state) {
        setState(() {
          progress = state / 100;
        });
      },
    );
  }

  startNavigation() async {
    thread = await NavigationThread.startNavigation();
    setState(() {});

    print(await thread.getLocation());

    print(await thread.getDeviceInfo());
  }

  StreamSubscription<DeviceInfo> stream;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          children: <Widget>[
            FlatButton(
              child: Text("Get Location"),
              onPressed: thread != null
                  ? () async {
                      Location l = await thread.getLocation();
                      print(l.name);
                      print(l.version);

                      stream = thread.getDeviceInfoListener().listen((dI) {
                        print(dI.x);
                        print(dI.y);
                      });
                    }
                  : null,
            ),
            FlatButton(
                child: Text("Stop Location"),
                onPressed: () {
                  stream.cancel();
                }),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  navigine_sdk: ^1.0.1+1

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

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

  • Dart: 2.8.4
  • pana: 0.13.9+1
  • Flutter: 1.17.3

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:navigine_sdk/navigine_sdk.dart]

Package does not support Flutter platform macos

Because of import path [package:navigine_sdk/navigine_sdk.dart]

Package does not support Flutter platform web

Because of import path [package:navigine_sdk/navigine_sdk.dart]

Package does not support Flutter platform windows

Because of import path [package:navigine_sdk/navigine_sdk.dart]

Package not compatible with SDK dart

because of import path [navigine_sdk]

Health issues and suggestions

Document public APIs. (-0.88 points)

243 out of 244 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.

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://bitbucket.org/snowm_c/navigine-flutter-sdk.git/src was unreachable.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
meta ^1.1.6 1.1.8 1.2.0
Transitive dependencies
collection 1.14.12 1.14.13
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test