All Projects → comerc → flutter_idiomatic

comerc / flutter_idiomatic

Licence: MIT license
It is starter kit with idiomatic code structure :) Firebase Authentication & GraphQL CRUD via BLoC. With Unit tests, Widget tests and Integration tests as BDD.

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to flutter idiomatic

Wallbay
Wallpaper App developed in Flutter using Pexels API
Stars: ✭ 107 (+435%)
Mutual labels:  bloc
calmly
Calmly is made with flutter to practice meditation to bring headspace and calmness. 😍💆🏼‍♂️
Stars: ✭ 34 (+70%)
Mutual labels:  bloc
Blue-Diary
Lightweight & effective Todo app with Flutter and BLoC pattern 🙆🏻‍♂️
Stars: ✭ 146 (+630%)
Mutual labels:  bloc
flutter-checkio
How time flies.一款开源习惯打卡APP,流畅的动画体验,Bloc实现状态管理,主题(颜色)切换,字体切换,数据库管理等。
Stars: ✭ 507 (+2435%)
Mutual labels:  bloc
github-integration-starter
Try out Hasura's GitHub Integration on Cloud Projects using the examples in this repo.
Stars: ✭ 19 (-5%)
Mutual labels:  hasura
Flutter Roadmap
This is a flutter roadmap and documentation repository. If anyone is interested you can join the party to help the community and make flutter great again.
Stars: ✭ 47 (+135%)
Mutual labels:  bloc
hasura-django-starter
The best of Hasura's instant, realtime GraphQL API meshed with Django's built-in auth model and the ability to extend logic across the two services.
Stars: ✭ 50 (+150%)
Mutual labels:  hasura
hasura-action
GitHub Action wrapping the Hasura CLI
Stars: ✭ 39 (+95%)
Mutual labels:  hasura
hasura-sdk
Hasura Schema & Metadata Typescript SDK
Stars: ✭ 21 (+5%)
Mutual labels:  hasura
travel app
Travel App using Flutter 💙
Stars: ✭ 74 (+270%)
Mutual labels:  bloc
substrate-graph
a compact graph indexer stack for parity substrate, polkadot, kusama
Stars: ✭ 28 (+40%)
Mutual labels:  hasura
next
(Work in progress) The rewritten version of the original PizzaQL 🍕
Stars: ✭ 45 (+125%)
Mutual labels:  hasura
learnwithjason.dev
Boop Crew HQ
Stars: ✭ 101 (+405%)
Mutual labels:  hasura
hasura-simple-auth
Simple Auth Server For Signup & Login Mutation
Stars: ✭ 32 (+60%)
Mutual labels:  hasura
whatsApp clone
Flutter WhatsClone (with Firebase + Clean Architecture) this app follow clean architecture proposed by our friendly Uncle Bob.
Stars: ✭ 181 (+805%)
Mutual labels:  bloc
fastify-hasura
A Fastify plugin to have fun with Hasura.
Stars: ✭ 30 (+50%)
Mutual labels:  hasura
create-full-stack
Set up a TypeScript full stack with one command.
Stars: ✭ 94 (+370%)
Mutual labels:  hasura
Chi Food
Food Delivery App made by Flutter and Bloc
Stars: ✭ 103 (+415%)
Mutual labels:  bloc
graphql-to-sql
GraphQL model to SQL
Stars: ✭ 13 (-35%)
Mutual labels:  hasura
bloc samples
A collection of apps built with the Bloc library.
Stars: ✭ 39 (+95%)
Mutual labels:  bloc

flutter_idiomatic

It is starter kit with idiomatic code structure :) Firebase Authentication & GraphQL CRUD via BLoC. With Unit tests, Widget tests and Integration tests as BDD.

Inspired by flutter_bloc example.

How to Start

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

Add lib/local.dart:

const kGitHubPersonalAccessToken = 'token';
// from https://github.com/settings/tokens

const kDatabaseToken = 'token';
// from https://hasura.io/learn/graphql/graphiql?tutorial=react-native

const kDatabaseUserId = '[email protected]';
// from https://hasura.io/learn/graphql/graphiql?tutorial=react-native

for VSCode Apollo GraphQL

$ npm install -g apollo

create ./apollo.config.js

module.exports = {
  client: {
    includes: ['./lib/**/*.dart'],
    service: {
      name: '<project name>',
      url: '<graphql endpoint>',
      // optional headers
      headers: {
        'x-hasura-admin-secret': '<secret>',
        'x-hasura-role': 'user',
      },
      // optional disable SSL validation check
      skipSSLValidation: true,
      // alternative way
      // localSchemaFile: './schema.json',
    },
  },
}

how to download schema.json for localSchemaFile

$ apollo schema:download --endpoint <graphql endpoint> --header 'X-Hasura-Admin-Secret: <secret>' --header 'X-Hasura-Role: user'

Execution Test for flutter_test

# execute command line
$ flutter test

Execution Test for flutter_driver

Execute target to iOS / Android:

  • Use flutter devices to get target device id
$ flutter devices
  • Config targetDeviceId in main_test.dart
Ex: (Android), default empty string
..targetDeviceId = "emulator-5554"
  • Execute command line with target devices
$ flutter drive

Why BDD (Behavior Driven Development)?

Swing Project

Flutter uses different types of tests (unit, widget, integration). You should have all types of tests in your app, most of your tests should be unit tests, less widget and a few integration tests. The test pyramid explains the principle well (using different words for the test-types).

I want to help you to start with integration tests but go a step further than the description in the flutter documentation and use the Gherkin language to describe the expected behavior. The basic idea behind Gherkin/Cucumber is to have a semi-structured language to be able to define the expected behaviour and requirements in a way that all stakeholders of the project (customer, management, developer, QA, etc.) understand them. Using Gherkin helps to reduce misunderstandings, wasted resources and conflicts by improving the communication. Additionally, you get a documentation of your project and finally you can use the Gherkin files to run automated tests.

If you write the Gherkin files, before you write the code, you have reached the final level, as this is called BDD (Behaviour Driven Development)!

Here are some readings about BDD and Gherkin:

The feature files

The first line is just a title of the feature, the other three lines should answer the questions Who, wants to achieve what and why with this particular feature. If you cannot answer those questions for a particular feature of your app then you actually should not implement that feature, there is no use-case for it.

Contacts

Support Me

😺 We love cats!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].