ic_storage_space 0.0.2 copy "ic_storage_space: ^0.0.2" to clipboard
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'),
            )
          ],
        ),
      ),
    );
  }
}
2
likes
100
pub points
39%
popularity

Publisher

unverified uploader

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.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on ic_storage_space