ic_storage_space 0.0.2
ic_storage_space: ^0.0.2 copied to clipboard
Flutter storage space plugin for Android, IOS, and macOS to provide the Total storage space, Free storage space, and used storage space. Users can use this plugin any time on defined Platforms.
ic_storage_space #
Flutter storage space plugin for Android, IOS and MacOS
Installation #
Add ic_storage_space
as a dependency in your pubspec.yaml file
Usage #
import 'package:flutter/material.dart';
import 'package:ic_storage_space/ic_storage_space.dart';
class MyWidget extends StatelessWidget {
Future<String> getStorageSpaceInfo() async {
int totalSpace = await IcStorageSpace.getTotalDiskSpaceInBytes;
int freeSpace = await IcStorageSpace.getFreeDiskSpaceInBytes;
int usedSpace = await IcStorageSpace.getUsedDiskSpaceInBytes;
return 'Total Space - $totalSpace\n\nFree Space - $freeSpace\n\nUsed Space - $usedSpace';
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Storage Space example app'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () async {
await getStorageSpaceInfo();
},
child: Text('Get Storage Info'),
)
],
),
),
);
}
}