🤖 Generated via Riverpod Core Brick
An example repository meant to show how to handle complex pagination cases, with business logic tests.
For a clean run, remember, use:
flutter clean && flutter pub get && dart run build_runner build -d
Wait until this process is done. It can take a minute~ish.
This application currently supports android, ios.
When you're ready to see this application in action (debug mode), you can run:
# Development
$ flutter run
...And look at this software go!
Building an application can be done through flutter build
, but it's recommended to set up a CI/CD tool before releasing a staging or a production-ready executable.
A few notes about this application (feel free to customize for info, warnings and stuff).
This project uses well-known Clean Architecture principles, with a pinch of pragmatism.
Here's a quick recap of the libraries used in this project:
riverpod
(with theriverpod_hooks
variant), as state management / caching / DI solutionflutter_hooks
to easily handle ephimeral stateriverpod_generator
to superchargeriverpod
riverpod_lint
for a set of great riverpod-related lintsfreezed
equatable
to help testability / ease of usevery_good_analysis
for a set of well-known lints
To run this repo's tests, you can use:
$ 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
This project relies on flutter_localizations and follows the official internationalization guide for Flutter.
- To add a new localizable string, open the
app_en.arb
file atlib/l10n/arb/app_en.arb
.
{
"@@locale": "en",
"counterAppBarTitle": "Counter",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
}
}
- 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": "New Hello World Text"
}
}
- Use the new string
import 'package:{{name.snakeCase()}}/l10n/l10n.dart';
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
return Text(l10n.helloWorld);
}
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>
...