Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit dba4705

Browse files
committed
Renamed class implementation back to XFile
1 parent 690f17c commit dba4705

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

packages/cross_file/lib/src/types/base.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import 'dart:typed_data';
1313
///
1414
/// This class is a very limited subset of dart:io [File], so all
1515
/// the methods should seem familiar.
16-
abstract class CrossFileBase {
16+
abstract class XFileBase {
1717
/// Construct a CrossFile
18-
CrossFileBase(String path);
18+
XFileBase(String path);
1919

2020
/// Save the CrossFile at the indicated file path.
2121
void saveTo(String path) async {

packages/cross_file/lib/src/types/html.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import './base.dart';
1515
/// A CrossFile that works on web.
1616
///
1717
/// It wraps the bytes of a selected file.
18-
class CrossFile extends CrossFileBase {
18+
class XFile extends XFileBase {
1919
String path;
2020

2121
final String mimeType;
@@ -36,7 +36,7 @@ class CrossFile extends CrossFileBase {
3636
///
3737
/// `name` needs to be passed from the outside, since we only have
3838
/// access to it while we create the ObjectUrl.
39-
CrossFile(
39+
XFile(
4040
this.path, {
4141
this.mimeType,
4242
this.name,
@@ -51,7 +51,7 @@ class CrossFile extends CrossFileBase {
5151
super(path);
5252

5353
/// Construct an CrossFile from its data
54-
CrossFile.fromData(
54+
XFile.fromData(
5555
Uint8List bytes, {
5656
this.mimeType,
5757
this.name,

packages/cross_file/lib/src/types/interface.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import './base.dart';
1010
/// A CrossFile is a cross-platform, simplified File abstraction.
1111
///
1212
/// It wraps the bytes of a selected file, and its (platform-dependant) path.
13-
class CrossFile extends CrossFileBase {
13+
class XFile extends XFileBase {
1414
/// Construct a CrossFile object from its path.
1515
///
1616
/// Optionally, this can be initialized with `bytes` and `length`
@@ -19,7 +19,7 @@ class CrossFile extends CrossFileBase {
1919
/// `name` may be passed from the outside, for those cases where the effective
2020
/// `path` of the file doesn't match what the user sees when selecting it
2121
/// (like in web)
22-
CrossFile(
22+
XFile(
2323
String path, {
2424
String mimeType,
2525
String name,
@@ -33,7 +33,7 @@ class CrossFile extends CrossFileBase {
3333
}
3434

3535
/// Construct a CrossFile object from its data
36-
CrossFile.fromData(
36+
XFile.fromData(
3737
Uint8List bytes, {
3838
String mimeType,
3939
String name,

packages/cross_file/lib/src/types/io.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'dart:typed_data';
99
import './base.dart';
1010

1111
/// A CrossFile backed by a dart:io File.
12-
class CrossFile extends CrossFileBase {
12+
class XFile extends XFileBase {
1313
final File _file;
1414
final String mimeType;
1515
final DateTime _lastModified;
@@ -18,7 +18,7 @@ class CrossFile extends CrossFileBase {
1818
final Uint8List _bytes;
1919

2020
/// Construct a CrossFile object backed by a dart:io File.
21-
CrossFile(
21+
XFile(
2222
String path, {
2323
this.mimeType,
2424
String name,
@@ -31,7 +31,7 @@ class CrossFile extends CrossFileBase {
3131
super(path);
3232

3333
/// Construct an CrossFile from its data
34-
CrossFile.fromData(
34+
XFile.fromData(
3535
Uint8List bytes, {
3636
this.mimeType,
3737
String path,

packages/cross_file/lib/cross_file.dart renamed to packages/cross_file/lib/x_file.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
export 'src/cross_file.dart';
5+
export 'src/x_file.dart';

packages/cross_file/test/cross_file_html_test.dart renamed to packages/cross_file/test/x_file_html_test.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'dart:html' as html;
99
import 'dart:typed_data';
1010

1111
import 'package:flutter_test/flutter_test.dart';
12-
import 'package:cross_file/cross_file.dart';
12+
import 'package:cross_file/x_file.dart';
1313

1414
import 'dart:html';
1515

@@ -20,7 +20,7 @@ final String textFileUrl = html.Url.createObjectUrl(textFile);
2020

2121
void main() {
2222
group('Create with an objectUrl', () {
23-
final file = CrossFile(textFileUrl);
23+
final file = XFile(textFileUrl);
2424

2525
test('Can be read as a string', () async {
2626
expect(await file.readAsString(), equals(expectedStringContents));
@@ -39,7 +39,7 @@ void main() {
3939
});
4040

4141
group('Create from data', () {
42-
final file = CrossFile.fromData(bytes);
42+
final file = XFile.fromData(bytes);
4343

4444
test('Can be read as a string', () async {
4545
expect(await file.readAsString(), equals(expectedStringContents));
@@ -62,7 +62,7 @@ void main() {
6262

6363
group('CrossFile saveTo(..)', () {
6464
test('creates a DOM container', () async {
65-
CrossFile file = CrossFile.fromData(bytes);
65+
XFile file = XFile.fromData(bytes);
6666

6767
await file.saveTo('');
6868

@@ -72,7 +72,7 @@ void main() {
7272
});
7373

7474
test('create anchor element', () async {
75-
CrossFile file = CrossFile.fromData(bytes, name: textFile.name);
75+
XFile file = XFile.fromData(bytes, name: textFile.name);
7676

7777
await file.saveTo('path');
7878

@@ -93,7 +93,7 @@ void main() {
9393
createAnchorElement: (_, __) => mockAnchor,
9494
);
9595

96-
CrossFile file = CrossFile.fromData(bytes,
96+
XFile file = XFile.fromData(bytes,
9797
name: textFile.name, overrides: overrides);
9898

9999
bool clicked = false;

packages/cross_file/test/cross_file_io_test.dart renamed to packages/cross_file/test/x_file_io_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'dart:io';
99
import 'dart:typed_data';
1010

1111
import 'package:flutter_test/flutter_test.dart';
12-
import 'package:cross_file/cross_file.dart';
12+
import 'package:cross_file/x_file.dart';
1313

1414
// Please note that executing this test with command
1515
// `flutter test test/x_file_io_test.dart` will set the directory
@@ -30,7 +30,7 @@ final String textFilePath = textFile.path;
3030

3131
void main() {
3232
group('Create with a path', () {
33-
final file = CrossFile(textFilePath);
33+
final file = XFile(textFilePath);
3434

3535
test('Can be read as a string', () async {
3636
expect(await file.readAsString(), equals(expectedStringContents));
@@ -64,7 +64,7 @@ void main() {
6464
});
6565

6666
group('Create with data', () {
67-
final file = CrossFile.fromData(bytes);
67+
final file = XFile.fromData(bytes);
6868

6969
test('Can be read as a string', () async {
7070
expect(await file.readAsString(), equals(expectedStringContents));

0 commit comments

Comments
 (0)