Viewing version 0.3.1+3. Open the latest package page.

cross_file

0.3.1+3

An abstraction to allow working with files across multiple platforms.

Download archive

Readme

cross_file

An abstraction to allow working with files across multiple platforms.

Usage

Import package:cross_file/cross_file.dart, instantiate a CrossFile using a path or byte array and use its methods and properties to access the file and its metadata.

Example:

import 'package:cross_file/cross_file.dart';

final file = XFile('assets/hello.txt');

print('File information:');
print('- Path: ${file.path}');
print('- Name: ${file.name}');
print('- MIME type: ${file.mimeType}');

final fileContent = await file.readAsString();
print('Content of the file: ${fileContent}');  // e.g. "Moto G (4)"

You will find links to the API docs on the pub page.

Changelog

0.3.1+3

  • Fix example in README

0.3.1+2

  • Fix package import in README
  • Remove 'Get Started' boilerplate in README

0.3.1+1

  • Rehomed to flutter/packages repository.

0.3.1

  • Fix nullability of XFileBase's path and name to match the implementations to avoid potential analyzer issues.

0.3.0

  • Migrated package to null-safety.
  • breaking change According to our unit tests, the API should be backwards-compatible. Some relevant changes were made, however:
    • Web: lastModified returns the epoch time as a default value, to maintain the Future<DateTime> return type (and not null)

0.2.1

  • Prepare for breaking package:http change.

0.2.0

  • breaking change Make sure the saveTo method returns a Future so it can be awaited and users are sure the file has been written to disk.

0.1.0+2

  • Fix outdated links across a number of markdown files (#3276)

0.1.0+1

  • Update Flutter SDK constraint.

0.1.0

  • Initial open-source release.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'cross_file:0.3.1+3'
pubspec.yaml
name: cross_file
description: An abstraction to allow working with files across multiple platforms.
repository: https://github.com/flutter/packages/tree/master/packages/cross_file
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+cross_file%22
version: 0.3.1+3

environment:
  sdk: ">=2.12.0 <3.0.0"
  flutter: ">=1.22.0"

dependencies:
  flutter:
    sdk: flutter
  meta: ^1.3.0

dev_dependencies:
  flutter_test:
    sdk: flutter
  pedantic: ^1.10.0

Version history

VersionPublishedArchiveSHA-256
0.1.0Cached · Upstream SHA-256 matchedDownload689ed0a6…2f83b7
0.2.0Cached · Upstream SHA-256 matchedDownload96bea5b8…3184a1
0.2.1Cached · Upstream SHA-256 matchedDownload13cb37fd…b44b8a
0.3.0-nullsafetyCached · Upstream SHA-256 matchedDownload6bac36c5…1ad15b
0.3.0Cached · Upstream SHA-256 matchedDownloadf46f215b…d3cccb
0.3.1Cached · Upstream SHA-256 matchedDownload459de606…3d3f95
0.3.1+1Cached · Upstream SHA-256 matchedDownload2ae7cae8…85a604
0.3.1+3Cached · Upstream SHA-256 matchedDownloade765bf84…5a27af
0.3.1+4Cached · Upstream SHA-256 matchedDownload437b2b8d…991068
0.3.1+5Cached · Upstream SHA-256 matchedDownload5388c401…e44da4
0.3.2Cached · Upstream SHA-256 matchedDownload552ffd2f…27a0fa
0.3.3Cached · Upstream SHA-256 matchedDownload93ccb9d2…242f0f
0.3.3+1Cached · Upstream SHA-256 matchedDownload7632a2bc…2a3d4f
0.3.3+2Cached · Upstream SHA-256 matchedDownloadf7107997…fb843b
0.3.3+3Cached · Upstream SHA-256 matchedDownloadb1c29cf7…e760d5
0.3.3+4Cached · Upstream SHA-256 matchedDownload0b0036e8…8695e9
0.3.3+5Cached · Upstream SHA-256 matchedDownloadfd832b53…dee2cb
0.3.3+6Cached · Upstream SHA-256 matchedDownload445db18d…d2142c
0.3.3+7Cached · Upstream SHA-256 matchedDownload2f9d2cbc…3882c5
0.3.3+8Cached · Upstream SHA-256 matchedDownloadfedaadfa…1b9a5e
0.3.4Cached · Upstream SHA-256 matchedDownload74a4727e…a1fa40
0.3.4+1Cached · Upstream SHA-256 matchedDownload55d7b444…945b32
0.3.4+2Cached · Upstream SHA-256 matchedDownload7caf6a75…0d5670
0.3.5Cached · Upstream SHA-256 matchedDownload942a4791…f16239
0.3.5+1Cached · Upstream SHA-256 matchedDownload701dcfc0…996608
0.3.5+2Cached · Upstream SHA-256 matchedDownload28bb3ae5…7c5937
0.3.5+3Cached · Upstream SHA-256 matchedDownloadd687bec9…95024e
0.3.5+4Cached · Upstream SHA-256 matchedDownload92c9c43c…555c51
0.3.5+5Cached · Upstream SHA-256 matchedDownloadf141ea4f…437bd6
0.4.0Cached · Upstream SHA-256 matchedDownload3bde17bc…3d3fa4

Dependencies

flutter { "sdk": "flutter" }

meta "^1.3.0"