GithubHelp home page GithubHelp logo

bong-coc / speedometer-mobile-application Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ahmed425/speedometer-mobile-application

0.0 0.0 0.0 1.57 MB

Speedometer Mobile App with Flutter

Objective-C 0.32% Kotlin 1.11% Dart 95.16% Swift 3.41%

speedometer-mobile-application's Introduction

Speedometer Mobile App with Flutter

Description

A car speedometer mobile app with Flutter to measure the current speed of the vehicle and measure the time the vehicle takes to speed up from 10 KMH to 30 KMH and the time the vehicle takes to slow down from 30 KMH to 10 KMH.

Demo

Car Speedometer Demo

Pattern/Approach Used

The Provider pattern is used for data and state management .

Flutter Packages/Plugins/Libraries Used

  • segment_display: ^0.4.1+1 : To Support multiple types of segment displays.
  • geolocator: ^5.3.2+2 : To provide easy access to platform specific location services.
  • location: ^3.0.2 : This plugin for Flutter handles getting location on Android and iOS.
  • provider: ^4.1.3 : For data and state management.
  • flutter_launcher_icons: ^0.7.5 : For creating app icon.
  • fluttertoast: ^4.0.0: for displaying Toast to the user if he disabled the location service or denied the location permission.

This app was made using the provider Approach/Pattern as follows:

Data Models: SpeedometerModel Class includes the following fields/variables:

  • currrentSpeed (double): To represent the vehicle current speed.
  • time10_30 (int) : To represent the time in seconds the vehicle takes to speed up from 10 KM/H to 30 KM/H.
  • time30_10 (int) : To represent the time in seconds the vehicle takes to slow down from 30 KM/H to 10 KM/H.
  • range (int) : to represent the speed range in which the vehicle moving.

Providers:SpeedometerProvider Class includes instance of SpeedometerModel and the following methods:

  • checkLocationAndPermissionStatus() to check the location service and permission status.
  • updateSpeed(Position position): which updates the vehicle current speed and call either checkSpeedAndMeasureTimeWhileInRange or checkSpeedAndMeasureTimeWhileOutOfRange according to the vehicle current speed.
  • getSpeedUpdates() : which listens to the vehicle position and pass it to the updateSpeed(Position position) method .
  • checkSpeedAndMeasureTimeWhileInRange(double vehicleSpeed), checkSpeedAndMeasureTimeWhileOutOfRange(double vehicleSpeed): to measure time10_30 and time 30_10.

Utils:

Includes utils method showErrorToast which shows Toast to user if he disabled or denied the location service or permission.

Widgets: SpeedometerWidget Class (StatelessWidget) which listens to the SpeedometerProvider Class to be notified of changes and update the UI accordingly and it includes the following :

  • providerData : instance of the SpeedometerProvider class to listen to provider data changes. Widget_Tree

How to run

  • Clone this repo
  • Run flutter packages get
  • Run flutter run while connecting a physical mobile device or emulator

APK file download link

speedometer-mobile-application's People

Contributors

ahmed425 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.