countries_world_map 0.0.7 countries_world_map: ^0.0.7 copied to clipboard
A simple widget for a customizable world map. Uses a custompainter to paint all countries & islands, which can all be colored based on the ISO two-letter countrycodes.
Online example is available at countriesworldmap.simplewidgets.dev
This package provides an easy to implement World Map (or any other country of choice) which is fully customizable. It started with only a simple world map but the goal is to create a customizable map for each country. In this case "customizable" means the ability to change the color of a country/ state.
About this package #
This flutter package draws a map of choice using the CustomPainter. These maps can be quite big so please read "Perfomance" below.
Available maps #
World & continents
|Africa||Asia||Australia/Oceania||Europe||Middle East||North America||South America|
Need a specific country? #
You can request a specific country by creating a new issue or send an email at firstname.lastname@example.org Please do keep in mind this is a side project. When I have time I will create the map as soon as possible.
Tips for UI #
Wrap the WorldMap in an InteractiveViewer widget.
Using InteractiveView enables you to zoom in and out on specific countries as done in the online example. In the example the InteractiveViewer has a maxScale of 75.
Set the WorldMap to 92% of the available width to make it look more centered.
Use your own CustomPaint.
If the WorldMap/ CountryMap widget does not give the results you would like to see, you can also use the WorldMapPainter/ CountryPainter in your own defined CustomPaint. This will give you all the paths with the option to custom color each country.
Simply add CountrynamePainter to your CustomPaint widget and you are ready to go.
Some of the maps are really big, so (re)building the widget can be expensive. That's why the default Widget uses a RepaintBoundry to prevent it from unnecessary repaints. If you change a Country Color and call SetState() the widget will repaint.
! Warning #
On the iPad Pro 2018 there has been found some memory issues when re-painting the WorldMap many times in a short time period. If you have memory issues, you might want to limit the possible repaints.
Like to contribute? #
Feel free to help us improve this package by creating issues, pull request etc. Together we can make a great map for data visualization and other use cases. For any questions you can email email@example.com