googlemaps-samples / codelab-maps-platform-101-flutter Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Cannot find the file – ios/Podfile
, mentioned there.
I feel the tutorial seems to be outdated. I think they should update the tutorial itself.
Target url doesn't exist: import 'package:google_maps_flutter/google_maps_flutter.dart';
please update this
The section under Adding an API key for an iOS app
You also need to add a setting to ios/Runner/Info.plist. This entry forces Flutter on iOS into a single threaded mode, which is required for the platform view embedding to work. This technical restriction is being worked on and will be lifted before Google Maps moves out of Developer Preview.
Mentions that
This technical restriction is being worked on and will be lifted before Google Maps moves out of Developer Preview.
Google Maps is out of developer preview right?
I'm using google_maps_flutter: ^0.5.11
I just wanna know that how can i fix it .. thankx
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
class Mapper extends StatefulWidget {
@override
_MapperState createState() => _MapperState();
}
class _MapperState extends State<Mapper> {
static const LatLng centerMap = const LatLng(13.756676, 100.501922);
CameraPosition cameraPosition = CameraPosition(
target:centerMap,
zoom:12.0,
);
Widget myMap(){
return GoogleMap(
mapType: MapType.normal,
zoomGesturesEnabled: true,
initialCameraPosition: cameraPosition,
onMapCreated: (GoogleMapController googleMapController){},
markers: ewtcMarker(),
);
}
Set<Marker> ewtcMarker(){
return <Marker>[
Marker(
position: centerMap,
markerId: MarkerId('idEWTC'),
)
].toSet();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: <Widget>[
Expanded(
flex: 5,
child: myMap(),
),
Expanded(
flex: 2,
child: Center(
child: Text('Scan Result'),
),
),
FloatingActionButton(
onPressed: () {
debugPrint('Clicked');
},
child: Icon(Icons.add),
),
],
));
}
}
I am getting following error, when I am trying to display GoogleMap inside a column widget.
Column(
children: [
GoogleMap(
mapType: MapType.normal,
initialCameraPosition: CameraPosition(target: _center, zoom: 15),
),
],
)
I/flutter ( 4678): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter ( 4678): The following assertion was thrown during performResize():
I/flutter ( 4678): FlutterError contained multiple error summaries.
I/flutter ( 4678): All FlutterError objects should have only a single short (one line) summary description of the
I/flutter ( 4678): problem that was detected.
I/flutter ( 4678): Malformed FlutterError:
I/flutter ( 4678): RenderAndroidView object was given an infinite size during layout.
I/flutter ( 4678): This probably means that it is a render object that tries to be as big as possible, but it was put
I/flutter ( 4678): inside another render object that allows its children to pick their own size.
I/flutter ( 4678): RenderAndroidView object was given an infinite size during layout.
I/flutter ( 4678): This probably means that it is a render object that tries to be as big as possible, but it was put
I/flutter ( 4678): inside another render object that allows its children to pick their own size.
I/flutter ( 4678): The nearest ancestor providing an unbounded height constraint is: RenderFlex#7b34e relayoutBoundary=up1 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
I/flutter ( 4678): creator: Column ← MediaQuery ← LayoutId-[<_ScaffoldSlot.body>] ← CustomMultiChildLayout ←
I/flutter ( 4678): AnimatedBuilder ← DefaultTextStyle ← AnimatedDefaultTextStyle ← _InkFeatures-[GlobalKey#2e935 ink
I/flutter ( 4678): renderer] ← NotificationListener ← PhysicalModel ←
I/flutter ( 4678): AnimatedPhysicalModel ← Material ← ⋯
I/flutter ( 4678): parentData: offset=Offset(0.0, 0.0); id=_ScaffoldSlot.body (can use size)
I/flutter ( 4678): constraints: BoxConstraints(0.0<=w<=360.0, 0.0<=h<=592.0)
I/flutter ( 4678): size: MISSING
I/flutter ( 4678): direction: vertical
I/flutter ( 4678): mainAxisAlignment: start
I/flutter ( 4678): mainAxisSize: max
I/flutter ( 4678): crossAxisAlignment: center
I/flutter ( 4678): verticalDirection: down
I/flutter ( 4678): The constraints that applied to the RenderAndroidView were:
I/flutter ( 4678): BoxConstraints(0.0<=w<=360.0, 0.0<=h<=Infinity)
I/flutter ( 4678): The exact size it was given was:
I/flutter ( 4678): Size(360.0, Infinity)
I/flutter ( 4678): See https://flutter.dev/docs/development/ui/layout/box-constraints for more information.
I/flutter ( 4678):
I/flutter ( 4678): The malformed error has 2 summaries.
I/flutter ( 4678): Summary 1: RenderAndroidView object was given an infinite size during layout.
I/flutter ( 4678): Summary 2: RenderAndroidView object was given an infinite size during layout.
I/flutter ( 4678):
I/flutter ( 4678): This error should still help you solve your problem, however please also report this malformed error
I/flutter ( 4678): in the framework by filing a bug on GitHub:
I/flutter ( 4678): https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter ( 4678):
I/flutter ( 4678): When the exception was thrown, this was the stack:
I/flutter ( 4678): #0 new FlutterError.fromParts. (package:flutter/src/foundation/assertions.dart:540:9)
I/flutter ( 4678): #1 new FlutterError.fromParts (package:flutter/src/foundation/assertions.dart:543:6)
I/flutter ( 4678): #2 RenderBox.debugAssertDoesMeetConstraints. (package:flutter/src/rendering/box.dart:1966:28)
I/flutter ( 4678): #3 RenderBox.debugAssertDoesMeetConstraints (package:flutter/src/rendering/box.dart:2029:6)
I/flutter ( 4678): #4 RenderBox.size=. (package:flutter/src/rendering/box.dart:1740:7)
I/flutter ( 4678): #5 RenderBox.size= (package:flutter/src/rendering/box.dart:1742:6)
I/flutter ( 4678): #6 RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:169:5)
I/flutter ( 4678): #7 RenderObject.layout (package:flutter/src/rendering/object.dart:1604:9)
I/flutter ( 4678): #8 RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:743:15)
I/flutter ( 4678): #9 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #10 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:142:11)
I/flutter ( 4678): #11 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:443:7)
I/flutter ( 4678): #12 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:212:7)
I/flutter ( 4678): #13 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:356:14)
I/flutter ( 4678): #14 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #15 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #16 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #17 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #18 _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1214:11)
I/flutter ( 4678): #19 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #20 RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:206:11)
I/flutter ( 4678): #21 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #22 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #23 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #24 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #25 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #26 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #27 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #28 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #29 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #30 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #31 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #32 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #33 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #34 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #35 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #36 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #37 RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:3076:13)
I/flutter ( 4678): #38 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #39 RenderStack.performLayout (package:flutter/src/rendering/stack.dart:510:15)
I/flutter ( 4678): #40 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #41 __RenderTheatre&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #42 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #43 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #44 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #45 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #46 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #47 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #48 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #49 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4678): #50 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7)
I/flutter ( 4678): #51 RenderView.performLayout (package:flutter/src/rendering/view.dart:151:13)
I/flutter ( 4678): #52 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1496:7)
I/flutter ( 4678): #53 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:765:18)
I/flutter ( 4678): #54 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:346:19)
I/flutter ( 4678): #55 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:701:13)
I/flutter ( 4678): #56 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:285:5)
I/flutter ( 4678): #57 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1016:15)
I/flutter ( 4678): #58 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:958:9)
I/flutter ( 4678): #59 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.scheduleWarmUpFrame. (package:flutter/src/scheduler/binding.dart:784:7)
I/flutter ( 4678): #61 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)
I/flutter ( 4678): #62 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
I/flutter ( 4678): #63 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
I/flutter ( 4678): (elided one frame from package dart:async-patch)
I/flutter ( 4678):
I/flutter ( 4678): The following RenderObject was being processed when the exception was fired: RenderAndroidView#bde04 NEEDS-LAYOUT NEEDS-PAINT:
I/flutter ( 4678): needs compositing
I/flutter ( 4678): creator: _AndroidPlatformView ← _FocusMarker ← Focus ← AndroidView ← GoogleMap ← Column ← MediaQuery
I/flutter ( 4678): ← LayoutId-[<_ScaffoldSlot.body>] ← CustomMultiChildLayout ← AnimatedBuilder ← DefaultTextStyle ←
I/flutter ( 4678): AnimatedDefaultTextStyle ← ⋯
I/flutter ( 4678): parentData: offset=Offset(0.0, 0.0); flex=null; fit=null (can use size)
I/flutter ( 4678): constraints: BoxConstraints(0.0<=w<=360.0, 0.0<=h<=Infinity)
I/flutter ( 4678): semantic boundary
I/flutter ( 4678): size: Size(360.0, Infinity)
I/flutter ( 4678): This RenderObject has no descendants.
I/flutter ( 4678): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter ( 4678): Another exception was thrown: FlutterError contained multiple error summaries.
I/flutter ( 4678): Another exception was thrown: A RenderFlex overflowed by Infinity pixels on the bottom.
Reloaded 8 of 901 libraries in 1,394ms.
I got this error when I was following the code lab
Generator cannot target libraries that have not been migrated to null-safety. package:nearme/src/locations.dart:10:7 ╷ 10 │ class LatLng { │ ^^^^^^ ╵ [SEVERE] Failed after 95ms pub finished with exit code 1
Environment: AndroidStudio 3.5.2
Flutter doctor output:
[✓] Flutter (Channel master, v1.12.16-pre.35, on Linux, locale en_US.UTF-8)
• Flutter version 1.12.16-pre.35 at /home/jmullen/Projects/idz/flutter
• Framework revision b9a56b9f48 (3 days ago), 2019-11-29 20:40:44 -0500
• Engine revision 8672e79af8
• Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /home/jmullen/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /home/jmullen/apps/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang++ 7.0.1
• GNU Make 4.2.1
[✓] Android Studio (version 3.5)
• Android Studio at /home/jmullen/apps/android-studio
• Flutter plugin version 41.1.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (5 available)
• LG H931 • LGH9315c0ae7c4 • android-arm64 • Android 9
(API 28)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10
(API 29) (emulator)
• Linux • Linux • linux-x64 • Linux
• Chrome • chrome • web-javascript • Google
Chrome 78.0.3904.108
• Web Server • web-server • web-javascript • Flutter
Tools
• No issues found!
I created an API key for use on Android and added it to the manifest file. However I was seeing a message something like 'API not authorized' when I ran the app (via AndroidStudio) on my LG V30 phone. Also, the app ran but no map displayed. I eventually figured out that I needed to enable the "Maps SDK for Android" API in Google Cloud Platform. (IOS users probably need to enable the Maps SDK for iOS as well. It would be helpful to explicitly state this.
https://codelabs.developers.google.com/codelabs/google-maps-in-flutter/#5
_markers[office.name] = marker;
// should be
setState(() {
_markers[office.name] = marker;
});
I've followed the instructions 3-4 times, but I keep getting the same result. I even tried updating to the 0.5.31 version of the google maps plugin. I tried a different center point, but still no map.
I get the same result on Android as well. Also cloning the code here and running it produces the same issue.
The widget seems to draw (see google logo and location icon at the bottom), but no actual map shows up. I'm at a loss.
Unable to find file while writing code following guide document.
I created a new plutter project through the Android studio, and my Runner folder looks like this.
There are no AppDelegate.m and AppDelegate.h files, but only AppDelegate.swift file exist. How do I proceed with the guide in this case?
New version of flatter app does not generate ios/Runner/AppDelegate.m
, it's creating AppDelegate.swift
file & instruction to update can be taken from here
if I had the following line :
google_maps_flutter: ^0.5.11
My App won't launch even if it wsa launching right before.
FAILURE: Build failed with an exception.
Android dependency 'com.google.android.gms:play-services-base' has different version for the compile (15.0.1) and runtime (16.0.1) classpath. You should manually set the same version via DependencyResolution
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.