carillon_map_box 0.0.7+9 copy "carillon_map_box: ^0.0.7+9" to clipboard
carillon_map_box: ^0.0.7+9 copied to clipboard

A new Flutter plugin.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:carillon_map_box/carillon_map_box.dart';
import 'package:carillon_map_box/models.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    Map<String, dynamic> options = {
      "mapStyleUrl": "mapbox://styles/carillon/ckwroj8nx14d815nvidt3jwea",
      // DAY -> mapbox://styles/carillon/ckwroj8nx14d815nvidt3jwea
      // NIGHT -> mapbox://styles/carillon/ckwrokzci2fh214mk66vm3tai
      "simulateRoute": true,
      "points": [
        CarillonLocation(
                id: 0, address: "plaisir", latitude: 48.824810, longitude: 1.965922)
            .toJson(),
        CarillonLocation(
                id: 1, address: "clamart", latitude: 48.8, longitude: 2.25)
            .toJson()
      ]
    };

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('CarillonMapBox Example (convenient)'),
        ),
        body: Center(
          child: CarillonMapBox(
              onCarillonMapBoxCreated: _onCarillonMapBoxCreated,
              options: options),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            CarillonMapBox.startNavigation(options, () {
              print("Start CALLBACK !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
            }, () {
              print("End CALLBACK !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
            });
            Future.delayed(const Duration(seconds: 10), () {
              CarillonMapBox.sendAlert(() {
                print("popup button CALLBACK !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
              });
            });
          },
        ),
      ),
    );
  }

  void _onCarillonMapBoxCreated(CarillonMapBoxController controller) {}
}
2
likes
100
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter plugin.

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on carillon_map_box