getAvailableStorageInGB method

Future<int> getAvailableStorageInGB()

ローカルストレージの空き容量を取得し、GB単位の数値で返す

Implementation

Future<int> getAvailableStorageInGB() async {
  try {
    final int availableStorageInGB =
        await NativeHandler.instance.getAvailableStorageInGB();

    return availableStorageInGB;
  } on PlatformException catch (_) {
    throw ServiceException(
      ServiceErrorType.methodChannelError,
      ServiceErrorType.methodChannelError.message,
    );
  } catch (e) {
    throw ServiceException(
      ServiceErrorType.unknown,
      ServiceErrorType.unknown.message,
    );
  }
}