Flutter app skeleton using flutter_riverpod, dotenv, auto_route, get_it, freezed, and dio
This skeleton has all the basic boilerplate for common challenges in software development. It is setup assuming there is a basic RESTful api associated with it, but that can be removed fairly easily if this doesn't require an API.
This is meant for full cross platform apps and has responsiveness at its core. All UI is separated from the business logic (BLoC) but doesn't use the flutter_bloc library - instead: riverpod.
Each feature should be built in its own self-contained folder under the "features" directory. Larger features should be broken up into the following subfolders but simpler ones can just have the files within.
- components: UI components
- screens: UI screen containers (ie. pages)
- models: data models representing the data of your feature
- providers: state management for the feature
- services: handling data from an external service / api
- state management reading/writing and watching to update UI
- singletons for things like storage
- localization
- responsiveness for breakpoints/scaling
- apply different screen/component layouts for desktop by overriding
- clone the repo
- replace all instances of
flutter_skeleton
with yourproject_name
(use the find replace tool in your IDE) - copy the assets/env/example_env as assets/env/dev_env and fill out as needed
- remove and features not required as well as references to them
- run generate function watcher below
- run your app in chrome, ios, android, mac, etc.
make gen
# OR watch for updates:
make gen_watch
- install Flutter Intl plugin (for your IDE)
- read the docs on that plugin, it is super helpful!
- TIP: You can highlight strings and then click the lightbulb to "extract arb"
- make sure the following is imported to the files that have localization
import 'package:flutter_skeleton/generated/l10n.dart';
make build_web