mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 10:47:25 +01:00
Move reusable code from mobile to common
This will be useful for a future desktop application.
This commit is contained in:
parent
6e1255f26e
commit
711b19c998
40 changed files with 813 additions and 581 deletions
|
|
@ -1,17 +1,15 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:musicus_common/musicus_common.dart';
|
||||
import 'package:musicus_database/musicus_database.dart';
|
||||
|
||||
import '../backend.dart';
|
||||
import '../music_library.dart';
|
||||
import '../screens/program.dart';
|
||||
|
||||
import 'play_pause_button.dart';
|
||||
import 'texts.dart';
|
||||
|
||||
class PlayerBar extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final backend = Backend.of(context);
|
||||
final backend = MusicusBackend.of(context);
|
||||
|
||||
return BottomAppBar(
|
||||
child: InkWell(
|
||||
|
|
@ -19,7 +17,7 @@ class PlayerBar extends StatelessWidget {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
StreamBuilder(
|
||||
stream: backend.player.normalizedPosition,
|
||||
stream: backend.playback.normalizedPosition,
|
||||
builder: (context, snapshot) => LinearProgressIndicator(
|
||||
value: snapshot.data,
|
||||
),
|
||||
|
|
@ -32,7 +30,7 @@ class PlayerBar extends StatelessWidget {
|
|||
),
|
||||
Expanded(
|
||||
child: StreamBuilder<InternalTrack>(
|
||||
stream: backend.player.currentTrack,
|
||||
stream: backend.playback.currentTrack,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.data != null) {
|
||||
final recordingId = snapshot.data.track.recordingId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue