getCacheDirPath method

Future<String> getCacheDirPath()

Implementation

Future<String> getCacheDirPath() async {
  final tempDir = await getTemporaryDirectory();
  String cacheDirPath = tempDir.path;
  // return cacheDirPath;
  if (Platform.isAndroid) {
    cacheDirPath = (await getExternalStorageDirectory())?.path ?? "";
  } else if (Platform.isIOS) {
    cacheDirPath = (await getApplicationDocumentsDirectory())?.path ?? "";
  }
  return cacheDirPath;
}