dartboard_resume/lib/models/dartboard_misc.dart

27 lines
642 B
Dart
Raw Permalink Normal View History

2024-09-10 15:09:15 -06:00
import 'package:dartboard_resume/models/document_text.dart';
class DartboardMisc {
DartboardMisc({required this.subsection, required this.attributes});
final String subsection;
final List<DocumentText> attributes;
@override
int get hashCode {
return Object.hashAll([subsection, ...attributes]);
}
@override
bool operator ==(Object other) {
return super.hashCode == other.hashCode;
}
static bool filter(dynamic e) {
if (e is! List || e.firstOrNull is! Map) {
return false;
}
final entries = (e.first as Map).entries;
return entries.length == 1 && entries.first.key == 'attributes';
}
}