Giter Club home page Giter Club logo

leafy_leasing's Introduction

Leafy Leasing πŸͺ΄

style: very good analysis License: MIT

This project was started using the Very Good CLI πŸ€–.

"A companion app for PaaS (Plants as a Service) companies."

Under the hood

  • πŸ’… Design System: Material 3 with a green seed color, incl. dark and light mode
  • πŸ„β€β™‚ ️State Management: riverpod: All AsyncStates (loading, error, data) handled by UI
  • ➑️ Mono-directional Data Flow: Data Service -> Repository -> AsyncNotifierProvider -> UI
  • πŸͺ Local State Management: flutter_hooks
  • 🐝 Local Data Persistence: hive
  • πŸ—³οΈ Caching: stash using an isar implementation
  • 🧭 Navigation: auto_route
  • πŸ—£οΈ Internationalization: flutter_localizations
  • πŸ“„ Declarative Logging: logger with listeners on providers (BL), widget states and route changes, connection states and cache changes.
  • 🀌 Lint Rules: very_good_analysis
  • 🏭 Continuous Integration: Github Action with a very good workflow as the base

Mock backend via local NoSQL database (hive), initialized with json data & made pseudo async with a short network delay of 300 milliseconds.

Developed using Flutter 3.7.8 and Dart 2.19.5, tested only on Android (API 31, Pixel 4a Emulator).

Todos

  • Tests
  • Change App Logo to Leafy Leasing Logo.

Getting Started πŸš€

This project contains three flavors:

  • development
  • staging
  • production

To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands:

Important: Get packages and use build_runner before flutter run, otherwise the code won't compile.

flutter pub get && flutter pub run build_runner build --delete-conflicting-outputs

# Development
$ flutter run --flavor development --target lib/main_development.dart

# Staging
$ flutter run --flavor staging --target lib/main_staging.dart

# Production
$ flutter run --flavor production --target lib/main_production.dart

*Leafy Leasing should work on iOS, Android, Web, and Windows.

All those flavors are pointing to the same bootstrap function but have different dotenvs.


Commit Keys πŸ”‘

  • ICM Big new structure (e.g. new backend integration or project setup) (w/o features)
  • FT New Feature
  • REF Refactoring
  • RM Removal
  • ENH Enhancement
  • BFX Bugfix
  • DAT Data (configs, dummy data)
  • LOC Localization / Internationalization
  • DEP Deployment (e.g. CI/CD)
  • DOC Documentation (e.g. README, docstrings)

Running Tests πŸ§ͺ (Currently not integrated ❌)

To run all unit and widget tests use the following command:

$ flutter test --coverage --test-randomize-ordering-seed random

To view the generated coverage report you can use lcov.

# Generate Coverage Report
$ genhtml coverage/lcov.info -o coverage/

# Open Coverage Report
$ open coverage/index.html

Working with Translations 🌐

This project relies on flutter_localizations and follows the official internationalization guide for Flutter.

Adding Strings

  1. To add a new localizable string, open the app_en.arb file at lib/l10n/arb/app_en.arb.
{
    "@@locale": "en",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    }
}
  1. Then add a new key/value and description
{
    "@@locale": "en",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    },
    "helloWorld": "Hello World",
    "@helloWorld": {
        "description": "Hello World Text"
    }
}
  1. Use the new string
import 'package:leafy_leasing/l10n/l10n.dart';

@override
Widget build(BuildContext context) {
  return Text(context.lc.helloWorld);
}

Adding Supported Locales

Update the CFBundleLocalizations array in the Info.plist at ios/Runner/Info.plist to include the new locale.

    ...

    <key>CFBundleLocalizations</key>
	<array>
		<string>en</string>
		<string>es</string>
	</array>

    ...

Adding Translations

  1. For each supported locale, add a new ARB file in lib/l10n/arb.
β”œβ”€β”€ l10n
β”‚   β”œβ”€β”€ arb
β”‚   β”‚   β”œβ”€β”€ app_en.arb
β”‚   β”‚   └── app_de.arb
  1. Add the translated strings to each .arb file:

app_en.arb

{
    "@@locale": "en",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    }
}

app_de.arb

{
    "@@locale": "de",
    "counterAppBarTitle": "ZΓ€hler",
    "@counterAppBarTitle": {
        "description": "Text, der in der AppBar der ZΓ€hlerseite angezeigt wird"
    }
}

App Logo πŸͺ΄

The logo is designed with some help from BlueWillow AI (=sth. like Midjourney).

  • To initialize a new splash screen, use flutter pub run flutter_native_splash:create --path=flutter_native_splash.yaml.

Secrets 🀐

The developer has access to a file lib/shared/secrets.dart which is not pushed to the repository. It is the place for API keys and other access tokens. When a Github workflow is triggered, it will create the file on the fly by accessing the Github Secrets and injecting them into the file. The file is then used by the app to access the secrets. The single Github Repository Secret is called SECRETS_FILE_CONTENT and it contains the entire file content of lib/secrets.dart.

It is saved as base64 and needs to be kept up to date: base64 -i lib/shared/secrets.dart is pasted into it.

leafy_leasing's People

Contributors

fior-di-latte avatar

Watchers

 avatar Kevin Scislak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.