|
| 1 | +# Disks Desktop |
| 2 | + |
| 3 | +<img align="center" src="https://raw.githubusercontent.com/AngeloAvv/disks/master/assets/disks_logo.png" width="350" alt="Disks logo" border="0"> |
| 4 | + |
| 5 | +Disks Desktop is Flutter desktop library able to retrieve the installed devices information |
| 6 | + |
| 7 | +[](https://pub.dev/packages/disks) |
| 8 | + |
| 9 | +[](https://github.com/AngeloAvv/disks) |
| 10 | +[](https://opensource.org/licenses/MIT) |
| 11 | + |
| 12 | +If you want to support this project, |
| 13 | + |
| 14 | +[](https://www.buymeacoffee.com/angeloavv) |
| 15 | + |
| 16 | + |
| 17 | +With Disks Desktop you can get access to disks' information like: |
| 18 | +* block size |
| 19 | +* bus type |
| 20 | +* bus version |
| 21 | +* description |
| 22 | +* device name |
| 23 | +* device path |
| 24 | +* logical block size |
| 25 | +* available mountpoints |
| 26 | +* disk size |
| 27 | +* partition table type |
| 28 | +* is in error |
| 29 | +* is a card |
| 30 | +* is read only |
| 31 | +* is removable |
| 32 | +* is scsi |
| 33 | +* is system |
| 34 | +* is uas |
| 35 | +* is usb |
| 36 | +* is virtual |
| 37 | +* is raw |
| 38 | + |
| 39 | +### Installation |
| 40 | + |
| 41 | +In general, put it under |
| 42 | +[dependencies](https://dart.dev/tools/pub/dependencies), |
| 43 | +in your [pubspec.yaml](https://dart.dev/tools/pub/pubspec): |
| 44 | + |
| 45 | +```yaml |
| 46 | +dependencies: |
| 47 | + disks_desktop: ^1.0.1 |
| 48 | +``` |
| 49 | +
|
| 50 | +You can install packages from the command line: |
| 51 | +
|
| 52 | +```terminal |
| 53 | +flutter pub get |
| 54 | +``` |
| 55 | + |
| 56 | +or simply add it through the command line: |
| 57 | + |
| 58 | +```terminal |
| 59 | +flutter pub add disks_desktop |
| 60 | +``` |
| 61 | + |
| 62 | +## Usage |
| 63 | + |
| 64 | +To get the list of the available drives with their details, simply create an instance of a Disk Repository, and then invoke the query getter. |
| 65 | + |
| 66 | +Example: |
| 67 | +```dart |
| 68 | +final repository = DiskRepository(); |
| 69 | +final disks = await repository.query; |
| 70 | +``` |
| 71 | + |
| 72 | +You can also use it with a FutureBuilder: |
| 73 | +```dart |
| 74 | +FutureBuilder<List<Disk>>( |
| 75 | + future: DisksRepository().query, |
| 76 | + builder: (context, snapshot) => [...] |
| 77 | +), |
| 78 | +``` |
| 79 | + |
| 80 | +## License |
| 81 | + |
| 82 | +Disks Desktop is available under the MIT license. See the LICENSE file for more info. |
| 83 | +drivelist.cpp, drivelist.hpp, list.cpp and list.hpp are available under the Apache 2.0 license and belongs to balena.io |
| 84 | + |
| 85 | +## Additional information |
| 86 | +<a href="https://www.flaticon.com/free-icons/hard-disk" title="hard disk icons">Disks icon created by Freepik - Flaticon</a> |
0 commit comments