Solved: Google map in flutter doesn't appear


Asked by Fatima H on March 30, 2019 (source).

I'm trying to follow this tutorial "" to add google map in flutter. I updated android manifest with google map key and added a permission for accessing fine_location.I get white screen on my emulator with no map. i spent many hours trying to fix it but in vain . i also tried the sample usage with plugin "" but nothing help in showing map . any help is appreciated thanks in advance


Question answered by Fatima H (source).

Actually I didn't find any answer through my search for issues in above tutorial. I find another way for map and it works fine with my so I'll post it, as it may help others. you need to 1- add it in pubspec.yaml to get plugin . 2- add the key for android and Ios 3- add this code in main.

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

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();

class _MyAppState extends State<MyApp> {
  GoogleMapController myMapController;
  final Set<Marker> _markers = new Set();
  static const LatLng _mainLocation = const LatLng(25.69893, 32.6421);
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
            appBar: AppBar(
              title: Text('Maps With Marker'),
            body: Column(
              children: <Widget>[
                  child: GoogleMap(
                    initialCameraPosition: CameraPosition(
                      target: _mainLocation,
                      zoom: 10.0,
                    markers: this.myMarker(),
                    mapType: MapType.normal,
                    onMapCreated: (controller) {
                      setState(() {
                        myMapController = controller;

  Set<Marker> myMarker() {
    setState(() {
        // This marker id can be anything that uniquely identifies each marker.
        markerId: MarkerId(_mainLocation.toString()),
        position: _mainLocation,
        infoWindow: InfoWindow(
          title: 'Historical City',
          snippet: '5 Star Rating',
        icon: BitmapDescriptor.defaultMarker,

    return _markers;