integrate_platform 1.0.2 copy "integrate_platform: ^1.0.2" to clipboard
integrate_platform: ^1.0.2 copied to clipboard

Cross-platform [Platform] and File Management Just use [IntegratePlatform].

Cross-platform [Platform] and File Management.

Features #

  • Use IntegratePlatform instead of Platform to get platform information in io and web.
  • Packaged path_provider (In web, you'll get null).
  • Packaged File Management. You can read and write a file in io and web.

Getting started #

To use this plugin, add integrate_platform as a dependency in your pubspec.yaml file.

dependencies:
  integrate_platform: ^1.0.2

Usage #

  • Get platform information
// Get system version
bool operatingSystemVersion = IntegratePlatform.operatingSystemVersion;

// Get platform type
bool isDesktop = IntegratePlatform.isDesktop
  • Get path in need
String? path = IntegratePlatform.getCurrentDirectory()
  • Write and Read file
// Read file
final result = await IntegratePlatform.readFile();
if (result.success) {
    data = result.content.toString();
}

// Write file
final result =
    await IntegratePlatform.writeFile("hello world", "hello.txt");
path = result.path.toString();

The whole examples are in /example folder.

example

Additional information #

Thanks to:

2
likes
150
pub points
32%
popularity

Publisher

verified publisheralfiey.me

Cross-platform [Platform] and File Management Just use [IntegratePlatform].

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

file_picker, flutter, path_provider

More

Packages that depend on integrate_platform