Starter project and code generator for Flutter/Redux

Overview

Flutter Redux Starter/Code Generator

Flutter Redux Starter

Videos

We're using this approach to develop the Flutter app for Invoice Ninja.

Usage

Step 1: Clone the GitHub repo

git clone [email protected]:hillelcoren/flutter-redux-starter.git <application> && cd <application>

Step 2: Initialize the project

./starter.sh init <company> <application> <url>

Step 3: Create the module

./starter.sh make <application> <module> <fields>

For example:

git clone [email protected]:hillelcoren/flutter-redux-starter.git hacker_news && cd hacker_news
./starter.sh init hacker_news articles api.hackerwebapp.com
./starter.sh make articles article title,url
# Change the route on line 20 of lib/data/repositories/article_repository.dart from /articles to /news
flutter run

Note: on macOS sed leaves behind backup files ending with -e, you can use this command to delete the files:

find . -name "*-e" -type f -delete

Features

  • Supports large Redux stores by persisting parts separately
  • App state (including navigation) is persisted on form changes
  • Automatically implements support for sorting and searching
  • The account email is also backed up in shared preferences
  • All state and models classes are created using built_values

Included Packages

Application Architecture

The architecture is based off these two projects:

Comments
  • SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 35779

    SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 35779

    hi @hillelcoren , i create a spring boot backend, then use this starter,everything is ok ,but when i debug the app, the console print below log: [INFO] LoggingMiddleware: {Action: LoadPrescsFailure{error: SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 35818}, State: AppState { and the screen is stuck in here image by the way, i used JWT, is that possible caused by this?? i need to log in first??? thank you for taking time to help me on this problem.

    opened by jiangzhixiao 25
  • XXX has stoped

    XXX has stoped

    @hillelcoren ,hi hillelcoren,when i follow your example command,i got the error when install apk to emulator image

    but flutter mobile runs well image

    can you give some advice?

    opened by jiangzhixiao 10
  • Installation fails due to `http` package dependency

    Installation fails due to `http` package dependency

    I have a problem during installation. Fails immediately because of the version of the http package:

    Running "flutter packages get" in hillelcoren-flutter-redux-starter...
    Because every version of flutter_driver from sdk depends on http 0.12.0 and flutter_redux_starter depends on http ^0.11.3+17, flutter_driver from sdk is forbidden.
    So, because flutter_redux_starter depends on flutter_driver any from sdk, version solving failed.
    
    pub get failed (1)
    

    Updating the version of http at ^0.12.0, in the pubspec.yaml file, I get another error:

    Running "flutter packages get" in hillelcoren-flutter-redux-starter...
    Because every version of flutter_driver from sdk depends on analyzer 0.33.0 and built_value_generator >=5.5.5 depends on analyzer ^0.32.1, flutter_driver from sdk is incompatible with built_value_generator >=5.5.5.
    So, because nerv depends on both built_value_generator ^6.1.4 and flutter_driver any from sdk, version solving failed.
    
    pub get failed (1)
    

    The result of flutter --version is:

    Flutter 0.9.4 • channel beta • https://github.com/flutter/flutter.git
    Framework • revision f37c235c32 (3 weeks ago) • 2018-09-25 17:45:40 -0400
    Engine • revision 74625aed32
    Tools • Dart 2.1.0-dev.5.0.flutter-a2eb050044
    
    opened by danielemontecchi 8
  • Invalid argument(s): Unknown type on deserialization. Need either specifiedType or discriminator field

    Invalid argument(s): Unknown type on deserialization. Need either specifiedType or discriminator field

    @hillelcoren ,i'm using java backend, when i post a login request to the backend,

    i got the response:

    {data: {accounts: [], version: 5.4, token: null, static: {}}, error: null}

    when excute at this line(endities.g.dart line 237):

      result.data.replace(serializers.deserialize(value,
                    specifiedType: const FullType(LoginResponseData))
                as LoginResponseData);
    

    i got the error

    I/flutter (11099): Deserializing '[data, {accounts: [], version: 5.4, token: null, static: {}}, null, null]' to 'LoginResponse' failed due to: Invalid argument(s): Unknown type on deserialization. Need either specifiedType or discriminator field.

    E/flutter (11099): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception: E/flutter (11099): type 'DeserializationError' is not a subtype of type 'String'

    i have searched by google, still don't quite clear..would you please give me some tips ? thanks hillelcoren.

    opened by jiangzhixiao 8
  • No application found for TargetPlatform.android_x86

    No application found for TargetPlatform.android_x86

    I'm on Linux Mint 18.3 When I try to run flutter run, I get the following message:

    $ flutter run
    Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
    Launching lib/main.dart on Android SDK built for x86 in debug mode...
    No application found for TargetPlatform.android_x86.
    Is your project missing an android/AndroidManifest.xml?
    Consider running "flutter create ." to create one.
    
    opened by Simpler1 8
  • Couldn't clone hacker_news or posts

    Couldn't clone hacker_news or posts

    F:\Flutter Projects>git clone [email protected]:hillelcoren/flutter-redux-starter.git hacker_news && cd hacker_news Cloning into 'hacker_news'... The authenticity of host 'github.com (192.30.253.112)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts. [email protected]: Permission denied (publickey). fatal: Could not read from remote repository.

    Please make sure you have the correct access rights and the repository exists.

    F:\Flutter Projects>git clone [email protected]:hillelcoren/flutter-redux-starter.git posts && cd posts Cloning into 'posts'... [email protected]: Permission denied (publickey). fatal: Could not read from remote repository.

    Please make sure you have the correct access rights and the repository exists.

    Also add one list of the in the readme file so that anyone can use those publicly available apps to clone with redux flutter and make sure to update them as well from time to time. Thanks!!!

    opened by parthvora25 2
  • Fixes #11 slash/da-sh issue in starter.sh

    Fixes #11 slash/da-sh issue in starter.sh

    init script no more cries when u add backslash like server.com/api

    https://stackoverflow.com/questions/16778667/how-to-use-sed-to-find-and-replace-url-strings-with-the-character-in-the-tar

    Fixes #11

    init
    opened by BufferUnderflower 1
  • explicit check for make command

    explicit check for make command

    Check that the user actually want to run the 'make' command - so we don't run the command by accident if the user has a typo (prevent lots of cleanup work..)

    opened by danibjor 1
  • Fix line added mistakenly in app/build.gradle

    Fix line added mistakenly in app/build.gradle

    Hi @hillelcoren

    turns out that adding classpath 'com.android.tools.build:gradle:3.2.1' in app/build.gradle was a mistake of mine. Hope you can merge out it as it is breaking build for android. ps. we should definitely cover it with a few tests. I did like you project. I will do my best to contribute

    opened by victoraldir 0
  • confusion when field is 'id'

    confusion when field is 'id'

    You might want to include in your docs a warning to not use 'id' as a field name since it conflicts with your BaseEntity. I included 'id' in my list of fields and got some errors saying that it thought I was overriding 'id' from baseEntity.

    enhancement 
    opened by kevin-haynie 0
  • Use Relative Paths instead of fully qualified.

    Use Relative Paths instead of fully qualified.

    https://stackoverflow.com/questions/22764330/syntax-for-specifying-file-path-relative-and-absolute

    This makes it a lot easier for reusable code in other projects.

    Here is a plugin in vs code that does this already: https://marketplace.visualstudio.com/items?itemName=luanpotter.dart-import

    enhancement 
    opened by rodydavis 3
  • How to implement Login functionality

    How to implement Login functionality

    I have been trying this setup for a quite while. I have some experience in Android. A very little with flutter.

    I have a REST API which is JWT authenticated. I need to authenticate the user before making any API requests.

    I am bit confused on how to force open the login page on App Load.

    I need to persist the JWT token than email & password.

    Thanks, Keethan

    opened by gnanakeethan 1
Releases(v0.1)
Owner
Hillel Coren
Co-creator: invoiceninja.com • itsallwidgets.com • mudeo.app
Hillel Coren
VS Code `.code-workspace` file generator

VS Code .code-workspace file generator (for monorepositories with Dart and Flutter projects) TL;DR; Create yaml file config.yaml (check #Format sectio

Mike T 1 Feb 18, 2022
Swagger/OpenAPI code generator based on Chopper and JsonAnnotation for Flutter

Code partially generated with chopper ?? Build dart types from Swagger/OpenAPI schemas SwaggerDartCodeGenerator is a code generator that looks for *.s

null 187 Jan 5, 2023
The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs. Inspired by SwiftGen. Motivation Using asset path str

FlutterGen 1.1k Jan 6, 2023
🚀The Flutter dart code generator from zeplin. ex) Container, Text, Color, TextStyle, ... - Save your time.

Flutter Gen Zeplin Extension ?? The Flutter dart code generator from zeplin. ex) Container, Text, Color, TextStyle, ... - Save your time. ⬇ 1.1k Getti

NAVER 49 Oct 12, 2022
Dart Code Generator for generating mapper classes

Smartstruct - Dart bean mappings - the easy nullsafe way! Code generator for generating type-safe mappers in dart, inspired by https://mapstruct.org/

Nils 28 Nov 29, 2022
The Dart code generator for your package versions. 🎯

The Dart code generator for your package versions. There is no way to get the package version from the code in the Dart ecosystem. Installation Add bu

Daichi Furiya 12 Dec 14, 2022
Environment specific config generator for Dart and Flutter applications during CI/CD builds

Environment Config Generator Environment specific config generator. Allows to specify env configuration during CI/CD build. Primarily created to simpl

Denis Beketsky 86 Dec 2, 2022
A Flutter curl-command generator for Dio

curl_logger_dio_interceptor A Flutter curl-command generator for Dio. Easily test your Flutter-made requests in your favorite terminal or even in Post

null 7 Nov 17, 2022
OpenAPI generator for Dart & Flutter

Fantom Fantom is a cli tool for generating API layer based on OpenAPI Spec. Usage Install fantom $ dart pub global activate fantom Generate API client

6thSolution 13 Oct 18, 2022
OpenAPI generator for Dart & Flutter

Fantom Fantom is a cli tool for generating API layer based on OpenAPI Spec. Usage Install fantom $ dart pub global activate fantom Generate API client

REKAB 13 Oct 18, 2022
Flutter Word generator

wordpair_generator A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you start

Aristide Sabi 0 Dec 3, 2021
Random color generator for Flutter

Random color generator Pub link: https://pub.dartlang.org/packages/random_color This library will generate random colors that are visually pleasing an

Luka Knezic 56 Jun 13, 2022
A Flutter Word generator App to improve English vocabulary

Word generator App to improve English vocabulary: Add English words you don't know and their translation, then you need to answer what is the translat

Gustavo Bonassa 1 Dec 12, 2021
A certificate generator app developed in Flutter with love.

Holden Certificate Generator made with Flutter. Dependencies spreadsheet_decoder path_provider file_picker pdf_viewer_plugin pdf permission_handler sh

null 20 Jan 4, 2023
Destiny is a new, mock-data generator for Dart/Flutter

Destiny is a new, mock-data generator for Dart/Flutter. It uses static methods couched in a destiny namespace as the API.

Aditya Kishore 11 Sep 16, 2022
Flutter Google Sheet localizations generator

Flutter Google Sheet localizations generator Generates a localizations delegate from an online Google Sheet file. Install Add the following to your pu

Aloïs Deniel 277 Dec 19, 2022
GPT-3 recipe generator for the GPT-3 Makeathon by TUM.AI. Developed by team Taste the data.

GPT-3 Makeathon by TUM.AI - Team: Taste the Data Team - Taste the Data: Carmen Heger <@stedomedo> David Stiftl <@stiftlD> Christopher Schütz <@cdschtz

Oliver Klukas 11 Dec 4, 2022
A generator to create config class from json files that support many environments

A generator to create config class from json files that support many environments. Motivation If you use a json file to config your applications, perp

Diego Cardenas 0 Oct 9, 2021