Giter Club home page Giter Club logo

spotify-clone-with-flutter-firebase-just_audio-audio_service's Introduction

Spotify Clone with Flutter, Firebase, audio_service and just_audio

This project show you how to create a simple Spotify look-alike app. The app enables users to play songs using the just_audio AudioPlayer. The playback continues as the app is in background mode via the integration with audio_service library.

This project is developed by maxonflutter / atomsbox.com . Feel free to provide feedback or suggest improvements via GitHub.

Features:

  • Flutter UI: Two screens with playlists and songs
  • Audio Player: Integration of the audio_service and just_audio libraries to create a functioning audio player.
  • Database and Storage: Firebase integration to store data and songs

Video Tutorial:

Watch a video tutorial demonstrating the features and usage of this application: YouTube Tutorial

Getting Started

Before you can run the app, you'll have to create a Firebase project and load your assets.

Load the song assets into Cloud Storage

Navigate to your Firebase project:

  1. Open Cloud Storage: Build --> Storage
  2. Click on Upload Files and select the song assets to upload.

Add data to Firestore

To create new documents in a Firestore collection, your db_client should have the set method.

  Future<String> set({
    required String id,
    required String entity,
    required Map<String, dynamic> data,
  }) async {
    try {
      return await _firestore.collection(entity).doc(id).set(data);
    } catch (err) {
      throw Exception('Error adding document: $err');
    }
  }

To add sample data for the user recommendations, you can use the PlaylistRepository.

Create a method to load the sample data from the UserRecommendation class to a document into Firestore.

Future createUserRecommendations() async {
    dbClient.set(
      entity: 'userRecommendations',
      data: UserRecommendations.sampleUserRecommendations.toJson(),
    );
  }

Call the method from the main function

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );

  final dbClient = FirestoreDbClient();
  final playlistRepository = PlaylistRepository(dbClient: dbClient);
  playlistRepository.createUserRecommendations();

  runApp(const MyApp());
}

You can repeat the same step to load the Song data, Playlist data, etc.

Run the app

Open the terminal and run the command:

flutter pub get
flutter run 

spotify-clone-with-flutter-firebase-just_audio-audio_service's People

Contributors

maxonflutter 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.