google_map_iframe

Last updated:

0 purchases

google_map_iframe Image
google_map_iframe Images
Add to Cart

Description:

google map iframe

Google Map Iframe #
A minimal way to embed google maps in flutter project.
Android Setup #
Set the correct minSdkVersion in android/app/build.gradle (if it was previously lower than 19):
android {
defaultConfig {
minSdkVersion 19
}
}
copied to clipboard
iOS Setup #
No Setup Required
🔨 Installation #
dependencies:
google_map_iframe: ^0.0.1
copied to clipboard
Import #
import 'package:google_map_iframe/google_map_iframe.dart';
copied to clipboard
Usage #
//Create a instance of GoogleMapIframe
var map = GoogleMapIframe(
apiKey: 'YOUR API KEY',
width: MediaQuery.of(context).size.width,
height: 250,
)

// Use it
map.fromLatLng('10.305385', '77.923029')
copied to clipboard
Example #

import 'package:flutter/material.dart';
import 'package:google_map_iframe/google_map_iframe.dart';

void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key? key, required this.title}) : super(key: key);

final String title;

@override
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: GoogleMapIframe(
apiKey: 'AIzaSyAQnYinSuCc5pBRQxDsH2jeSWO5E7vcNto',
width: MediaQuery.of(context).size.width,
height: 250,
).fromLatLng('10.305385', '77.923029'),
),
);
}
}


copied to clipboard
For help getting started with Flutter, view our
online documentation, which offers tutorials,
samples, guidance on mobile development, and a full API reference.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.