Skip to content

Files

Latest commit

 

History

History

app

MAGIC APP

A new Flutter project.

Prerequisites

  • Flutter 3.3.8
  • Dart >=2.18.0 <3.0.0

How to run the project

Step 1:

Download or clone this repo by using the link below:

https://github.com/iampato/magic.git

Step 2:

Go to backend sub folder and run make run this should spin a simple dart_frog REST API

Then navigate into app/ and run

flutter pub get 

Step 3:

Under lib/src/core/config.dart you can change the API URl with your IP

Step 4:

Generate part files if needed

flutter packages pub run build_runner build --delete-conflicting-outputs

Step 5:

Run the project

flutter run

Libraries & Tools Used

  1. Network

    • Dio - a robust http client for interacting with the REST client
  2. State management

    • Bloc - the app uses cubit for statement hence the needs for this package
    • Flutter bloc - since the merge of bloc and cubit I need this to provide required widget to integrate cubit example BlocConsumer
    • Hydrated bloc - For caching of bloc state in some cubits
  3. Code generation

  4. Logging

    • Logger - for safe and beautiful logs
  5. Navigation

    • Go router - for declarative routing purposes
  6. Responsive design

  7. Testing

  8. Others

Folder Structure

This application uses a multi-module architecture though the packages are not in seperate packages this can easily be done. for purposes of simplicity I under them under lib

Here is the core folder structure which flutter provides.

app/
|- android
|- build
|- ios
|- lib
|- test

Here is the folder structure we have been using in this project inside of lib

lib/
|- app/
|- core/
|- features/
  1. The app* module holds app related things example the material app widget, routes etc

  2. The core* module are common things that an app needs, and various features a can depend on this module example of things found onthe core module include:

    • assets - class that wraps assets added so instead of assets/image/bg.png you do Assets.bg
    • config - Set up your config; things like APIURL, sentry url etc
    • constants - constants used in your application
    • theme - the app uses a custom theme to provide theming
    • styles - includes extensions on various colors, textstyles, durations, Corners
    • extensions -
    • And many more
  3. The Feature* module houses all the features and in this app they include

    • Landing - landing page and decision page (Where we check whether you are login or not)
    • On-boarding - Houses all signup and login flows, http calls, cubits and widgets
    • Home - this houses the list of workout screens, profile screens, create workout, workout details screens and all the accompanying logic to support this module

Improvements that could be made

  1. Adding of more tests (time constraints)