Flutter-writting-prompt - Flutter example app used to show Writing Prompts to the user

Overview

Writing Prompt

A writing prompt application designed to showcase an approach to a "Clean"er architecture in Flutter with Bloc and RxDart, including Unit, Widget and Integration Testing

Project Overview

This app fetches data from https://ineedaprompt.com API and displays it on screen. The user can then ask for a new prompt, or see a history of prompts.

Project Structure

The project is structured as follows:

|_data
 \__local
 \__remote
|_domain
 \__bloc
 \__managers
 \__mappers
 \__models
|_presentation
 \__styles
 \__ui
 \__utils
 main.dart

Data

The data stores both the API and local database information that will be displayed in the app. All the API endpoints, models, serialized classes and database helpers should be put here.

Domain

This layer connects the data layer to the presentation, preparing the information received from the local database or the server and managing the app state (i.e., if we need to fetch new data, fetch new data)

To communicate with the widgets, we use the BLOC architecture and StreamBuilders.

Presentation

Since Flutter does not have a resources folder as we see in Android, we need to declare each resource on a file. As such, I created the styles (naming to be changed) folder which include information about colors, strings and dimensions used in the app.

Here we have all the widgets of the app, and their connection to the domain layer via the bloc.

main.dart

Since I chose not to use a dependency injection framework, this is where I create all the classes to be used in the app, inherited by each widget.

Testing

Though the app is not fully tested, I strived to show how to:

  • Write Unit Tests that test a small module (in this case method) of a class. They tested the network layer and domain layer
  • Widget Tests that assure that the bloc is providing the correct information to the widgets
  • Integration Test that test a normal app use, expecting a new prompt to be shown on screen.

To-Do List

  • Create more App animations
  • Include more app features, such as share
  • Create more tests
You might also like...

Create dart data classes easily, fast and without writing boilerplate or running code generation.

Create dart data classes easily, fast and without writing boilerplate or running code generation.

Dart Data Class Generator Create dart data classes easily, fast and without writing boilerplate or running code generation. Features The generator can

Feb 28, 2022

Backbone - A Dart framework for writing REST APIs from an Open API spec

The Backbone Dart Backend Framework A Dart framework for writing REST APIs from

Oct 6, 2022

A zero-dependency web framework for writing web apps in plain Dart.

Rad Rad is a frontend framework for creating fast and interactive web apps using Dart. It's inspired from Flutter and shares same programming paradigm

Dec 13, 2022

A collection of bricks to be more productive when writing code.

A collection of bricks to be more productive when writing code.

A collection of bricks that enable developers to be more productive when writing code. Bricks 🧱 Brick Description Version clean_architecture_global_s

Nov 12, 2022

A thought experiment on writing a strange API for Dart.

Operator Frog 🐸 What is Operator Frog Operator Frog is a 24h thought experiment that I did. I wanted to know if we could write a strange looking AP

Dec 8, 2022

Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Flutter Tutorial - User Profile Page UI 1/2 Create a Flutter User Profile Page UI where you can access and edit your user's information within your Fl

Dec 6, 2022

Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Flutter Tutorial - User Profile Page UI #2 Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flu

Dec 15, 2022

Lottie-package-example-Flutter - A simple example about lottie package in Flutter

Lottie-package-example-Flutter - A simple example about lottie package in Flutter

Lottie Package example - Flutter ScreenShot ⚠️ Essential Packages lottie: ^1.2.1

Dec 7, 2022

Smooth-Page-Indicator-Example-Flutter - A simple example about smooth page indicator in Flutter

Smooth-Page-Indicator-Example-Flutter - A simple example about smooth page indicator in Flutter

Smooth Page Indicator Example - Flutter Screenshots ⚠️ Essential Packages smooth

Dec 7, 2022
Owner
Gonçalo Palma
Flutter Dev @3rein and spreader of the word of Flutter, wannabe writer and organiser @FlutterPortugal and collaborator at FlutterExp
Gonçalo Palma
Show a draggable floating chat icon button and show messages on screens

Show a draggable floating chat icon button and show messages on screens Features A widget for displaying a chat icon (or custom widget) on top of a ba

CU Apps 4 May 5, 2022
Breaking-bad - Used Flutter with BLoC pattern to show some info

?? Overview Used Flutter with BLoC pattern to show some info. about my favorite

Abdallah Badawy 1 Dec 10, 2022
Sibyl App written with Dart/Flutter. (My first experience in writing a real android app in flutter).

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

ALi.w 3 Feb 17, 2022
Flashcard and Kanji writing Flutter App. Stopped working on this Project. Currently just a graveyard.

KanjiMaru Not in development anymore for reasons I shall not state here. Still loved the design I created, so it will stay up. Flashcard and Japanese

Stefan Dourado 30 Jan 1, 2023
Flutter Plugin for Requesting and Writing Reviews in Google Play and the App Store

Flutter Plugin for Requesting and Writing Reviews in Google Play and the App Store. Apps have to be published for the app to be found correctly.

Flutter Community 274 Jan 4, 2023
The simple way to show the user some information on your selected widget.

Info Popup The simple way to show the user some information on your selected widget. Features Info holder with dynamic size Fully editable content are

Salih Can 9 Nov 23, 2022
null 1 Jan 8, 2022
Cross-platform flutter plugin for reading and writing NFC tags. Not maintained anymore - not looking for new maintainer, fork instead.

nfc_in_flutter NFC in Flutter is a plugin for reading and writing NFC tags in Flutter. It works on both Android and iOS with a simple stream interface

Andi Semler 113 Sep 28, 2022
Glass-Design - Glass Design on one page writing in Flutter

glassdesign writing in Flutter framework / GlassDesign fait en Flutter framework

Tommy 6 Jun 15, 2022