Coder Social home page Coder Social logo

elias8 / last_fm Goto Github PK

View Code? Open in Web Editor NEW
150.0 5.0 25.0 4.08 MB

A simple app to demonstrate a testable, maintainable, and scalable architecture for flutter. flutter_bloc, get_it, hive, and REST API are some of the tech stacks used in this project.

License: MIT License

Kotlin 0.05% Ruby 1.07% Swift 0.59% Objective-C 0.02% Dart 96.71% HTML 1.56%
flutter dart clean-architecture bloc rest-api hive music lastfm layered-architecture test

last_fm's Introduction

last_fm

example workflow codecov Flutter version License: MIT

A simple app to demonstrate a testable, maintainable, and scalable architecture for flutter. flutter_bloc, hive, and REST API are some of the tech stacks used in this project.


ScreenShots ๐Ÿ“ท

albums artist
top_albums album_detail

Getting Started ๐Ÿš€

For the app to work, you need to provide your own last.fm API key by issuing here.

Once you get your API key, you can run or build the app by using the following command:

# Run
$ flutter run --dart-define=API_KEY=PUT_YOUR_API_KEY_HERE

# Build
$ flutter build --dart-define=API_KEY=PUT_YOUR_API_KEY_HERE

Running Tests ๐Ÿงช

To run all unit and widget tests use the following command:

$ flutter test --coverage --test-randomize-ordering-seed random

To remove generated files from the coverage report, use the following command:

# install remove_from_coverage package 
$ pub global activate remove_from_coverage

# remove `.g.dart` and `.config.dart` files from the coverage report
$ pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '.g.dart', '.config.dart'

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

Working with Translations ๐ŸŒ

This project relies on flutter_localizations and follows the official internationalization guide for Flutter.

Adding Strings

  1. To add a new localized string, open the app_en.arb file at lib/config/l10n/arb/app_en.arb.
{
  "@@locale": "en",
  "appName": "LastFM",
  "@appName": {
    "description": "The application name"
  }
}
  1. Then add a new key/value and description
{
  "@@locale": "en",
  "appName": "LastFM",
  "@appName": {
    "description": "The application name"
  },
  "albums": "Albums",
  "@albums": {
    "description": "Text shown in the AppBar of AlbumsScreen"
  },
}
  1. Use the new string
import 'package:some_app/l10n/l10n.dart';

@override
Widget build(BuildContext context) {
  final l10n = context.l10n;
  return Text(l10n.albums);
}

Adding Supported Locales

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>am</string>
</array>

        ...

Adding Translations

  1. For each supported locale, add a new ARB file in lib/config/l10n/arb.
โ”œโ”€โ”€ l10n
โ”‚   โ”œโ”€โ”€ arb
โ”‚   โ”‚   โ”œโ”€โ”€ app_en.arb
โ”‚   โ”‚   โ””โ”€โ”€ app_am.arb
  1. Add the translated strings to each .arb file:

app_en.arb

{
  "@@locale": "en",
  "appName": "LastFM",
  "@appName": {
    "description": "The application name"
  },
}

app_am.arb

{
  "@@locale": "am",
  "appName": "แ‹จแˆ˜แŒจแˆจแˆป แŠคแ แŠคแˆ",
  "@appName": {
    "description": "แ‹จแˆ˜แ‰ฐแŒแ‰ แˆชแ‹ซ แˆตแˆ"
  },
}

Credit ๐Ÿ™

Thanks to all the people who created and are maintaining these awesome packages used in this project.

Maintainers Packages
Felix Angelov bloc & flutter_bloc, equatable, mocktail
Thomas Burkhart get_it
Milad akarie injectable
Chris Sells go_router
Very Good Ventures For their awesome README template
And everyone else dio, hive, and many more...

Features and bugs

You can file features requests (not intending to add new features, but I will try to add based on requests), bugs or any questions at the issue tracker.

And don't forget to give a star if you find this repo helpful, or you have learned something from it!

Maintainers

last_fm's People

Contributors

elias8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.