diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json
new file mode 100644
index 0000000..86d2431
--- /dev/null
+++ b/.dart_tool/package_config.json
@@ -0,0 +1,146 @@
+{
+ "configVersion": 2,
+ "packages": [
+ {
+ "name": "async",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/async-2.10.0",
+ "packageUri": "lib/",
+ "languageVersion": "2.18"
+ },
+ {
+ "name": "boolean_selector",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1",
+ "packageUri": "lib/",
+ "languageVersion": "2.17"
+ },
+ {
+ "name": "characters",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/characters-1.2.1",
+ "packageUri": "lib/",
+ "languageVersion": "2.12"
+ },
+ {
+ "name": "clock",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/clock-1.1.1",
+ "packageUri": "lib/",
+ "languageVersion": "2.12"
+ },
+ {
+ "name": "collection",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/collection-1.17.0",
+ "packageUri": "lib/",
+ "languageVersion": "2.12"
+ },
+ {
+ "name": "fake_async",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/fake_async-1.3.1",
+ "packageUri": "lib/",
+ "languageVersion": "2.12"
+ },
+ {
+ "name": "flute_music_player",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/flute_music_player-0.0.6",
+ "packageUri": "lib/",
+ "languageVersion": "2.0"
+ },
+ {
+ "name": "flutter",
+ "rootUri": "file:///home/maurice/snap/flutter/common/flutter/packages/flutter",
+ "packageUri": "lib/",
+ "languageVersion": "2.17"
+ },
+ {
+ "name": "flutter_test",
+ "rootUri": "file:///home/maurice/snap/flutter/common/flutter/packages/flutter_test",
+ "packageUri": "lib/",
+ "languageVersion": "2.17"
+ },
+ {
+ "name": "js",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/js-0.6.5",
+ "packageUri": "lib/",
+ "languageVersion": "2.16"
+ },
+ {
+ "name": "matcher",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/matcher-0.12.13",
+ "packageUri": "lib/",
+ "languageVersion": "2.18"
+ },
+ {
+ "name": "material_color_utilities",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/material_color_utilities-0.2.0",
+ "packageUri": "lib/",
+ "languageVersion": "2.13"
+ },
+ {
+ "name": "meta",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/meta-1.8.0",
+ "packageUri": "lib/",
+ "languageVersion": "2.12"
+ },
+ {
+ "name": "path",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/path-1.8.2",
+ "packageUri": "lib/",
+ "languageVersion": "2.12"
+ },
+ {
+ "name": "sky_engine",
+ "rootUri": "file:///home/maurice/snap/flutter/common/flutter/bin/cache/pkg/sky_engine",
+ "packageUri": "lib/",
+ "languageVersion": "2.12"
+ },
+ {
+ "name": "source_span",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/source_span-1.9.1",
+ "packageUri": "lib/",
+ "languageVersion": "2.14"
+ },
+ {
+ "name": "stack_trace",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/stack_trace-1.11.0",
+ "packageUri": "lib/",
+ "languageVersion": "2.18"
+ },
+ {
+ "name": "stream_channel",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/stream_channel-2.1.1",
+ "packageUri": "lib/",
+ "languageVersion": "2.14"
+ },
+ {
+ "name": "string_scanner",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/string_scanner-1.2.0",
+ "packageUri": "lib/",
+ "languageVersion": "2.18"
+ },
+ {
+ "name": "term_glyph",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/term_glyph-1.2.1",
+ "packageUri": "lib/",
+ "languageVersion": "2.12"
+ },
+ {
+ "name": "test_api",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/test_api-0.4.16",
+ "packageUri": "lib/",
+ "languageVersion": "2.18"
+ },
+ {
+ "name": "vector_math",
+ "rootUri": "file:///home/maurice/.pub-cache/hosted/pub.dev/vector_math-2.1.4",
+ "packageUri": "lib/",
+ "languageVersion": "2.14"
+ },
+ {
+ "name": "flute_example",
+ "rootUri": "../",
+ "packageUri": "lib/",
+ "languageVersion": "2.19"
+ }
+ ],
+ "generated": "2023-08-19T01:55:03.239268Z",
+ "generator": "pub",
+ "generatorVersion": "2.19.5"
+}
diff --git a/.dart_tool/package_config_subset b/.dart_tool/package_config_subset
new file mode 100644
index 0000000..6c4ec96
--- /dev/null
+++ b/.dart_tool/package_config_subset
@@ -0,0 +1,93 @@
+async
+2.18
+file:///home/maurice/.pub-cache/hosted/pub.dev/async-2.10.0/
+file:///home/maurice/.pub-cache/hosted/pub.dev/async-2.10.0/lib/
+boolean_selector
+2.17
+file:///home/maurice/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1/
+file:///home/maurice/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1/lib/
+characters
+2.12
+file:///home/maurice/.pub-cache/hosted/pub.dev/characters-1.2.1/
+file:///home/maurice/.pub-cache/hosted/pub.dev/characters-1.2.1/lib/
+clock
+2.12
+file:///home/maurice/.pub-cache/hosted/pub.dev/clock-1.1.1/
+file:///home/maurice/.pub-cache/hosted/pub.dev/clock-1.1.1/lib/
+collection
+2.12
+file:///home/maurice/.pub-cache/hosted/pub.dev/collection-1.17.0/
+file:///home/maurice/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/
+fake_async
+2.12
+file:///home/maurice/.pub-cache/hosted/pub.dev/fake_async-1.3.1/
+file:///home/maurice/.pub-cache/hosted/pub.dev/fake_async-1.3.1/lib/
+flute_music_player
+2.0
+file:///home/maurice/.pub-cache/hosted/pub.dev/flute_music_player-0.0.6/
+file:///home/maurice/.pub-cache/hosted/pub.dev/flute_music_player-0.0.6/lib/
+js
+2.16
+file:///home/maurice/.pub-cache/hosted/pub.dev/js-0.6.5/
+file:///home/maurice/.pub-cache/hosted/pub.dev/js-0.6.5/lib/
+matcher
+2.18
+file:///home/maurice/.pub-cache/hosted/pub.dev/matcher-0.12.13/
+file:///home/maurice/.pub-cache/hosted/pub.dev/matcher-0.12.13/lib/
+material_color_utilities
+2.13
+file:///home/maurice/.pub-cache/hosted/pub.dev/material_color_utilities-0.2.0/
+file:///home/maurice/.pub-cache/hosted/pub.dev/material_color_utilities-0.2.0/lib/
+meta
+2.12
+file:///home/maurice/.pub-cache/hosted/pub.dev/meta-1.8.0/
+file:///home/maurice/.pub-cache/hosted/pub.dev/meta-1.8.0/lib/
+path
+2.12
+file:///home/maurice/.pub-cache/hosted/pub.dev/path-1.8.2/
+file:///home/maurice/.pub-cache/hosted/pub.dev/path-1.8.2/lib/
+source_span
+2.14
+file:///home/maurice/.pub-cache/hosted/pub.dev/source_span-1.9.1/
+file:///home/maurice/.pub-cache/hosted/pub.dev/source_span-1.9.1/lib/
+stack_trace
+2.18
+file:///home/maurice/.pub-cache/hosted/pub.dev/stack_trace-1.11.0/
+file:///home/maurice/.pub-cache/hosted/pub.dev/stack_trace-1.11.0/lib/
+stream_channel
+2.14
+file:///home/maurice/.pub-cache/hosted/pub.dev/stream_channel-2.1.1/
+file:///home/maurice/.pub-cache/hosted/pub.dev/stream_channel-2.1.1/lib/
+string_scanner
+2.18
+file:///home/maurice/.pub-cache/hosted/pub.dev/string_scanner-1.2.0/
+file:///home/maurice/.pub-cache/hosted/pub.dev/string_scanner-1.2.0/lib/
+term_glyph
+2.12
+file:///home/maurice/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/
+file:///home/maurice/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/lib/
+test_api
+2.18
+file:///home/maurice/.pub-cache/hosted/pub.dev/test_api-0.4.16/
+file:///home/maurice/.pub-cache/hosted/pub.dev/test_api-0.4.16/lib/
+vector_math
+2.14
+file:///home/maurice/.pub-cache/hosted/pub.dev/vector_math-2.1.4/
+file:///home/maurice/.pub-cache/hosted/pub.dev/vector_math-2.1.4/lib/
+flute_example
+2.19
+file:///home/maurice/DEV/FLUTTER%20PROJECTS/Flutter-Music-Player/
+file:///home/maurice/DEV/FLUTTER%20PROJECTS/Flutter-Music-Player/lib/
+sky_engine
+2.12
+file:///home/maurice/snap/flutter/common/flutter/bin/cache/pkg/sky_engine/
+file:///home/maurice/snap/flutter/common/flutter/bin/cache/pkg/sky_engine/lib/
+flutter
+2.17
+file:///home/maurice/snap/flutter/common/flutter/packages/flutter/
+file:///home/maurice/snap/flutter/common/flutter/packages/flutter/lib/
+flutter_test
+2.17
+file:///home/maurice/snap/flutter/common/flutter/packages/flutter_test/
+file:///home/maurice/snap/flutter/common/flutter/packages/flutter_test/lib/
+2
diff --git a/.dart_tool/version b/.dart_tool/version
new file mode 100644
index 0000000..b21f0b7
--- /dev/null
+++ b/.dart_tool/version
@@ -0,0 +1 @@
+3.7.8
\ No newline at end of file
diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies
new file mode 100644
index 0000000..c6869dd
--- /dev/null
+++ b/.flutter-plugins-dependencies
@@ -0,0 +1 @@
+{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flute_music_player","path":"/home/maurice/.pub-cache/hosted/pub.dev/flute_music_player-0.0.6/","native_build":true,"dependencies":[]}],"android":[{"name":"flute_music_player","path":"/home/maurice/.pub-cache/hosted/pub.dev/flute_music_player-0.0.6/","native_build":true,"dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flute_music_player","dependencies":[]}],"date_created":"2023-08-19 04:55:04.363397","version":"3.7.8"}
\ No newline at end of file
diff --git a/android/.settings/org.eclipse.buildship.core.prefs b/android/.settings/org.eclipse.buildship.core.prefs
index 15ece0f..e479558 100644
--- a/android/.settings/org.eclipse.buildship.core.prefs
+++ b/android/.settings/org.eclipse.buildship.core.prefs
@@ -1,2 +1,13 @@
-#Mon Mar 26 15:51:11 IST 2018
+arguments=
+auto.sync=false
+build.scans.enabled=false
+connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
+eclipse.preferences.version=1
+gradle.user.home=
+java.home=
+jvm.arguments=
+offline.mode=false
+override.workspace.settings=false
+show.console.view=false
+show.executions.view=false
diff --git a/android/app/.project b/android/app/.project
index ac485d7..12339e2 100644
--- a/android/app/.project
+++ b/android/app/.project
@@ -20,4 +20,15 @@
org.eclipse.jdt.core.javanature
org.eclipse.buildship.core.gradleprojectnature
+
+
+ 1692408522736
+
+ 30
+
+ org.eclipse.core.resources.regexFilterMatcher
+ node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
+
+
+
diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh
new file mode 100755
index 0000000..d8da77b
--- /dev/null
+++ b/ios/Flutter/flutter_export_environment.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+# This is a generated file; do not edit or check into version control.
+export "FLUTTER_ROOT=/home/maurice/snap/flutter/common/flutter"
+export "FLUTTER_APPLICATION_PATH=/home/maurice/DEV/FLUTTER PROJECTS/Flutter-Music-Player"
+export "COCOAPODS_PARALLEL_CODE_SIGN=true"
+export "FLUTTER_TARGET=lib/main.dart"
+export "FLUTTER_BUILD_DIR=build"
+export "FLUTTER_BUILD_NAME=1.0.0"
+export "FLUTTER_BUILD_NUMBER=1"
+export "DART_OBFUSCATION=false"
+export "TRACK_WIDGET_CREATION=true"
+export "TREE_SHAKE_ICONS=false"
+export "PACKAGE_CONFIG=.dart_tool/package_config.json"
diff --git a/lib/data/song_data.dart b/lib/data/song_data.dart
index f5e1ecd..94e8679 100644
--- a/lib/data/song_data.dart
+++ b/lib/data/song_data.dart
@@ -1,10 +1,12 @@
-import 'package:flute_music_player/flute_music_player.dart';
+
import 'dart:math';
+import 'package:flute_music_player/flute_music_player.dart';
+
class SongData {
List _songs;
int _currentSongIndex = -1;
- MusicFinder musicFinder;
+ MusicFinder? musicFinder;
SongData(this._songs) {
musicFinder = new MusicFinder();
}
@@ -23,7 +25,7 @@ class SongData {
if (_currentSongIndex < length) {
_currentSongIndex++;
}
- if (_currentSongIndex >= length) return null;
+ if (_currentSongIndex >= length) return Song.fromMap( {});
return _songs[_currentSongIndex];
}
@@ -36,9 +38,9 @@ class SongData {
if (_currentSongIndex > 0) {
_currentSongIndex--;
}
- if (_currentSongIndex < 0) return null;
+ if (_currentSongIndex < 0) return Song.fromMap( {});
return _songs[_currentSongIndex];
}
- MusicFinder get audioPlayer => musicFinder;
+ MusicFinder get audioPlayer => musicFinder!;
}
diff --git a/lib/my_app.dart b/lib/my_app.dart
index 0a8e2bf..162b5b7 100644
--- a/lib/my_app.dart
+++ b/lib/my_app.dart
@@ -10,7 +10,7 @@ class MyApp extends StatefulWidget {
}
class _MyAppState extends State {
- SongData songData;
+ SongData? songData;
bool _isLoading = true;
@override
@@ -22,7 +22,7 @@ class _MyAppState extends State {
@override
void dispose() {
super.dispose();
- songData.audioPlayer.stop();
+ songData?.audioPlayer.stop();
}
// Platform messages are asynchronous, so we initialize in an async method.
@@ -33,7 +33,7 @@ class _MyAppState extends State {
try {
songs = await MusicFinder.allSongs();
} catch (e) {
- print("Failed to get songs: '${e.message}'.");
+ print("Failed to get songs: $e.");
}
print(songs);
@@ -50,6 +50,6 @@ class _MyAppState extends State {
@override
Widget build(BuildContext context) {
- return new MPInheritedWidget(songData, _isLoading, new RootPage());
+ return new MPInheritedWidget(songData!, _isLoading, new RootPage());
}
}
diff --git a/lib/pages/now_playing.dart b/lib/pages/now_playing.dart
index b6c8534..582a878 100644
--- a/lib/pages/now_playing.dart
+++ b/lib/pages/now_playing.dart
@@ -14,18 +14,18 @@ class NowPlaying extends StatefulWidget {
final Song _song;
final SongData songData;
final bool nowPlayTap;
- NowPlaying(this.songData, this._song, {this.nowPlayTap});
+ NowPlaying(this.songData, this._song, this.nowPlayTap);
@override
_NowPlayingState createState() => new _NowPlayingState();
}
class _NowPlayingState extends State {
- MusicFinder audioPlayer;
- Duration duration;
- Duration position;
- PlayerState playerState;
- Song song;
+ MusicFinder? audioPlayer;
+ Duration? duration;
+ Duration? position;
+ PlayerState? playerState;
+ Song? song;
get isPlaying => playerState == PlayerState.playing;
get isPaused => playerState == PlayerState.paused;
@@ -64,28 +64,28 @@ class _NowPlayingState extends State {
stop();
}
}
- play(song);
+ play(song!);
// else {
// widget._song;
// playerState = PlayerState.playing;
// }
});
- audioPlayer.setDurationHandler((d) => setState(() {
+ audioPlayer?.setDurationHandler((d) => setState(() {
duration = d;
}));
- audioPlayer.setPositionHandler((p) => setState(() {
+ audioPlayer?.setPositionHandler((p) => setState(() {
position = p;
}));
- audioPlayer.setCompletionHandler(() {
+ audioPlayer?.setCompletionHandler(() {
onComplete();
setState(() {
position = duration;
});
});
- audioPlayer.setErrorHandler((msg) {
+ audioPlayer?.setErrorHandler((msg) {
setState(() {
playerState = PlayerState.stopped;
duration = new Duration(seconds: 0);
@@ -96,7 +96,7 @@ class _NowPlayingState extends State {
Future play(Song s) async {
if (s != null) {
- final result = await audioPlayer.play(s.uri, isLocal: true);
+ final result = await audioPlayer?.play(s.uri, isLocal: true);
if (result == 1)
setState(() {
playerState = PlayerState.playing;
@@ -106,12 +106,12 @@ class _NowPlayingState extends State {
}
Future pause() async {
- final result = await audioPlayer.pause();
+ final result = await audioPlayer?.pause();
if (result == 1) setState(() => playerState = PlayerState.paused);
}
Future stop() async {
- final result = await audioPlayer.stop();
+ final result = await audioPlayer?.stop();
if (result == 1)
setState(() {
playerState = PlayerState.stopped;
@@ -132,7 +132,7 @@ class _NowPlayingState extends State {
}
Future mute(bool muted) async {
- final result = await audioPlayer.mute(muted);
+ final result = await audioPlayer?.mute(muted);
if (result == 1)
setState(() {
isMuted = muted;
@@ -147,11 +147,11 @@ class _NowPlayingState extends State {
new Column(
children: [
new Text(
- song.title,
- style: Theme.of(context).textTheme.headline,
+ song!.title,
+ style: Theme.of(context).textTheme.headlineLarge,
),
new Text(
- song.artist,
+ song!.artist,
style: Theme.of(context).textTheme.caption,
),
new Padding(
@@ -168,11 +168,11 @@ class _NowPlayingState extends State {
duration == null
? new Container()
: new Slider(
- value: position?.inMilliseconds?.toDouble() ?? 0,
+ value: position?.inMilliseconds.toDouble() ?? 0,
onChanged: (double value) =>
- audioPlayer.seek((value / 1000).roundToDouble()),
+ audioPlayer?.seek((value / 1000).roundToDouble()),
min: 0.0,
- max: duration.inMilliseconds.toDouble()),
+ max: duration!.inMilliseconds.toDouble()),
new Row(mainAxisSize: MainAxisSize.min, children: [
new Text(
position != null
@@ -215,7 +215,7 @@ class _NowPlayingState extends State {
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
- new AlbumUI(song, duration, position),
+ new AlbumUI(song!, duration!, position!),
new Material(
child: _buildPlayer(),
color: Colors.transparent,
@@ -231,7 +231,7 @@ class _NowPlayingState extends State {
color: Theme.of(context).backgroundColor,
child: new Stack(
fit: StackFit.expand,
- children: [blurWidget(song), blurFilter(), playerUI],
+ children: [blurWidget(song!), blurFilter(), playerUI],
),
),
);
diff --git a/lib/pages/root_page.dart b/lib/pages/root_page.dart
index ee3b9a2..76f6d14 100644
--- a/lib/pages/root_page.dart
+++ b/lib/pages/root_page.dart
@@ -14,15 +14,15 @@ class RootPage extends StatelessWidget {
context,
new MaterialPageRoute(
builder: (context) => new NowPlaying(
- rootIW.songData,
+ rootIW!.songData,
s,
- nowPlayTap: nowPlayTap,
+ nowPlayTap,
)));
}
//Shuffle Songs and goto now playing page
void shuffleSongs() {
- goToNowPlaying(rootIW.songData.randomSong);
+ goToNowPlaying(rootIW!.songData.randomSong);
}
return new Scaffold(
@@ -35,7 +35,7 @@ class RootPage extends StatelessWidget {
child: new InkWell(
child: new Text("Now Playing"),
onTap: () => goToNowPlaying(
- rootIW.songData.songs[
+ rootIW!.songData.songs[
(rootIW.songData.currentIndex == null ||
rootIW.songData.currentIndex < 0)
? 0
@@ -47,7 +47,7 @@ class RootPage extends StatelessWidget {
],
),
// drawer: new MPDrawer(),
- body: rootIW.isLoading
+ body: rootIW!.isLoading
? new Center(child: new CircularProgressIndicator())
: new Scrollbar(child: new MPListView()),
floatingActionButton: new FloatingActionButton(
diff --git a/lib/widgets/mp_album_ui.dart b/lib/widgets/mp_album_ui.dart
index 0493834..82c35bb 100644
--- a/lib/widgets/mp_album_ui.dart
+++ b/lib/widgets/mp_album_ui.dart
@@ -14,8 +14,8 @@ class AlbumUI extends StatefulWidget {
}
class AlbumUIState extends State with SingleTickerProviderStateMixin {
- Animation animation;
- AnimationController animationController;
+ Animation? animation;
+ AnimationController? animationController;
@override
initState() {
@@ -23,15 +23,15 @@ class AlbumUIState extends State with SingleTickerProviderStateMixin {
animationController = new AnimationController(
vsync: this, duration: new Duration(seconds: 1));
animation = new CurvedAnimation(
- parent: animationController, curve: Curves.elasticOut);
- animation.addListener(() => this.setState(() {}));
- animationController.forward();
+ parent: animationController!, curve: Curves.elasticOut);
+ animation!.addListener(() => this.setState(() {}));
+ animationController!.forward();
}
@override
void dispose() {
super.dispose();
- animationController.dispose();
+ animationController!.dispose();
}
@override
@@ -62,7 +62,7 @@ class AlbumUIState extends State with SingleTickerProviderStateMixin {
);
return new SizedBox.fromSize(
- size: new Size(animation.value * 250.0, animation.value * 250.0),
+ size: new Size(animation!.value * 250.0, animation!.value * 250.0),
child: new Stack(
children: [
myHero,
@@ -79,8 +79,8 @@ class AlbumUIState extends State with SingleTickerProviderStateMixin {
new LinearProgressIndicator(
value: widget.position != null &&
widget.position.inMilliseconds > 0
- ? (widget.position?.inMilliseconds?.toDouble() ?? 0.0) /
- (widget.duration?.inMilliseconds?.toDouble() ?? 0.0)
+ ? (widget.position.inMilliseconds.toDouble() ) /
+ (widget.duration.inMilliseconds.toDouble() )
: 0.0,
valueColor:
new AlwaysStoppedAnimation(Theme.of(context).cardColor),
diff --git a/lib/widgets/mp_drawer.dart b/lib/widgets/mp_drawer.dart
index 58079d6..954a504 100644
--- a/lib/widgets/mp_drawer.dart
+++ b/lib/widgets/mp_drawer.dart
@@ -10,7 +10,7 @@ class MPDrawer extends StatefulWidget {
}
class MPDrawerState extends State {
- bool dark;
+ bool? dark;
@override
initState() {
super.initState();
@@ -18,7 +18,7 @@ class MPDrawerState extends State {
@override
Widget build(BuildContext context) {
- var rootIW = MPInheritedWidget.of(context).songData;
+ var rootIW = MPInheritedWidget.of(context)!.songData;
var cI = rootIW.currentIndex;
Song song =
rootIW.songs[((cI == null) || (cI < 0)) ? 0 : rootIW.currentIndex];
diff --git a/lib/widgets/mp_inherited.dart b/lib/widgets/mp_inherited.dart
index 5ef8e83..ea86c90 100644
--- a/lib/widgets/mp_inherited.dart
+++ b/lib/widgets/mp_inherited.dart
@@ -8,8 +8,8 @@ class MPInheritedWidget extends InheritedWidget {
const MPInheritedWidget(this.songData, this.isLoading, child)
: super(child: child);
- static MPInheritedWidget of(BuildContext context) {
- return context.inheritFromWidgetOfExactType(MPInheritedWidget);
+ static MPInheritedWidget? of(BuildContext context) {
+ return context.dependOnInheritedWidgetOfExactType();
}
@override
diff --git a/lib/widgets/mp_lisview.dart b/lib/widgets/mp_lisview.dart
index a08434f..b1a7353 100644
--- a/lib/widgets/mp_lisview.dart
+++ b/lib/widgets/mp_lisview.dart
@@ -10,7 +10,7 @@ class MPListView extends StatelessWidget {
@override
Widget build(BuildContext context) {
final rootIW = MPInheritedWidget.of(context);
- SongData songData = rootIW.songData;
+ SongData songData = rootIW!.songData;
return new ListView.builder(
itemCount: songData.songs.length,
itemBuilder: (context, int index) {
@@ -22,7 +22,7 @@ class MPListView extends StatelessWidget {
return new ListTile(
dense: false,
leading: new Hero(
- child: avatar(artFile, s.title, color),
+ child: avatar(artFile!, s.title, color),
tag: s.title,
),
title: new Text(s.title),
@@ -35,7 +35,7 @@ class MPListView extends StatelessWidget {
Navigator.push(
context,
new MaterialPageRoute(
- builder: (context) => new NowPlaying(songData, s)));
+ builder: (context) => new NowPlaying(songData, s, false)));
},
);
},
diff --git a/pubspec.lock b/pubspec.lock
index 26c787d..ee4f410 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -1,95 +1,60 @@
# Generated by pub
-# See https://www.dartlang.org/tools/pub/glossary#lockfile
+# See https://dart.dev/tools/pub/glossary#lockfile
packages:
- analyzer:
- dependency: transitive
- description:
- name: analyzer
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.31.1"
- args:
- dependency: transitive
- description:
- name: args
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.4.1"
async:
dependency: transitive
description:
name: async
- url: "https://pub.dartlang.org"
+ sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
+ url: "https://pub.dev"
source: hosted
- version: "2.0.6"
- barback:
- dependency: transitive
- description:
- name: barback
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.15.2+14"
+ version: "2.10.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
- url: "https://pub.dartlang.org"
+ sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
+ url: "https://pub.dev"
source: hosted
- version: "1.0.3"
- charcode:
+ version: "2.1.1"
+ characters:
dependency: transitive
description:
- name: charcode
- url: "https://pub.dartlang.org"
+ name: characters
+ sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
+ url: "https://pub.dev"
source: hosted
- version: "1.1.1"
- cli_util:
+ version: "1.2.1"
+ clock:
dependency: transitive
description:
- name: cli_util
- url: "https://pub.dartlang.org"
+ name: clock
+ sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
+ url: "https://pub.dev"
source: hosted
- version: "0.1.2+1"
+ version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
- url: "https://pub.dartlang.org"
+ sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
+ url: "https://pub.dev"
source: hosted
- version: "1.14.6"
- convert:
+ version: "1.17.0"
+ fake_async:
dependency: transitive
description:
- name: convert
- url: "https://pub.dartlang.org"
+ name: fake_async
+ sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
+ url: "https://pub.dev"
source: hosted
- version: "2.0.1"
- crypto:
- dependency: transitive
- description:
- name: crypto
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.2+1"
- csslib:
- dependency: transitive
- description:
- name: csslib
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.14.1"
- cupertino_icons:
- dependency: "direct main"
- description:
- name: cupertino_icons
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.1.1"
+ version: "1.3.1"
flute_music_player:
dependency: "direct main"
description:
name: flute_music_player
- url: "https://pub.dartlang.org"
+ sha256: "74c0797e55a551751b0e2029def278d2d32f912f84326659c56e9230e150e1f8"
+ url: "https://pub.dev"
source: hosted
version: "0.0.6"
flutter:
@@ -102,304 +67,106 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
- front_end:
- dependency: transitive
- description:
- name: front_end
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.1.0-alpha.9"
- glob:
- dependency: transitive
- description:
- name: glob
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.5"
- html:
- dependency: transitive
- description:
- name: html
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.13.3"
- http:
- dependency: transitive
- description:
- name: http
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.11.3+16"
- http_multi_server:
- dependency: transitive
- description:
- name: http_multi_server
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.4"
- http_parser:
- dependency: transitive
- description:
- name: http_parser
- url: "https://pub.dartlang.org"
- source: hosted
- version: "3.1.1"
- io:
- dependency: transitive
- description:
- name: io
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.3.2+1"
- isolate:
- dependency: transitive
- description:
- name: isolate
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.0"
js:
dependency: transitive
description:
name: js
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.6.1"
- kernel:
- dependency: transitive
- description:
- name: kernel
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.3.0-alpha.9"
- logging:
- dependency: transitive
- description:
- name: logging
- url: "https://pub.dartlang.org"
+ sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
+ url: "https://pub.dev"
source: hosted
- version: "0.11.3+1"
+ version: "0.6.5"
matcher:
dependency: transitive
description:
name: matcher
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.12.1+4"
- meta:
- dependency: transitive
- description:
- name: meta
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.2"
- mime:
- dependency: transitive
- description:
- name: mime
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.9.6"
- mockito:
- dependency: transitive
- description:
- name: mockito
- url: "https://pub.dartlang.org"
+ sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
+ url: "https://pub.dev"
source: hosted
- version: "2.2.3"
- multi_server_socket:
+ version: "0.12.13"
+ material_color_utilities:
dependency: transitive
description:
- name: multi_server_socket
- url: "https://pub.dartlang.org"
+ name: material_color_utilities
+ sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
+ url: "https://pub.dev"
source: hosted
- version: "1.0.1"
- node_preamble:
- dependency: transitive
- description:
- name: node_preamble
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.4.0"
- package_config:
- dependency: transitive
- description:
- name: package_config
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.3"
- package_resolver:
+ version: "0.2.0"
+ meta:
dependency: transitive
description:
- name: package_resolver
- url: "https://pub.dartlang.org"
+ name: meta
+ sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
+ url: "https://pub.dev"
source: hosted
- version: "1.0.2"
+ version: "1.8.0"
path:
dependency: transitive
description:
name: path
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.5.1"
- plugin:
- dependency: transitive
- description:
- name: plugin
- url: "https://pub.dartlang.org"
+ sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
+ url: "https://pub.dev"
source: hosted
- version: "0.2.0+2"
- pool:
- dependency: transitive
- description:
- name: pool
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.3.4"
- pub_semver:
- dependency: transitive
- description:
- name: pub_semver
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.3.2"
- quiver:
- dependency: transitive
- description:
- name: quiver
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.28.0"
- shelf:
- dependency: transitive
- description:
- name: shelf
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.7.2"
- shelf_packages_handler:
- dependency: transitive
- description:
- name: shelf_packages_handler
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.3"
- shelf_static:
- dependency: transitive
- description:
- name: shelf_static
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.7"
- shelf_web_socket:
- dependency: transitive
- description:
- name: shelf_web_socket
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.2"
+ version: "1.8.2"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
- source_map_stack_trace:
- dependency: transitive
- description:
- name: source_map_stack_trace
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.4"
- source_maps:
- dependency: transitive
- description:
- name: source_maps
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.10.4"
source_span:
dependency: transitive
description:
name: source_span
- url: "https://pub.dartlang.org"
+ sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
+ url: "https://pub.dev"
source: hosted
- version: "1.4.0"
+ version: "1.9.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
- url: "https://pub.dartlang.org"
+ sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
+ url: "https://pub.dev"
source: hosted
- version: "1.9.2"
+ version: "1.11.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
- url: "https://pub.dartlang.org"
+ sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
+ url: "https://pub.dev"
source: hosted
- version: "1.6.4"
+ version: "2.1.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
- url: "https://pub.dartlang.org"
+ sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
+ url: "https://pub.dev"
source: hosted
- version: "1.0.2"
+ version: "1.2.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.0"
- test:
- dependency: transitive
- description:
- name: test
- url: "https://pub.dartlang.org"
+ sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
+ url: "https://pub.dev"
source: hosted
- version: "0.12.32+1"
- typed_data:
+ version: "1.2.1"
+ test_api:
dependency: transitive
description:
- name: typed_data
- url: "https://pub.dartlang.org"
+ name: test_api
+ sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
+ url: "https://pub.dev"
source: hosted
- version: "1.1.5"
- utf:
- dependency: transitive
- description:
- name: utf
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.9.0+4"
+ version: "0.4.16"
vector_math:
dependency: transitive
description:
name: vector_math
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.5"
- watcher:
- dependency: transitive
- description:
- name: watcher
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.9.7+7"
- web_socket_channel:
- dependency: transitive
- description:
- name: web_socket_channel
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.7"
- yaml:
- dependency: transitive
- description:
- name: yaml
- url: "https://pub.dartlang.org"
+ sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
+ url: "https://pub.dev"
source: hosted
- version: "2.1.13"
+ version: "2.1.4"
sdks:
- dart: ">=2.0.0-dev.28.0 <=2.0.0-edge.0d5cf900b021bf5c9fa593ffa12b15bcd1cc5fe0"
+ dart: ">=2.19.5 <3.0.0"
diff --git a/pubspec.yaml b/pubspec.yaml
index 645499f..6ed06e0 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -2,13 +2,17 @@ name: flute_example
description: Demonstrates how to use the flute_music_player plugin.
dependencies:
+ flute_music_player: ^0.0.6
flutter:
sdk: flutter
+environment:
+ sdk: '>=2.19.5 <3.0.0'
+
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
- cupertino_icons: ^0.1.0
- flute_music_player: ^0.0.6
+ #cupertino_icons: ^1.0.2
+
dev_dependencies:
flutter_test: