deleteFile static method

Future<bool> deleteFile(
  1. String absolutePath
)

Delete a file at absolutePath. Returns true on success.

Implementation

static Future<bool> deleteFile(String absolutePath) async {
  if (kIsWeb) return false;

  try {
    final file = File(absolutePath);
    if (await file.exists()) {
      await file.delete();
      return true;
    }
    return false;
  } catch (_) {
    return false;
  }
}