Skip to content

tomavelev/image_client

Repository files navigation

image_client

A new Flutter project for consuming images and marking them as favorites.

As Image Source - the project uses pixabay.

Getting Started

  1. After downloading the project - set your key from https://pixabay.com/api/docs/ to the env.dart
  2. Execute - dart run build_runner build --delete-conflicting-outputs
  3. Run the App

App UI

App UI

The App consists of:

  • Home Screen - with the feature to search, go to favorites, go to details on image tab
  • Recent Searches Functionality - inside the home search field
  • Favorites Screen - very similar to Home with focus on fav images
  • Details Screen - Bigger view and more details about the image. Feature - add/remove from fav.

App Architecture

App Architecture

The app's code is organized in layers

  • Data Access - Wrappers for the Information Sources - external to the App and - the Flutter Engine
  • Repositories - Wrapper for the Data Access - so any exceptions, external (from flutter, or from a package) data models are mapped to internal and known objects
  • Services - In many cases services are just thin bridge between the view+bloc and the data sources. Here is a perfect play for business logic with strict expected input -> output, so they could be wrapped in unit test
  • BloCs - Controllers of the state of the screens
  • Local DIs for Blocs
  • Views / Components / Widgets
  • Global DI
  • Routing
  • I18n (execute 'flutter gen-l10n' after each translation change (in lib/l10n/*.arb))

The code structure is inspired by the Rx Bloc ecosystem with few replacements for less code generation and simplicity.

Testing

The Project includes test samples for

  • Widget Tests - for testing the presence in the tree - the UI elements you are building.
  • Golden Tests - test pixel perfect designs
  • Unit Tests - test small functionality that has strict input-output requirements. Great Examples may be - calculations, encryption, etc
  • BloC Tests - In many cases the business logic is hard to be extracted as Services. Bloc tests - verify expected state of BlocState during/before/after BloC Events.

Flavors

The app demonstrates Flavor/Environment setup

  • Dev
  • Prod

included in the following commit also explained in the article here.

About

Flutter Project - using the bloc state management, get_it for DI, bootstrapped for a day - by request

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors