Using Geolocator to Communicate with the GPS and Build a Map in Dart's Flutter Framework

in #utopian-io6 years ago (edited)

What Will I Learn?

  • You will learn about the Geolocator Flutter plugin
  • You will learn how to ping the GPS in a Flutter application
  • You will learn how to use Google's static map API to build a map in Flutter
  • You will learn how to use Streams to fetch Channel Messages

Requirements

Difficulty

  • Intermediate

Description

In this Flutter video tutorial, we look at the various applications of the Geolocation plugin. We also look at how the Google Static Map's API can be used in conjuncture with Geolocation to build a map. The Geolocation makes calls to the native platforms, iOS and Android, to their GPS APIs and then feeds that information into the Flutter layer of our application using Channel Messages. As with many Flutter plugins, we can take advantage of existing APIs from the native platforms to build our applications.

We first build a list application that periodically pings out to the GPS to fetch the current location of the device. As we change the location of the device the latitude and longitude of the location also changes. We make use of a Stream Subscription to fetch the data in a continuous manner. We then build out a map application using the Google Static Map API to generate a network image for us. By fetching the Latitude and Longitude from our device's GPS, we can then make a request to the network to re-generate the map and make it look as though the map is seminative. Various features could be added to this map to make it feel more fluid such as a gesture detector and a more consistent polling method.

The source code for this project can be found here

Video Tutorial

Projects and Series

Stand Alone Projects:
Building a Calculator
Movie Searcher Application

Minesweeper Game

Curriculum



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for your contribution. It has been approved.

Need help? Write a ticket on https://support.utopian.io.
Chat with us on Discord.

[utopian-moderator]

That was quick. Thank you very much for moderating my contribution.

Hey @tensor I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Utopian Witness!

Participate on Discord. Lets GROW TOGETHER!

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

it seems intresting but is it is to use in andriod or any other operating system..

thank you for sharing

Thanks to the author for sharing this useful material for everyone interested in location-based app development . There is also a guide on creating applications using this technology.

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 64118.79
ETH 3390.14
USDT 1.00
SBD 2.51