Skip to content

Commit

Permalink
V2.
Browse files Browse the repository at this point in the history
  • Loading branch information
xclud committed Feb 6, 2024
1 parent c95fa2c commit 81654b7
Show file tree
Hide file tree
Showing 26 changed files with 254 additions and 132 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [2.0.0]

* Dependencies updated.

## [1.4.2]

* Dart 3.0 ready.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ import 'package:map/map.dart';

```dart
final controller = MapController(
location: const LatLng(0, 0),
location: const LatLng(Angle.degree(Angle.degree(0)), Angle.degree(Angle.degree(0))),
zoom: 2,
);
```
Expand Down
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ analyzer:
sort_unnamed_constructors_first: error
use_function_type_syntax_for_parameters: error
use_key_in_widget_constructors: error
use_string_in_part_of_directives: error
unnecessary_import: error
unnecessary_string_interpolations: error
unnecessary_this: error
Expand Down
3 changes: 3 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ class HomePage extends StatefulWidget {
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);

return Scaffold(
appBar: AppBar(
backgroundColor: theme.colorScheme.inversePrimary,
title: const Text('Map Examples'),
),
body: ListView(
Expand Down
4 changes: 2 additions & 2 deletions example/lib/pages/custom_tile_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class CustomTilePage extends StatefulWidget {

class CustomTilePageState extends State<CustomTilePage> {
final controller = MapController(
location: const LatLng(35.68, 51.41),
location: const LatLng(Angle.degree(35.68), Angle.degree(51.41)),
);

void _gotoDefault() {
controller.center = const LatLng(35.68, 51.41);
controller.center = const LatLng(Angle.degree(35.68), Angle.degree(51.41));
setState(() {});
}

Expand Down
7 changes: 5 additions & 2 deletions example/lib/pages/interactive_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ class InteractiveMapPage extends StatefulWidget {

class InteractiveMapPageState extends State<InteractiveMapPage> {
final controller = MapController(
location: const LatLng(35.68, 51.41),
location: const LatLng(Angle.degree(35.68), Angle.degree(51.41)),
);

void _gotoDefault() {
controller.center = const LatLng(35.68, 51.41);
controller.center = const LatLng(
Angle.degree(35.68),
Angle.degree(51.41),
);
setState(() {});
}

Expand Down
15 changes: 8 additions & 7 deletions example/lib/pages/markers_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ class MarkersPage extends StatefulWidget {

class MarkersPageState extends State<MarkersPage> {
final controller = MapController(
location: const LatLng(35.68, 51.41),
location: const LatLng(Angle.degree(35.68), Angle.degree(51.41)),
);

final markers = [
const LatLng(35.674, 51.41),
const LatLng(35.678, 51.41),
const LatLng(35.682, 51.41),
const LatLng(35.686, 51.41),
const LatLng(Angle.degree(35.674), Angle.degree(51.41)),
const LatLng(Angle.degree(35.678), Angle.degree(51.41)),
const LatLng(Angle.degree(35.682), Angle.degree(51.41)),
const LatLng(Angle.degree(35.686), Angle.degree(51.41)),
];

void _gotoDefault() {
controller.center = const LatLng(35.68, 51.41);
controller.center = const LatLng(Angle.degree(35.68), Angle.degree(51.41));
setState(() {});
}

Expand Down Expand Up @@ -106,7 +106,8 @@ class MarkersPageState extends State<MarkersPage> {
(pos) => _buildMarkerWidget(pos, Colors.red),
);

final homeLocation = transformer.toOffset(const LatLng(35.68, 51.42));
final homeLocation = transformer
.toOffset(const LatLng(Angle.degree(35.68), Angle.degree(51.42)));

final homeMarkerWidget =
_buildMarkerWidget(homeLocation, Colors.black, Icons.home);
Expand Down
Loading

0 comments on commit 81654b7

Please sign in to comment.