findEntity method

Future<List<Map<String, dynamic>>> findEntity(
  1. bool finder(
    1. Map<String, dynamic>
    )
)

Implementation

Future<List<Map<String, dynamic>>> findEntity(
  bool Function(Map<String, dynamic>) finder,
) async {
  assert(_box != null, 'the store is not connected');

  final values = _box!.values;

  return values
      .map<Map<String, dynamic>>((dynamic value) {
        return Map<String, dynamic>.from(value as Map<dynamic, dynamic>);
      })
      .where(finder)
      .toList();
}