whereKeyStartsWithOrFail method

  1. @override
Future<Map<String, dynamic>> whereKeyStartsWithOrFail(
  1. String prefix, {
  2. Exception onFail()?,
})

Implementation

@override
Future<Map<String, dynamic>> whereKeyStartsWithOrFail(String prefix,
    {Exception Function()? onFail}) async {
  final entries = await whereKeyStartsWith(prefix);

  return entries.isEmpty
      ? onFail != null
          ? throw onFail()
          : throw Exception('No entries found')
      : entries;
}