Line data Source code
1 : import 'package:flutter_chrome_cast/enums/repeat_mode.dart';
2 :
3 : /// Configuration options for loading queue items in Google Cast.
4 : class GoogleCastQueueLoadOptions {
5 : /// Starting index in the queue.
6 : final int startIndex;
7 :
8 : /// Position to start playback.
9 : final Duration playPosition;
10 :
11 : /// Repeat mode for the queue.
12 : final GoogleCastMediaRepeatMode repeatMode;
13 :
14 : /// Custom data to send with the request.
15 : final Map<String, dynamic>? customData;
16 :
17 : /// Creates a new [GoogleCastQueueLoadOptions].
18 2 : GoogleCastQueueLoadOptions({
19 : this.startIndex = 0,
20 : this.playPosition = Duration.zero,
21 : this.repeatMode = GoogleCastMediaRepeatMode.off,
22 : this.customData,
23 : });
24 :
25 : /// Converts these options to a map representation.
26 2 : Map<String, dynamic> toMap() {
27 2 : return {
28 2 : 'startIndex': startIndex,
29 4 : 'playPosition': playPosition.inSeconds,
30 4 : 'repeatMode': repeatMode.index,
31 2 : 'customData': customData,
32 : };
33 : }
34 : }
|