getById method

Future<DatabaseRecord?> getById(
  1. int id
)

Get By Id

Implementation

Future<DatabaseRecord?> getById(int id) async {
  if (!isOpened) throw Exception('You Should Call -> SMDB.open()');
  final index = _indexedDB.allActiveRecordList.indexWhere((e) => e.id == id);
  if (index == -1) return null;
  return _indexedDB.allActiveRecordList[index];
}