The purpose of this project was to test Google Map Services in connection with Flutter on Android, iOS

Overview

Flutterbase taxi

A large variety of apps depend on map services. The purpose of this project was to test Google Map Services in connection with Flutter on Android, iOS and Web platforms. Here is what I got:

App Demo Images

Click to open Online Web Demo

Real life taxi app

The Real taxi app requires development of a scalable server/cloud side storage and logic, authentication, payments, a much more complex workflow/state management, automated testing and deployment, etc. This is just a proof of concept - the sources of this prototype were not used in the production code.

Installation instruction

Clone the flutterbase taxi application source code repository:

git clone https://github.com/SoftwareArchitect9817/flutterbase-taxi
cd flutterbase-taxi

Install Flutter dependencies

flutter pub get

Web

Create Google Cloud API key with the following APIs enabled:

  • Maps Javascript API
  • Places API
  • Directions API
  • Geocoding API

Replace the FLUTTERBASETAXI_API_KEY text placeholder with your Google API key in the following files:

  • lib/api/google_api.dart
  • web/index.html

Google Places APIs and Directions API cannot be used in browsers due to the CORS rules violation. As a workaround I deployed a simple CORS proxy server running in the google cloud. Path to this server s sored in 'prodApiProxy' variable declared in the 'lib/api/google_api.dart' file.

Android & iOS

Replace the FLUTTERBASETAXI_API_KEY text placeholder with your Google API key in the /ios/* and /android/* project folders, make sure the following APIs are enabled:

  • Maps SDK for Android
  • Maps SDK for iOS
  • Places API
  • Directions API
  • Geocoding API

Application Structure

The reason I love Flutter is the beauty of its reactive UI nature. Once you've designed an application state correctly, you can design UI at the speed nearly exceeding the speed of light. Altogether, it took me a few days starting from scratch to completing this project.

The recommended way of keeping application state in Flutter is the Provider Pattern. Once the key application screens were defined in Figma, the reactive app state structure became obvious.

Application Provider's overview

After the state design was finalized, I had most pleasant time coding in Dart language :)

Source Code Documentation

Application structure is fairly straightforward and includes: Providers for the app state, simple wrappers around the Google REST APIs, the Flutter GoogleMap widget and the standard Material UI. That's it. Source code is self explanatory, please refer to standard Flutter documentation. All components are well documented by the Flutter community.

Entire UI workflow fitted in just few lines of code located in the 'main.dart' file

// Get Current Location Provider
final locProvider = LocationProvider.of(context); 

// Get Current Trip Provider
final currentTrip = TripProvider.of(context);     

// if Current location is not known
if (!locProvider.isDemoLocationFixed)             
  // show Location Selection screen     
  return LocationScaffold();                      

// else if there is an Active Trip
if (currentTrip.isActive) {       
  // and if this trip is finished
  return tripIsFinished(currentTrip.activeTrip!.status)
      // show Rate the Trip screen 
      ? tripFinishedScaffold(context)
     // if not finished - show the trip in progress screen     
     : ActiveTrip();
}

// else if there is no active trip - display UI for new trip creation
return NewTrip();

Some hints on further development

Below are some hints that might be helpful if you decide to go further:

Make sure you can efficiently handle GEO queries on the server side. Google Firestore requires some workarounds to use it properly.

Most payment gateways require user authorization on the native bank web UI. Test if you can integrate it with the Flutter Web View or Flutter deep links callback.

Thanks

I would like to thank the entire Flutter team and its community for building such an amazing technology for developers. I really enjoy working with Flutter & Dart.

Get in thought

Calling all Flutter enthusiasts - connect me on LinkedIn :)

You might also like...

Purpose of this project is to create extendable architecture of making platform aware Widgets which automatically select platform specific implementation

Old good factory Main obstacle in creating native experience on Flutter is the fact that you are asked to rebuild two layouts using platform specific

Oct 14, 2022

Check the availability of Google Play services on the current device

Flutter Google Api Availability Plugin A Flutter plugin to check the availability of Google Play services on the current device. Features Check the av

Dec 28, 2022

Flutter App Check Network connection State with Getx

flutter_network_connection A Flutter project Checking Network Status of a App. Info This project is a networking status checking Flutter application.

Oct 28, 2022

A pure Dart utility library that checks for an internet connection by opening a socket to a list of specified addresses, each with individual port and timeout. Defaults are provided for convenience.

data_connection_checker A pure Dart utility library that checks for an internet connection by opening a socket to a list of specified addresses, each

Nov 29, 2022

DostiPak - Dating app to make connection between people and start new love story to lovers

DostiPak - Dating app to make connection between people and start new love story to lovers

Dosti Pak Dating app to make connection between people and start new love story

Oct 2, 2022

Social app has a real time connection with firebase , contains posts, chats, stories, friends

##SocialKom (Social App) #####First Notice this: you need to link the app with fire base by: 1- adding google-services.json for android 2- adding goog

Oct 8, 2022

Place picker for Flutter using open street, Here maps and google map

Place picker for Flutter using open street, Here maps and google map

Flutter Place Picker A Flutter plugin which provides 'Picking Place' using Open Street, Here Maps and Google Maps widget. Much thanks to Terry Kwon Th

Oct 27, 2022

Note the place to remember it's name and descriptions along with google map location.

Note the place to remember it's name and descriptions along with google map location.

Note the Place Note the place to remember it's name and descriptions along with map location. View in Web Click here for web view Note: for bettter lo

May 5, 2022

dynamic link , notifaction , google map, animated-to

dynamicapp A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

Dec 29, 2021
Owner
Derek Jones
Perfection is not attainable, but if we chase perfection we can catch excellence
Derek Jones
A note-taking app powered by Google services such as Google Sign In, Google Drive, and Firebase ML Vision.

Smart Notes A note-taking app powered by Google services such as Google Sign In, Google Drive, and Firebase ML Vision. This is an official entry to Fl

Cross Solutions 88 Oct 26, 2022
The Integration Test Helper has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage.

The Integration Test Helper has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage (using Android and iOS

The Mobile Applications Community 2 Apr 7, 2022
Lightweight internet connection test, lookup a domain.

palestine_connection Lightweight internet connection test, lookup Google domain. Part of PalestineDevelopers project Features Periodic internet connec

Palestine Developers 5 Jun 26, 2022
A mobile application for both android and ios made for work out and fitness purpose

It's a mobile application for both android and ios made for work out and fitness purpose with many features you can read about here, but it can be used under all subject you want, well architected code and organized !

Gwhyyy 20 Dec 18, 2022
Telnyx flutter - A Flutter package for both android and iOS which helps developers with Telnyx API services

Telnyx Flutter A Flutter package for both android and iOS which helps developers

Kfir Matityahu 0 Jan 23, 2022
Flutter bloc cubit test knowdge - Flutter bloc cubit test knowdge

Flutter Bloc Simple Api This project is using weather api for featch data and di

Waruna Kaushalya 0 Jan 3, 2022
Integration test - Copy of the official Flutter integration test plugin

integration_test This package enables self-driving testing of Flutter code on de

null 0 Jan 5, 2022
Integration Test Preview allows tests on multiple screen sizes in a single e2e test run.

Integration Test Preview has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage (using Android and iOS pl

The Mobile Applications Community 3 Aug 23, 2022