yandex_mapkit_lite 0.0.1
yandex_mapkit_lite: ^0.0.1 copied to clipboard
This is a lightweight fork of the yandex_mapkit package version 3.4.0.
import 'package:flutter/material.dart';
import 'package:yandex_mapkit_lite/yandex_mapkit_lite.dart';
import 'package:yandex_mapkit_example/examples/widgets/map_page.dart';
import 'package:yandex_mapkit_example/examples/circle_map_object_page.dart';
import 'package:yandex_mapkit_example/examples/clusterized_placemark_collection_page.dart';
import 'package:yandex_mapkit_example/examples/map_controls_page.dart';
import 'package:yandex_mapkit_example/examples/map_object_collection_page.dart';
import 'package:yandex_mapkit_example/examples/placemark_map_object_page.dart';
import 'package:yandex_mapkit_example/examples/polyline_map_object_page.dart';
import 'package:yandex_mapkit_example/examples/polygon_map_object_page.dart';
import 'package:yandex_mapkit_example/examples/user_layer_page.dart';
void main() {
runApp(const MaterialApp(home: MainPage()));
}
const List<MapPage> _allPages = <MapPage>[
MapControlsPage(),
ClusterizedPlacemarkCollectionPage(),
MapObjectCollectionPage(),
PlacemarkMapObjectPage(),
PolylineMapObjectPage(),
PolygonMapObjectPage(),
CircleMapObjectPage(),
UserLayerPage(),
];
class MainPage extends StatelessWidget {
const MainPage({Key? key}) : super(key: key);
void _pushPage(BuildContext context, MapPage page) {
Navigator.push(
context,
MaterialPageRoute<void>(
builder: (_) => Scaffold(
appBar: AppBar(title: Text(page.title)),
body:
Container(padding: const EdgeInsets.all(8), child: page))));
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('YandexMap examples')),
body: Column(children: <Widget>[
Expanded(
child: Container(
padding: const EdgeInsets.all(8), child: const YandexMap())),
Expanded(
child: ListView.builder(
itemCount: _allPages.length,
itemBuilder: (_, int index) => ListTile(
title: Text(_allPages[index].title),
onTap: () => _pushPage(context, _allPages[index]),
),
))
]));
}
}