diff --git a/src/lib/presentation/pages/queue_page.dart b/src/lib/presentation/pages/queue_page.dart index 7ef2900..7eacc2b 100644 --- a/src/lib/presentation/pages/queue_page.dart +++ b/src/lib/presentation/pages/queue_page.dart @@ -51,38 +51,40 @@ class QueuePage extends StatelessWidget { ), leadingWidth: 56 + HORIZONTAL_PADDING, toolbarHeight: 80.0, - title: Observer(builder: (context) { - final playable = audioStore.playableStream.value; - final numAvailableSongs = audioStore.numAvailableSongs; + title: Observer( + builder: (context) { + final playable = audioStore.playableStream.value; + final numAvailableSongs = audioStore.numAvailableSongs; - Widget subTitle = Container(); + Widget subTitle = Container(); - if (playable != null) { - subTitle = Text( - playable.repr(), - maxLines: 1, + if (playable != null) { + subTitle = Text( + playable.repr(), + maxLines: 1, + ); + } + + String text = '${audioStore.queueLength} songs in queue'; + if (numAvailableSongs > 0) text += ', $numAvailableSongs more available'; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Currently playing'.toUpperCase(), + style: TEXT_SMALL_HEADLINE, + ), + subTitle, + const SizedBox(height: 4.0), + Text( + text, + style: TEXT_SMALL_SUBTITLE.copyWith(color: Colors.white70), + ), + ], ); - } - - String text = '${audioStore.queueLength} songs in queue'; - if (numAvailableSongs > 0) text += ', $numAvailableSongs more available'; - - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Currently playing'.toUpperCase(), - style: TEXT_SMALL_HEADLINE, - ), - subTitle, - const SizedBox(height: 4.0), - Text( - text, - style: TEXT_SMALL_SUBTITLE.copyWith(color: Colors.white70), - ), - ], - ); - }), + }, + ), centerTitle: false, actions: [ Observer( diff --git a/src/lib/presentation/state/audio_store.dart b/src/lib/presentation/state/audio_store.dart index 94be0b7..6136382 100644 --- a/src/lib/presentation/state/audio_store.dart +++ b/src/lib/presentation/state/audio_store.dart @@ -146,7 +146,7 @@ abstract class _AudioStore with Store { @computed bool get hasNext => - (queueIndexStream.value != null && queueIndexStream.value! < _queue.length - 1) || + (queueIndexStream.value != null && queueIndexStream.value! < queueLength - 1) || (loopModeStream.value ?? LoopMode.off) != LoopMode.off; @computed diff --git a/src/lib/presentation/state/queue_page_store.dart b/src/lib/presentation/state/queue_page_store.dart index b0665d6..cc6bd9b 100644 --- a/src/lib/presentation/state/queue_page_store.dart +++ b/src/lib/presentation/state/queue_page_store.dart @@ -30,14 +30,14 @@ abstract class _QueuePageStore with Store { @action void reset() { - isSelected = List.generate(_audioStore.queue.length, (index) => false).asObservable(); + isSelected = List.generate(_audioStore.queueLength, (index) => false).asObservable(); isMultiSelectEnabled = false; } @action void toggleMultiSelect() { if (!isMultiSelectEnabled) { - isSelected = List.generate(_audioStore.queue.length, (index) => false).asObservable(); + isSelected = List.generate(_audioStore.queueLength, (index) => false).asObservable(); } isMultiSelectEnabled = !isMultiSelectEnabled; } @@ -49,12 +49,12 @@ abstract class _QueuePageStore with Store { @action void selectAll() { - isSelected = List.generate(_audioStore.queue.length, (index) => true).asObservable(); + isSelected = List.generate(_audioStore.queueLength, (index) => true).asObservable(); } @action void deselectAll() { - isSelected = List.generate(_audioStore.queue.length, (index) => false).asObservable(); + isSelected = List.generate(_audioStore.queueLength, (index) => false).asObservable(); } void dispose() {} diff --git a/src/lib/system/datasources/drift/history_dao.dart b/src/lib/system/datasources/drift/history_dao.dart index a9e8a57..0f98a2d 100644 --- a/src/lib/system/datasources/drift/history_dao.dart +++ b/src/lib/system/datasources/drift/history_dao.dart @@ -6,8 +6,8 @@ import '../../models/artist_model.dart'; import '../../models/history_entry_model.dart'; import '../../models/playlist_model.dart'; import '../../models/smart_list_model.dart'; -import '../history_data_source.dart'; import '../drift_database.dart'; +import '../history_data_source.dart'; part 'history_dao.g.dart'; diff --git a/src/lib/system/datasources/drift/home_widget_dao.dart b/src/lib/system/datasources/drift/home_widget_dao.dart index 06e578b..c1d92da 100644 --- a/src/lib/system/datasources/drift/home_widget_dao.dart +++ b/src/lib/system/datasources/drift/home_widget_dao.dart @@ -7,8 +7,8 @@ import '../../models/home_widgets/history_model.dart'; import '../../models/home_widgets/home_widget_model.dart'; import '../../models/home_widgets/playlists_model.dart'; import '../../models/home_widgets/shuffle_all_model.dart'; -import '../home_widget_data_source.dart'; import '../drift_database.dart'; +import '../home_widget_data_source.dart'; part 'home_widget_dao.g.dart'; diff --git a/src/pubspec.lock b/src/pubspec.lock index 83b09fb..3c3c266 100644 --- a/src/pubspec.lock +++ b/src/pubspec.lock @@ -524,10 +524,10 @@ packages: dependency: "direct main" description: name: mobx - sha256: "6738620307a424d2c9ad8b873f4dce391c44e9135eb4e75668ac8202fec7a9b8" + sha256: "41f814e90db4d5fe1303efc570db837a56507832c08c4f0842320fa3d40c14cd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.3" mobx_codegen: dependency: "direct dev" description: diff --git a/src/pubspec.yaml b/src/pubspec.yaml index bb1e4d8..e51d8d1 100644 --- a/src/pubspec.yaml +++ b/src/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: flutter_speed_dial: ^6.2.0 # MIT get_it: ^7.1.3 # MIT just_audio: ^0.9.18 # MIT - mobx: ^2.0.1 # MIT + mobx: 2.1.3 # MIT on_audio_query: ^2.6.1 # BSD 3 palette_generator: ^0.3.3+2 # BSD 3 path: ^1.8.0 # BSD 3