Skip to content

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Address App

Flutter Dart Platform Architecture API

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.

Features

  • 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

Screenshots

Home screen Address details Favorites list Favorites empty state

Tech Stack

  • Flutter (Dart)
  • flutter_modular
  • dio
  • fpdart
  • equatable
  • shared_preferences

Project Structure

lib/
	core/
		error/
		network/
	features/
		app_module.dart
		home/
			data/
			domain/
			presentation/
		favorites/
			data/
			domain/
			presentation/
	shared/
		ui/
		widgets/
	main.dart

test/
	features/
		home/

Architecture Notes

  • Data layer: datasources and repository implementations
  • Domain layer: entities, repository contracts, and use cases
  • Presentation layer: controllers, state models, and widgets/pages
  • App composition: AppModule configures app-level bindings and routes

API Integration

  • Base URL: https://viacep.com.br/ws/
  • Address query format: {cep}/json

Getting Started

Prerequisites

  • Flutter SDK installed
  • A device or emulator configured

Install dependencies

flutter pub get

Run the app

flutter run

Run tests

flutter test

Web (GitHub Pages)

This project can be automatically deployed to GitHub Pages using GitHub Actions.

Workflow file

  • .github/workflows/deploy-pages.yml

Deploy steps

  1. Commit and push changes to main:
git add .
git commit -m "ci: configure github pages deployment"
git push origin main
  1. In GitHub, open the repository settings:
  • Settings -> Pages
  • In Build and deployment, set Source to GitHub Actions
  1. Open the Actions tab and wait for the workflow Deploy Flutter Web to GitHub Pages to finish.

Published URL

  • https://somaycon.github.io/address_app/

Important

  • The workflow builds with --base-href /address_app/, which is required for project pages.
  • If the repository name changes, update the --base-href value in the workflow accordingly.

Current Test Coverage

  • Unit test for GetAddressUsecase

Notes

  • Favorites are stored locally on the device.
  • Network timeout and Dio exception mapping are handled in the core network layer.

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages