Skip to content

Commit

Permalink
remove equatable
Browse files Browse the repository at this point in the history
  • Loading branch information
rainyl committed Jul 1, 2024
1 parent 452322d commit d2f5339
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 11 additions & 2 deletions lib/src/core/base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'dart:ffi' as ffi;
import 'dart:ffi';
import 'dart:io';

import 'package:equatable/equatable.dart';
import 'package:ffi/ffi.dart';

import "../opencv.g.dart" as cvg;
Expand Down Expand Up @@ -61,9 +60,19 @@ abstract class ICvStruct<T extends ffi.Struct> extends CvObject<T> {

ffi.Pointer<T> ptr;
T get ref;

List<Object?> get props;

@override
// ignore: hash_and_equals
bool operator ==(Object other) {
if (other is! ICvStruct) return false;
if (props.length != other.props.length) return false;
return props.indexed.every((e) => other.props[e.$1] == e.$2);
}
}

abstract class CvStruct<T extends ffi.Struct> extends ICvStruct<T> with EquatableMixin {
abstract class CvStruct<T extends ffi.Struct> extends ICvStruct<T> {
CvStruct.fromPointer(super.ptr) : super.fromPointer();
}

Expand Down
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies:
sdk: flutter
plugin_platform_interface: ^2.1.8
ffi: ^2.1.0
equatable: ^2.0.5
path: ^1.9.0
args: ^2.5.0
archive: ^3.5.1
Expand Down

0 comments on commit d2f5339

Please sign in to comment.