A cross-platform File & Directory that works in all platforms (browsers, mobile, desktop, and server-side)


Pub

PurposeGetting StartedCredits

Purpose

The purpose of the library is to be able to use the file everywhere. Nothing more superfluous - just a File, Directory and Link

Getting Started

Just import

import 'package:universal_file/universal_file.dart';

// And usage anywhere with backward capability!
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.');
    continue;
  }
  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');
}

Full api reference available here

Credits

This software is decomposition of universal_io (Removed all except FileSystem):

Libraries

universal_file