setCoverFormPath method

Future<bool> setCoverFormPath(
  1. String path
)

SetCover From Path

Implementation

Future<bool> setCoverFormPath(String path) async {
  if (!File(path).existsSync()) {
    throw Exception('File Not Found!: `$path`');
  }
  // ရှိနေရင် auto delete cover data
  if (_indexedDB.coverRecord != null) {
    await removeRecord(_indexedDB.coverRecord!, isCallMabyCompact: false);
  }

  final record = CoverRecord.fromPath(path);
  final (_, result) = await addRecord(record);
  return result;
}