-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[google_maps_flutter] Modified
README.md
to fix minor syntax issues (…
…#6631) * Refactored Reaadme using code excerpts * Fixes * Updated Upstream and Fixed Test Errors * Re-added temp_exclude_excerpt.yaml back due to Failing Test * Restore deleted changelog entries Co-authored-by: stuartmorgan <stuartmorgan@google.com>
- Loading branch information
1 parent
1381802
commit da4321d
Showing
6 changed files
with
103 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/google_maps_flutter/google_maps_flutter/example/build.excerpt.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
targets: | ||
$default: | ||
sources: | ||
include: | ||
- lib/** | ||
# Some default includes that aren't really used here but will prevent | ||
# false-negative warnings: | ||
- $package$ | ||
- lib/$lib$ | ||
exclude: | ||
- '**/.*/**' | ||
# - '**/build/**' | ||
# builders: | ||
# code_excerpter|code_excerpter: | ||
# enabled: true |
72 changes: 72 additions & 0 deletions
72
packages/google_maps_flutter/google_maps_flutter/example/lib/readme_sample.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// ignore_for_file: public_member_api_docs | ||
|
||
import 'dart:async'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:google_maps_flutter/google_maps_flutter.dart'; | ||
|
||
void main() => runApp(const MyApp()); | ||
|
||
class MyApp extends StatelessWidget { | ||
const MyApp({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const MaterialApp( | ||
title: 'Flutter Google Maps Demo', | ||
home: MapSample(), | ||
); | ||
} | ||
} | ||
|
||
// #docregion MapSample | ||
class MapSample extends StatefulWidget { | ||
const MapSample({Key? key}) : super(key: key); | ||
|
||
@override | ||
State<MapSample> createState() => MapSampleState(); | ||
} | ||
|
||
class MapSampleState extends State<MapSample> { | ||
final Completer<GoogleMapController> _controller = | ||
Completer<GoogleMapController>(); | ||
|
||
static const CameraPosition _kGooglePlex = CameraPosition( | ||
target: LatLng(37.42796133580664, -122.085749655962), | ||
zoom: 14.4746, | ||
); | ||
|
||
static const CameraPosition _kLake = CameraPosition( | ||
bearing: 192.8334901395799, | ||
target: LatLng(37.43296265331129, -122.08832357078792), | ||
tilt: 59.440717697143555, | ||
zoom: 19.151926040649414); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: GoogleMap( | ||
mapType: MapType.hybrid, | ||
initialCameraPosition: _kGooglePlex, | ||
onMapCreated: (GoogleMapController controller) { | ||
_controller.complete(controller); | ||
}, | ||
), | ||
floatingActionButton: FloatingActionButton.extended( | ||
onPressed: _goToTheLake, | ||
label: const Text('To the lake!'), | ||
icon: const Icon(Icons.directions_boat), | ||
), | ||
); | ||
} | ||
|
||
Future<void> _goToTheLake() async { | ||
final GoogleMapController controller = await _controller.future; | ||
controller.animateCamera(CameraUpdate.newCameraPosition(_kLake)); | ||
} | ||
// #enddocregion MapSample | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters