Skip to content

Commit

Permalink
[FIX] replaces hashValues method call with Object.hash method call
Browse files Browse the repository at this point in the history
[REMOVED] removed invalid lint `invalid_dependency`
  • Loading branch information
pintusingh28 committed Dec 17, 2024
1 parent 40e88b9 commit f91f9f1
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 108 deletions.
1 change: 0 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ linter:
prefer_constructors_over_static_methods: false
sort_unnamed_constructors_first: false
sized_box_for_whitespace: false
invalid_dependency: false
sort_pub_dependencies: false
avoid_unnecessary_containers: false
use_setters_to_change_properties: false
Expand Down
2 changes: 1 addition & 1 deletion lib/src/asms/better_player_asms_track.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class BetterPlayerAsmsTrack {
int get hashCode => super.hashCode;

@override
bool operator ==(dynamic other) {
bool operator ==(Object other) {
return other is BetterPlayerAsmsTrack &&
width == other.width &&
height == other.height &&
Expand Down
6 changes: 3 additions & 3 deletions lib/src/core/better_player_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,9 @@ class BetterPlayerController {
}
break;

default:
/*default:
throw UnimplementedError(
"${betterPlayerDataSource.type} is not implemented");
"${betterPlayerDataSource.type} is not implemented");*/
}
await _initializeVideo();
}
Expand Down Expand Up @@ -1260,7 +1260,7 @@ class BetterPlayerController {
///cache started for given [betterPlayerDataSource] then it will be ignored.
Future<void> stopPreCache(
BetterPlayerDataSource betterPlayerDataSource) async {
return VideoPlayerController?.stopPreCache(betterPlayerDataSource.url,
return VideoPlayerController.stopPreCache(betterPlayerDataSource.url,
betterPlayerDataSource.cacheConfiguration?.key);
}

Expand Down
3 changes: 1 addition & 2 deletions lib/src/dash/better_player_dash_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ class BetterPlayerDashUtils {
String? name = node.getAttribute('label');
final String? language = node.getAttribute('lang');
final String? mimeType = node.getAttribute('mimeType');
String? url =
node.getElement('Representation')?.getElement('BaseURL')?.text;
String? url = node.getElement('Representation')?.getElement('BaseURL')?.value;
if (url?.contains("http") == false) {
final Uri masterPlaylistUri = Uri.parse(masterPlaylistUrl);
final pathSegments = <String>[...masterPlaylistUri.pathSegments];
Expand Down
5 changes: 2 additions & 3 deletions lib/src/hls/hls_parser/drm_init_data.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:collection/collection.dart';
import 'package:flutter/cupertino.dart';

import 'scheme_data.dart';

Expand All @@ -10,7 +9,7 @@ class DrmInitData {
final String? schemeType;

@override
bool operator ==(dynamic other) {
bool operator ==(Object other) {
if (other is DrmInitData) {
return schemeType == other.schemeType &&
const ListEquality<SchemeData>().equals(other.schemeData, schemeData);
Expand All @@ -19,5 +18,5 @@ class DrmInitData {
}

@override
int get hashCode => hashValues(schemeType, schemeData);
int get hashCode => Object.hash(schemeType, schemeData);
}
5 changes: 2 additions & 3 deletions lib/src/hls/hls_parser/hls_track_metadata_entry.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:better_player/src/hls/hls_parser/variant_info.dart';
import 'package:collection/collection.dart';
import 'package:flutter/rendering.dart';

class HlsTrackMetadataEntry {
HlsTrackMetadataEntry({this.groupId, this.name, this.variantInfos});
Expand All @@ -17,7 +16,7 @@ class HlsTrackMetadataEntry {
final List<VariantInfo>? variantInfos;

@override
bool operator ==(dynamic other) {
bool operator ==(Object other) {
if (other is HlsTrackMetadataEntry) {
return other.groupId == groupId &&
other.name == name &&
Expand All @@ -28,5 +27,5 @@ class HlsTrackMetadataEntry {
}

@override
int get hashCode => hashValues(groupId, name, variantInfos);
int get hashCode => Object.hash(groupId, name, variantInfos);
}
2 changes: 1 addition & 1 deletion lib/src/hls/hls_parser/metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Metadata {
final List<HlsTrackMetadataEntry> list;

@override
bool operator ==(dynamic other) {
bool operator ==(Object other) {
if (other is Metadata) {
return const ListEquality<HlsTrackMetadataEntry>()
.equals(other.list, list);
Expand Down
6 changes: 2 additions & 4 deletions lib/src/hls/hls_parser/scheme_data.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'dart:typed_data';

import 'package:flutter/material.dart';

class SchemeData {
SchemeData({
// @required this.uuid,
Expand Down Expand Up @@ -36,7 +34,7 @@ class SchemeData {
);

@override
bool operator ==(dynamic other) {
bool operator ==(Object other) {
if (other is SchemeData) {
return other.mimeType == mimeType &&
other.licenseServerUrl == licenseServerUrl &&
Expand All @@ -49,7 +47,7 @@ class SchemeData {
}

@override
int get hashCode => hashValues(
int get hashCode => Object.hash(
/*uuid, */
licenseServerUrl,
mimeType,
Expand Down
10 changes: 5 additions & 5 deletions lib/src/hls/hls_parser/variant_info.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter/material.dart';


class VariantInfo {
VariantInfo({
Expand Down Expand Up @@ -29,9 +29,10 @@ class VariantInfo {
final String? captionGroupId;

@override
bool operator ==(dynamic other) {
bool operator ==(Object other) {
if (other is VariantInfo) {
return other.bitrate == bitrate &&
return other.runtimeType == runtimeType &&
other.bitrate == bitrate &&
other.videoGroupId == videoGroupId &&
other.audioGroupId == audioGroupId &&
other.subtitleGroupId == subtitleGroupId &&
Expand All @@ -41,6 +42,5 @@ class VariantInfo {
}

@override
int get hashCode => hashValues(
bitrate, videoGroupId, audioGroupId, subtitleGroupId, captionGroupId);
int get hashCode => Object.hash(bitrate, videoGroupId, audioGroupId, subtitleGroupId, captionGroupId);
}
Loading

0 comments on commit f91f9f1

Please sign in to comment.