Add empty queue list
This commit is contained in:
parent
baa299de58
commit
370e0e6c8d
3 changed files with 50 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_cast_framework/cast.dart';
|
import 'package:flutter_cast_framework/cast.dart';
|
||||||
import 'package:flutter_cast_framework/widgets.dart';
|
import 'package:flutter_cast_framework/widgets.dart';
|
||||||
import 'package:flutter_cast_framework_example/expanded_controls_route.dart';
|
import 'package:flutter_cast_framework_example/expanded_controls_route.dart';
|
||||||
|
import 'package:flutter_cast_framework_example/queue_route.dart';
|
||||||
|
|
||||||
import 'media_load_request_data_helper.dart';
|
import 'media_load_request_data_helper.dart';
|
||||||
|
|
||||||
|
|
@ -127,6 +128,17 @@ class _MyAppState extends State<MyApp> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _openQueue() async {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => QueueRoute(
|
||||||
|
castFramework: castFramework,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildTitle(String text) {
|
Widget _buildTitle(String text) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
|
@ -198,6 +210,13 @@ class _MyAppState extends State<MyApp> {
|
||||||
onPressed: _hasMedia ? _openExpandedControls : null,
|
onPressed: _hasMedia ? _openExpandedControls : null,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: ElevatedButton(
|
||||||
|
child: Text('Queue'),
|
||||||
|
onPressed: _hasSession ? _openQueue : null,
|
||||||
|
),
|
||||||
|
),
|
||||||
_buildTitle("Mini Controller"),
|
_buildTitle("Mini Controller"),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
|
|
|
||||||
31
example/lib/queue_route.dart
Normal file
31
example/lib/queue_route.dart
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_cast_framework/cast.dart';
|
||||||
|
|
||||||
|
class QueueRoute extends StatelessWidget {
|
||||||
|
final FlutterCastFramework castFramework;
|
||||||
|
|
||||||
|
const QueueRoute({
|
||||||
|
Key? key,
|
||||||
|
required this.castFramework,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
Widget _getEmptyQueueMessage(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text(
|
||||||
|
"Queue is empty!",
|
||||||
|
style: Theme.of(context).textTheme.headline6,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('Queue'),
|
||||||
|
),
|
||||||
|
body: _getEmptyQueueMessage(context),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -62,7 +62,6 @@ class MiniController extends StatelessWidget {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// ),
|
|
||||||
playPauseButton,
|
playPauseButton,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue