graphhoper_route 0.0.7
graphhoper_route: ^0.0.7 copied to clipboard

Flutter Android iOS

Offline routing using Graphhopper JAVA lib on Android

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:graphhoper_route/graphhoper_route.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();
  }

  Future<void> initPlatformState() async {
    String platformVersion;
    try {
      platformVersion =
          await GraphhoperRoute.getRouteAsLatLng(points: [1, 2, 3, 4]);
    } on PlatformException {
      platformVersion = 'Failed to get route';
    }

    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'),
        ),
      ),
    );
  }
}
1
likes
70
pub points
1%
popularity

Offline routing using Graphhopper JAVA lib on Android

Homepage

Documentation

API reference

Uploader

nishon@naxa.com.np

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on graphhoper_route