Flutterbase taxi - A large variety of apps depend on map services.

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/YakivGalkin/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...

Learn how to incorporate Firebase into our Flutter apps

Learn how to incorporate Firebase into our Flutter apps

Flash Chat ⚡️ Our Goal The objective of this tutorial is to learn how to incorporate Firebase into our Flutter apps. We'll be using Firebase Cloud Fir

Oct 27, 2021

A set of counter apps made for #FlutterCounterChallenge2020

flutter_counter_challenge_2020 A set of counter apps made for #FlutterCounterChallenge2020. Run flutter create . inside the repository after cloning i

Dec 30, 2022

Ensiklopedi Multiplatform Apps

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

Dec 9, 2021

Use dynamic and beautiful card view pagers (horizontal direction) to help you create great apps.

Use dynamic and beautiful card view pagers (horizontal direction) to help you create great apps.

Use dynamic and beautiful card view pagers (horizontal direction) to help you create great apps. Preview Mobile Vertical Card Pager Web Web Link Insta

Dec 9, 2022

A flutter plugin for integrating Mobile Money Payments to your flutter apps

A flutter plugin for integrating Mobile Money Payments to your flutter apps

Add Mobile Money payments to your flutter apps using the FlutterWave api gateway. Features Recieve Payments through Mobile Money in Uganda Supports MT

Nov 9, 2022

Demonstrate how to easily program Android apps on Gitpod

Demonstrate how to easily program Android apps on Gitpod

Developing Android apps on Gitpod This project is intended to demonstrate how to easily program Android apps on Gitpod. It is based on this guide and

Dec 8, 2022

Cooking apps - Cooking App made using flutter framework

Cooking apps - Cooking App made using flutter framework

cooking_apps Cooking App made using flutter framework. This template app contain

Jan 24, 2022

Mongolian vertical script widgets for Flutter apps

Mongolian vertical script widgets for Flutter apps

mongol This library is a collection of Flutter widgets for displaying traditional Mongolian vertical text. The primary widgets include: MongolText: ve

Dec 12, 2022

Flutter OSM - OSM Plugin For Flutter Apps

flutter_osm_plugin osm plugin for flutter apps (only Android for now, iOS will b

Mar 29, 2022
Owner
Yakiv Galkin
Head of engineering at Flutterbase
Yakiv Galkin
A pokemon app that let's you explore a large libarary of pokemons, view their strenghts and save your favorite pokemons

A pokemon app that let's you explore a large libarary of pokemons, view their strenghts and save your favorite pokemons!. (Built using freezed and flutter_bloc)

Abdulmalik 8 Aug 19, 2022
(Complete flutter application) Exam and training app as social media, prepared with Firebase backend services, Bloc State management, Singleton design pattern, Unit and widget tests, firebase mocking, Custom local libraries, etc.

(Complete flutter application) Exam and training app as social media, prepared with Firebase backend services, Bloc State management, Singleton design pattern, Unit and widget tests, firebase mocking, Custom local libraries, etc.

Ismael Shakverdiev 45 Jul 14, 2022
High-level APIs for Amazon Web Services (AWS) in Dart

High-level APIs for Amazon Web Services (AWS) in Dart Shared API utilities Generated API packages directory DocumentClient for DynamoDB Code generator

null 178 Dec 28, 2022
ReverseHand is a mobile application that was created with the vision of helping to reduce any power imbalances that consumers may face when seeking trade services.

ReverseHand is a mobile application that was created with the vision of helping to reduce any power imbalances that consumers may face when seeking trade services. To achieve this, the mobile application allows consumers to make their needs for services known in the form of job listings, where tradesmen are able to place bids in order to be chosen and hired.

COS 301 - 2022 7 Nov 2, 2022
A Flutter package which can be used to make polylines(route) from a source to a destination, and also handle a driver's realtime location (if any) on the map.

GoogleMapsWidget For Flutter A widget for flutter developers to easily integrate google maps in their apps. It can be used to make polylines from a so

Rithik Bhandari 14 Nov 30, 2022
Firebase + Flutter sample apps with code snippets, supported by comprehensive articles for each implementation.

FlutterFire Samples This repo is created to contain various sample apps demonstrating the integration of Firebase with Flutter. The final goal is to c

Souvik Biswas 186 Dec 24, 2022
A flutter clean architecture series, the way we build clean apps.

Flutter Clean Archeticture Series ?? "Making the world a better place" ✅ Full Articles You can check out the full Medium articles on devmuaz ✅ Branche

AbdulMuaz Aqeel 267 Jan 4, 2023
Examples showing how to use Rid in order to build Dart/Flutter apps integrated with Rust.

Examples showing how to use Rid in order to build Dart/Flutter apps integrated with Rust.

Thorsten Lorenz 205 Dec 24, 2022
A Flutter starter-kit for production-level apps.

Flutter Starter Introduction We wanted to take Flutter a step further and accelerate the process of building production-level apps. Presenting our sol

GeekyAnts 374 Dec 30, 2022
A collection of sample apps that use Stream

Flutter samples Quick Links Register to get an API key for Stream Chat Flutter Chat Tutorial Chat UI Kit Flutter SDK Repo What is Stream? Stream allow

Stream 247 Dec 21, 2022