lee_musics 0.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 43

lee_musics #

A new flutter plugin project.

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

0.0.1 #

  • TODO: Describe initial release.

example/lib/main.dart

import 'package:lee_musics_example/audio_samples.dart';
import 'package:lee_musics_example/declarative_button_list_components.dart';
import 'package:lee_musics_example/declarative_button_list_whole_state.dart';
import 'package:lee_musics_example/declarative_playlist_components.dart';
import 'package:lee_musics_example/imperative_button_list.dart';
import 'package:lee_musics_example/screen_welcome.dart';
import 'package:lee_musics_example/declarative_button_list_components.dart';
import 'package:flutter/material.dart';
//import 'package:logging/logging.dart';

void main() {
//	Logger.root.level = Level.ALL;
//	Logger.root.onRecord.listen((LogRecord rec) {
//		print('${rec.level.name}: ${rec.time}: ${rec.loggerName}: ${rec.message}');
//	});
	
	runApp(new MyApp());
}

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

class _MyAppState extends State<MyApp> {
	int _activeTabIndex = 0;
	Widget Function() _builder;
	
	@override
	void initState() {
		super.initState();
		_builder = _buildWelcomeScreen;
	}
	
	Widget _buildWelcomeScreen() {
		return new WelcomeScreen();
	}
	
	Widget _buildA() {
		return new ImperativeButtonListScreen(
			audioUrl: audioUrls[audioUrls.length - 1],
		);
	}
	
	Widget _buildB() {
		return new DeclarativeButtonListWholeStateScreen(
			audioUrl: audioUrls[audioUrls.length - 1],
		);
	}
	
	Widget _buildC() {
		return new DeclarativeButtonListComponentsScreen(
			audioUrl: audioUrls[audioUrls.length - 1],
		);
	}

//    return new DeclarativeAudioSimpleExample(
//      audioUrl: STREAM_URL,
//    );

//    return new Audio(
////            audioUrl: 'https://api.soundcloud.com/tracks/405630381/stream?secret_token=s-tj3IS&client_id=LBCcHmRB8XSStWL6wKH2HPACspQlXg2P',
//      audioUrl: 'https://api.soundcloud.com/tracks/9540352/stream?secret_token=s-tj3IS&client_id=LBCcHmRB8XSStWL6wKH2HPACspQlXg2P',
//      playbackState: PlaybackState.playing,
//      buildMe: [
//        WatchableAudioProperties.audioPlayerState,
//      ],
//      playerBuilder: (BuildContext context, AudioPlayer player, Widget child) {
//        IconData icon = Icons.music_note;
//        if (player.state == AudioPlayerState.playing) {
//          icon = Icons.pause;
//        } else if (player.state == AudioPlayerState.paused) {
//          icon = Icons.play_arrow;
//        }
//
//        Function onPressed;
//        if (player.state == AudioPlayerState.playing) {
//          onPressed = player.pause;
//        } else if (player.state == AudioPlayerState.paused) {
//          onPressed = player.play;
//        }
//
//        return new IconButton(
//          icon: new Icon(
//            icon,
//            size: 35.0,
//          ),
//          color: Colors.white,
//          onPressed: onPressed,
//        );
//      },
//    );
	
	Widget _buildD() {
		return new DeclarativePlaylistComponentsScreen(
			playlist: audioUrls,
		);
	}
	
	@override
	Widget build(BuildContext context) {
		return new MaterialApp(
			theme: new ThemeData.dark(),
			home: new Scaffold(
				appBar: new AppBar(
					title: new Text('Fluttery Audio'),
				),
				body: new Center(
					child: _builder(),
				),
				bottomNavigationBar: new BottomNavigationBar(
					currentIndex: _activeTabIndex,
					type: BottomNavigationBarType.fixed,
					items: [
						new BottomNavigationBarItem(
							icon: new Icon(
								Icons.home,
							),
							title: new Text('Welcome'),
						),
						new BottomNavigationBarItem(
							icon: new Icon(
								Icons.music_note,
							),
							title: new Text('A'),
						),
						new BottomNavigationBarItem(
							icon: new Icon(
								Icons.music_note,
							),
							title: new Text('B'),
						),
						new BottomNavigationBarItem(
							icon: new Icon(
								Icons.music_note,
							),
							title: new Text('C'),
						),
						new BottomNavigationBarItem(
							icon: new Icon(
								Icons.music_note,
							),
							title: new Text('D'),
						),
					],
					onTap: (int index) {
						switch (index) {
							case 0:
								setState(() {
									_activeTabIndex = 0;
									_builder = _buildWelcomeScreen;
								});
								break;
							case 1:
								setState(() {
									_activeTabIndex = 1;
									_builder = _buildA;
								});
								break;
							case 2:
								setState(() {
									_activeTabIndex = 2;
									_builder = _buildB;
								});
								break;
							case 3:
								setState(() {
									_activeTabIndex = 3;
									_builder = _buildC;
								});
								break;
							case 4:
								setState(() {
									_activeTabIndex = 4;
									_builder = _buildD;
								});
								break;
						}
					},
				),
			),
		);
	}
}

Use this package as a library

1. Depend on it

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


dependencies:
  lee_musics: ^0.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:lee_musics/lee_musics.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
96
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
43
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.9+1
  • Flutter: 1.17.3

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:lee_musics/lee_musics.dart]

Package does not support Flutter platform macos

Because of import path [package:lee_musics/lee_musics.dart]

Package does not support Flutter platform web

Because of import path [package:lee_musics/lee_musics.dart]

Package does not support Flutter platform windows

Because of import path [package:lee_musics/lee_musics.dart]

Package not compatible with SDK dart

because of import path [lee_musics]

Health suggestions

Fix lib/_playlist.dart. (-1.99 points)

Analysis of lib/_playlist.dart reported 4 hints:

line 32 col 18: 'ancestorStateOfType' is deprecated and shouldn't be used. Use findAncestorStateOfType instead. This feature was deprecated after v1.12.1..

line 32 col 42: 'TypeMatcher' is deprecated and shouldn't be used. TypeMatcher has been deprecated because it is no longer used in framework(only in deprecated methods). This feature was deprecated after v1.12.1..

line 88 col 20: This function has a return type of 'Widget', but doesn't end with a return statement.

line 116 col 18: 'inheritFromWidgetOfExactType' is deprecated and shouldn't be used. Use dependOnInheritedWidgetOfExactType instead. This feature was deprecated after v1.12.1..

Fix lib/_audio_player_widgets.dart. (-1 points)

Analysis of lib/_audio_player_widgets.dart reported 2 hints:

line 11 col 31: 'ancestorStateOfType' is deprecated and shouldn't be used. Use findAncestorStateOfType instead. This feature was deprecated after v1.12.1..

line 11 col 55: 'TypeMatcher' is deprecated and shouldn't be used. TypeMatcher has been deprecated because it is no longer used in framework(only in deprecated methods). This feature was deprecated after v1.12.1..

Fix lib/_audio_player.dart. (-0.50 points)

Analysis of lib/_audio_player.dart reported 1 hint:

line 28 col 32: This function has a return type of 'Future

Fix additional 4 files with analysis or formatting issues. (-0.50 points)

Additional issues in the following files:

  • lib/_audio_visualizer.dart (1 hint)
  • lib/_visualizer.dart (Run flutter format to format lib/_visualizer.dart.)
  • lib/lee_musics.dart (Run flutter format to format lib/lee_musics.dart.)
  • lib/radial_drag_gesture_detector.dart (Run flutter format to format lib/radial_drag_gesture_detector.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

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.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.0
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test