• Stars
    star
    8,660
  • Rank 4,002 (Top 0.09 %)
  • Language
    Dart
  • License
    BSD 3-Clause "New...
  • Created over 6 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

TodoMVC for Flutter

flutter_architecture_samples

Build Status Build Status codecov

List of Todos Screen

TodoMVC for Flutter!

Flutter provides a lot of flexibility in deciding how to organize and architect your apps. While this freedom is very valuable, it can also lead to apps with large classes, inconsistent naming schemes, as well as mismatching or missing architectures. These types of issues can make testing, maintaining and extending your apps difficult.

The Flutter Architecture Samples project demonstrates strategies to help solve or avoid these common problems. This project implements the same app using different architectural concepts and tools.

You can use the samples in this project as a learning reference, or as a starting point for creating your own apps. The focus of this project is on demonstrating how to structure your code, design your architecture, and the eventual impact of adopting these patterns on testing and maintaining your app. You can use the techniques demonstrated here in many different ways to build apps. Your own particular priorities will impact how you implement the concepts in these projects, so you should not consider these samples to be canonical examples. To ensure the focus is kept on the aims described above, the app uses a simple UI.

Current Samples

Supporting Code

  • integration_tests - Demonstrates how to write selenium-style integration (aka end to end) tests using the Page Object Model. This test suite is run against all samples.
  • todos_repository_core - Defines the core abstract classes for loading and saving data so that storage can be implemented in various ways, such as file storage or firebase for mobile projects, or window.localStorage for web projects.
  • todos_repository_local_storage - Implements the todos repository using the file system, window.localStorage, and SharedPreferences as the data source.
  • firebase_flutter_repository - Implements the todos repository using firestore as the data source.
  • firebase_rtdb_flutter_repository - Implements the todos repository using firebase real-time database as the data source.

Running the samples

iOS / Android

cd <sample_directory>
flutter run 

Web

Make sure you're on Flutter version "Flutter 1.12.13+hotfix.6 • channel beta" or newer. Not all samples support web at this time, so please check the sample directory for a lib/main_web.dart file.

cd <sample_directory>
flutter run -d chrome -t lib/main_web.dart

Why a todo app?

The app in this project aims to be simple enough that you can understand it quickly, but complex enough to showcase difficult design decisions and testing scenarios. For more information, see the app's specification.

Be excellent to each other

This Repo is meant as a discussion platform for various architectures. Let us debate these ideas vigorously, but let us be excellent to each other in the process!

While healthy debate and contributions are very welcome, trolls are not. Read the code of conduct for detailed information.

Contributing

Feel free to join in the discussion, file issues, and we'd love to have more samples added! Please read the CONTRIBUTING file for guidance :)

License

All code in this repo is MIT licensed.

Attribution

All of these ideas and even some of the language are directly influenced by two projects:

Contributors

I'd like to thank all of the folks who have helped write new samples, improve the current implementations, and added documentation! You're amazing! :)

More Repositories

1

flutter_redux

A library that connects Widgets to a Redux Store
Dart
1,648
star
2

scoped_model

A Widget that passes a Reactive Model to all of it's children
Dart
774
star
3

bansa

A state container for Java & Kotlin, inspired by Redux & Elm
Kotlin
442
star
4

flutter_stetho

Integrate Flutter with the Facebook Stetho tool for Android
Dart
219
star
5

new_flutter_template

Test ideas for a new flutter template
Dart
141
star
6

dart_redux_epics

Redux.dart middleware for handling actions using Dart Streams
Dart
141
star
7

transparent_image

A transparent image in Dart code, represented as a Uint8List.
Dart
103
star
8

redux_thunk

Redux Middleware for handling functions as actions
Dart
88
star
9

github_search_angular_flutter

Demonstrates how to use the bloc pattern for both an Angular and Flutter app
CSS
85
star
10

flutter_stream_friends

Flutter's great. Streams are great. Let's be friends.
Dart
62
star
11

gradient_animations

An example of how to animate gradients in flutter
Dart
61
star
12

flutter_redux_dev_tools

A Time Traveling Redux Debugger for Flutter
Makefile
40
star
13

reselect_dart

Efficiently derive data from your Redux Store
Dart
37
star
14

redux_logging

Redux.dart Middleware that prints the latest action & state
Dart
30
star
15

rainbow_gradient

An easy way to add Rainbows to your Flutter apps!
Dart
23
star
16

giphy_client

A Giphy API Client for Dart compatible with all platforms
Dart
22
star
17

mvi_sealed_unions

dart_sealed_union playground, started with code from Flutter Consortium
Dart
21
star
18

memory_image_converter

A command line app that will convert an image into a Uint8List which can be consumed by a Flutter app using the `MemoryImage`, `Image.memory`, or `FadeInImage.memoryNetwork` classes.
Dart
16
star
19

hacker_news_client

A client for the Hacker News API. Works on Flutter, Server, and Web.
Dart
16
star
20

open_iconic_flutter

The Open Iconic icon pack available as a set of Flutter Icons
Dart
14
star
21

hnpwa_client

Fetch data from the HNPWA API -- a Hacker News API crafted for mobile and progressive web apps
Dart
14
star
22

rxdart_codemod

A collection of codemods to upgrade your RxDart code from one version to the next
Dart
11
star
23

fancy_network_image

A port of cached_network_image all the goodies EXCEPT the cache
Dart
10
star
24

redux_future

A Redux Middleware for handling Dart Futures as actions
Dart
10
star
25

draggable_scrollbar

A scrollbar that can be used to quickly navigate through a list
Dart
10
star
26

scoped_model_github_search

Translated the RxDart Github Search example to ScopedModel
Dart
9
star
27

redux_dev_tools

Time Travel Dev Tools for Dart Redux
Dart
8
star
28

CSScaffold.tmbundle

Like or want to learn CSScaffold, but tired of referring to the documentation or looking through Mixins.css files? Use the the Textmate bundle!
6
star
29

flutter_lcov_docker

Flutter + Lcov for code Coverage reports!
5
star
30

swapi_client

A library that makes it easy to fetch data from SWAPI: The Star Wars API.
Dart
5
star
31

workshop_live_coding_login

Dart
4
star
32

nested_bottom_navigation

A test of how to do nested bottom navigation with BottomNavigation
Dart
4
star
33

flutter_ui_challenge_zoom_menu

Flutter UI Challenge: Zoom Menu.
Dart
3
star
34

dotfiles

The dotfiles of Brian Egan
HTML
3
star
35

stream_store

A Redux-style Store implemented using core Dart Stream primitives
Dart
3
star
36

hacker_news_app

Hacker news app for flutter
Dart
3
star
37

ez_listenable

A set utilities that allow you to listen to objects and notify listeners of changes
CSS
3
star
38

dribbble_client

A Dribbble api client for Dart
Dart
3
star
39

monocle

View CONTENTdm images with style!
JavaScript
2
star
40

Scaffold.ruble

Aptana Bundle for the Scaffold CSS preprocessor!
Ruby
2
star
41

Playduino

JavaScript
2
star
42

Vim-Configuration

My personal vim folder!
Vim Script
1
star
43

BangumiList

萌豚 番剧清单
Dart
1
star
44

dmsuggest

A Search Suggestion App for dmBridge
JavaScript
1
star
45

loadTest.js

A simple load test script for phantomjs
1
star
46

HotTest

The hottest way to run client-side unit tests
JavaScript
1
star
47

pic_in_a_box

A swank replica of Sexy Slider.
JavaScript
1
star
48

transmit-vim

Integrates Transmit FTP (Mac) with Vim
Vim Script
1
star
49

Dilefont

Such a dilettante
JavaScript
1
star
50

dmcarousel

A slideshow application for dmBridge
JavaScript
1
star