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';
  }
}