Put your flutter in a cage
Cage is an opinionated framework for developing Flutter applications. Cage aims to provide structure and guidance in a new world of cross platform mobile app development.
Cage builds onto the concepts of dependency-injection (DI), model-view-presenter (MVP) and flux-style pattern for interactions.
The command line interface (CLI) is hosted in this repository
cage consists of three fundamental foundations:
A module represents a modular package to be used upon other modules or bootstrapping the application. A module declares services and widgets. Modules can import other modules, so that module parts can be reused and shared.
A service can be any object you like. A service can be a number, a string or a complex class instance. Services can be provided to the complete application or be isolated in your current module.
Since Flutter is build on widgets, cage of course cannot avoid widgets. Cage wraps cages and provides separation of concern for widgets. While Flutter does not give any rules for structuring your widgets, Cage has an opinion for you. Business logic and view logic are separated, your models shall exist separately.
Don't quite like what you see? #
Flutter currently does not provide any access to metadata. Thus fancy metadata/annotations used by libraries like angular currently do not work out of the box. For further development build_tools will be evaluated and may can be used productive someday. This will hopefully decrease the usage of currently needed boiletplate code.
All notable changes to this project will be documented in this file.
[1.0.0] - 2019-07-07
First production release of Cage.
- Module system for creating application modules
- Dependency injection for managing dependencies to be used by widgets and other framework structures
- Widget-system to use a MVP-pattern for a better separation of concern
- State management system for strict data flow and testability
- Flutter runtime for running your Cage application with flutter
- Flutter test runtime for accessing your Cage structures, such as widgets or services in unit tests
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: cage: ^1.0.0
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Jan 21, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.7.0
- pana: 0.13.4
- Flutter: 1.12.13+hotfix.5
The package description is too short. (-8 points)
Add more detail to the
description field of
pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.
Maintain an example.
None of the files in the package's
example/ directory matches known example patterns.
Common filename patterns include
cage.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.