localPath property

Future<String?> get localPath

Return the local path location.

Implementation

static Future<String?> get localPath async {
  if (_path == null) {
    if (kIsWeb) {
      _path = '';
    } else {
      switch (Platform.operatingSystem) {
        case 'android':
        case 'ios':
          final directory = await getApplicationDocumentsDirectory();
          _path = directory.path;
          break;
        case 'macos':
        case 'windows':
        case 'fuchsia':
        case 'linux':
          _path = Directory.current.path;
          break;
      }
    }
  }
  return _path;
}