universal_file 1.0.0 copy "universal_file: ^1.0.0" to clipboard
universal_file: ^1.0.0 copied to clipboard

Cross-platform File & Directory that works in all platforms (browsers, Flutter, and VM)

example/main.dart

import 'package:universal_file/universal_file.dart';

// And usage anywhere with backward capability!
main() async {
  final object = 'file';

  try {
    final file = File('$object.txt');
    if (await file.exists()) {
      final modified = await file.lastModified();
      print('File for $object already exists. It was modified on $modified.');
    }
    await file.create();
    await file.writeAsString('Start describing $object in this file.');
    final description = await file.readAsString();
    print(description);
  } on IOException catch (e) {
    print('Cannot create description for $object: $e');
  }
}
23
likes
160
pub points
83%
popularity

Publisher

verified publisherserge.software

Cross-platform File & Directory that works in all platforms (browsers, Flutter, and VM)

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0, BSD-3-Clause (license)

Dependencies

meta

More

Packages that depend on universal_file