music_player 0.0.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 69

Music Player #

Gitlab Status Pub Status

A music player flutter plugin that uses the native api to show the currently playing track with cover image and controls.

This plugin is still in development.

Warning: This plugin is written in Swift and Kotlin, so make sure your project is setup to compile these languages.

The required iOS version for this plugin is 10.* because some features to control the audio playback have only been introduced there.

Usage #

A simple usage example

0.0.3 #

  • Add possibility to seek on iOS.
  • Properly send the .onCompleted event on iOS.
  • Change name to Music Player.
  • Add iOS Control Center and Android Notification player controls
  • Add example
  • Add gitlab CI for dartfmt and dartanalyzer

0.0.2 #

  • Added more information to the project.

0.0.1 #

  • The initial release with a working version of the iOS player.

example/example.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:music_player/music_player.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  MusicPlayer musicPlayer;

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Initializing the Music Player and adding a single [PlaylistItem]
  Future<void> initPlatformState() async {
    musicPlayer = MusicPlayer();
    musicPlayer.setPlaylist([
      PlaylistItem(
        trackName: 'Sample',
        albumName: 'Sample Album',
        artistName: 'Sample Artist',
        url: 'https://goo.gl/5RQjTQ',
        coverUrl: 'https://goo.gl/Wd1yPP',
        duration: Duration(seconds: 255),
      )
    ]);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Music Player example app'),
        ),
        body: Center(
          child: RaisedButton(
            onPressed: () => musicPlayer.play(0),
            child: Text('Play'),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  music_player: ^0.0.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:music_player/music_player.dart';
  
Version Uploaded Documentation Archive
0.0.3 Feb 18, 2019 Go to the documentation of music_player 0.0.3 Download music_player 0.0.3 archive
0.0.2 Dec 5, 2018 Go to the documentation of music_player 0.0.2 Download music_player 0.0.2 archive
0.0.1 Dec 5, 2018 Go to the documentation of music_player 0.0.1 Download music_player 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
42
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

We analyzed this package on Feb 18, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13
  • Flutter: 1.2.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
crypto ^2.0.6 2.0.6
flutter 0.0.0
flutter_cache_manager ^0.2.0+1 0.2.0+1 0.3.0-beta.3
meta ^1.1.6 1.1.6 1.1.7
path ^1.6.2 1.6.2
path_provider ^0.4.0 0.4.1 0.5.0+1
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.1.1
http 0.12.0+1
http_parser 3.1.3
shared_preferences 0.4.3 0.5.1+1
sky_engine 0.0.99
source_span 1.5.4
string_scanner 1.0.4
synchronized 1.5.3+2 2.0.2+1
term_glyph 1.1.0
typed_data 1.1.6
uuid 1.0.3 2.0.0
vector_math 2.0.8
Dev dependencies
grinder ^0.8.3