Address App is a Flutter application that looks up Brazilian postal codes (CEP), shows address details, and lets users save favorite addresses locally.
The project follows a feature-first and layered architecture, using Flutter Modular for routing/dependency injection, Dio for HTTP calls, and SharedPreferences for local persistence.
- Search address data by CEP using the ViaCEP API
- Handle loading, success, empty, and error states in the UI
- Save and remove favorite addresses
- Persist favorites locally with SharedPreferences
- Navigate between Home and Favorites modules
- Flutter (Dart)
- flutter_modular
- dio
- fpdart
- equatable
- shared_preferences
lib/
core/
error/
network/
features/
app_module.dart
home/
data/
domain/
presentation/
favorites/
data/
domain/
presentation/
shared/
ui/
widgets/
main.dart
test/
features/
home/
- Data layer: datasources and repository implementations
- Domain layer: entities, repository contracts, and use cases
- Presentation layer: controllers, state models, and widgets/pages
- App composition:
AppModuleconfigures app-level bindings and routes
- Base URL:
https://viacep.com.br/ws/ - Address query format:
{cep}/json
- Flutter SDK installed
- A device or emulator configured
flutter pub getflutter runflutter testThis project can be automatically deployed to GitHub Pages using GitHub Actions.
.github/workflows/deploy-pages.yml
- Commit and push changes to
main:
git add .
git commit -m "ci: configure github pages deployment"
git push origin main- In GitHub, open the repository settings:
Settings->Pages- In
Build and deployment, setSourcetoGitHub Actions
- Open the
Actionstab and wait for the workflowDeploy Flutter Web to GitHub Pagesto finish.
https://somaycon.github.io/address_app/
- The workflow builds with
--base-href /address_app/, which is required for project pages. - If the repository name changes, update the
--base-hrefvalue in the workflow accordingly.
- Unit test for
GetAddressUsecase
- Favorites are stored locally on the device.
- Network timeout and Dio exception mapping are handled in the core network layer.



