RhythmBox/lib/screens/player/source_details.dart

48 lines
1.4 KiB
Dart
Raw Normal View History

2024-09-04 16:01:58 +00:00
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:rhythm_box/services/server/active_sourced_track.dart';
2024-09-06 04:52:57 +00:00
import 'package:rhythm_box/services/sourced_track/sourced_track.dart';
2024-09-04 16:01:58 +00:00
import 'package:rhythm_box/widgets/player/track_source_details.dart';
class SourceDetailsPopup extends StatelessWidget {
const SourceDetailsPopup({super.key});
2024-09-06 04:52:57 +00:00
Future<SourcedTrack?> _pullActiveTrack() async {
final ActiveSourcedTrackProvider activeSourcedTrack = Get.find();
return activeSourcedTrack.state.value;
}
2024-09-04 16:01:58 +00:00
@override
Widget build(BuildContext context) {
return SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Source Details',
style: Theme.of(context).textTheme.headlineSmall,
).paddingOnly(left: 24, right: 24, top: 32, bottom: 16),
Expanded(
child: Obx(
2024-09-06 04:52:57 +00:00
() => FutureBuilder(
future: _pullActiveTrack(),
builder: (context, snapshot) {
if (snapshot.hasData) {
return TrackSourceDetails(
track: snapshot.data!,
);
}
return const Center(
child: CircularProgressIndicator(),
);
},
2024-09-04 16:01:58 +00:00
).paddingSymmetric(horizontal: 24),
),
)
],
),
);
}
}