How to Change theme of google map according to app theme (Dark & Light)?

enter image description here

enter image description here

Change the view of map according to view of map in flutter app.

>Solution :

Check out this website to choose the dark and light theme you would like to use. Click on “Finish” in order to generate the two JSON files that you will download.

import this file as an asset in your project. I recommend you isolate this file in a new folder and add it to the pubspec.yaml file.


Add the following method to your map file,

void initState() {

Future _loadMapStyles() async {
  _darkMapStyle  = await rootBundle.loadString('assets/json/dark_mode_style.json');

add style with the googleMapController like,

if (theme == Brightness.dark)

Manage the following style according to your logic.

Leave a Reply