LCOV - code coverage report
Current view: top level - models/ios - ios_cast_queue_item.dart Coverage Total Hit
Test: lcov_cleaned.info Lines: 92.3 % 13 12
Test Date: 2025-06-20 10:50:47 Functions: - 0 0

            Line data    Source code
       1              : import 'package:flutter_chrome_cast/lib.dart';
       2              : 
       3              : /// Represents a queue item for Google Cast on iOS platforms.
       4              : ///
       5              : /// This class extends [GoogleCastQueueItem] and provides additional
       6              : /// iOS-specific mapping and construction logic.
       7              : class GoogleCastQueueItemIOS extends GoogleCastQueueItem {
       8              :   /// Creates a [GoogleCastQueueItemIOS] instance.
       9              :   ///
      10              :   /// [mediaInformation] is required and contains the media details for the queue item.
      11              :   /// Other parameters are optional and provide additional playback and queue configuration.
      12            1 :   GoogleCastQueueItemIOS({
      13              :     required super.mediaInformation,
      14              :     super.activeTrackIds,
      15              :     super.autoPlay,
      16              :     super.customData,
      17              :     super.itemId,
      18              :     super.playbackDuration,
      19              :     super.preLoadTime,
      20              :     super.startTime,
      21              :   });
      22              : 
      23              :   /// Creates a [GoogleCastQueueItemIOS] from a [Map] representation.
      24              :   ///
      25              :   /// This factory parses the provided [map] and constructs an instance
      26              :   /// with the corresponding values, handling iOS-specific field names and types.
      27            1 :   factory GoogleCastQueueItemIOS.fromMap(Map<String, dynamic> map) {
      28            1 :     return GoogleCastQueueItemIOS(
      29            1 :       mediaInformation: GoogleCastMediaInformationIOS.fromMap(
      30            2 :           Map<String, dynamic>.from(map['mediaInformation'])),
      31            2 :       activeTrackIds: List.from(map['activeTracksIds'] ?? []),
      32            1 :       autoPlay: map['autoPlay'] ?? false,
      33            1 :       customData: map['customData'],
      34            1 :       itemId: map['itemId'],
      35            1 :       playbackDuration: map['playbackDuration'] == null
      36              :           ? null
      37            0 :           : Duration(seconds: map['playbackDuration']),
      38            2 :       preLoadTime: Duration(seconds: map['preLoadTime'] ?? 0),
      39            2 :       startTime: Duration(seconds: map['startTime'] ?? 0),
      40              :     );
      41              :   }
      42              : }
        

Generated by: LCOV version 2.3.1-1