v4_navigation_engine 0.1.25 v4_navigation_engine: ^0.1.25 copied to clipboard
Native custom Mapbox navigation for Mile projects.
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:v4_navigation_engine/v4_navigation_lib.dart';
import 'package:v4_navigation_engine_example/about.dart';
import 'package:v4_navigation_engine_example/navigation_v4.dart';
import 'package:v4_navigation_engine_example/navigation_white_label.dart';
void main() {
runApp(
MaterialApp(
initialRoute: MyApp.routeName,
routes: {
MyApp.routeName : (context) => MyApp(),
About.routeName : (context) => About(),
},
)
);
}
class MyApp extends StatefulWidget {
static String routeName = "/";
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
//For iOS ONLY
static const platform = const MethodChannel('com.mile.v4_navigation_engine_example/view_controller');
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Mile Navigation Plugin'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
InkWell(
onTap: () {
Navigator.push(context,
MaterialPageRoute(
builder: (context) => NavigationV4(mode: NavigationMode.NAVIGATE_IN_ROUTE),
),
);
},
child: Container(
height: 36,
width: 200,
color: Colors.blue,
child: Center(
child: Text(
"NAVIGATION V4",
style: TextStyle(
color: Colors.white,
),
),
),
)
),
Container(height: 20,),
InkWell(
onTap: () {
Navigator.push(context,
MaterialPageRoute(
builder: (context) => NavigationWhiteLabel(mode: NavigationMode.NAVIGATE_TO_POI),
),
);
},
child: Container(
height: 36,
width: 200,
color: Colors.blue,
child: Center(
child: Text(
"NAVIGATOR WHITELABEL",
style: TextStyle(
color: Colors.white,
),
),
),
)
),
],
),
);
}
}