Skip to content

Commit cf64332

Browse files
fixes check
1 parent ebe3b5c commit cf64332

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

templates/dart/lib/src/input_file.dart.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class InputFile {
1111
InputFile({this.path, this.filename, this.contentType, this.bytes}) {
1212
if (kIsWeb && bytes == null) {
1313
throw {{ spec.title | caseUcfirs }}Exception('On web `bytes` is required');
14-
} else if(path == null) {
15-
throw {{ spec.title | caseUcfirs }}Exception('On IO platforms `path is required`);
14+
} else if(!kIsWeb && path == null && bytes == null) {
15+
throw {{ spec.title | caseUcfirs }}Exception('On IO platforms one of `path` or `bytes` is required`);
1616
}
1717
}
1818
}

templates/flutter/lib/src/input_file.dart.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class InputFile {
1111
InputFile({this.path, this.filename, this.contentType, this.bytes}) {
1212
if (kIsWeb && bytes == null) {
1313
throw {{ spec.title | caseUcfirs }}Exception('On web `bytes` is required');
14-
} else if(path == null) {
15-
throw {{ spec.title | caseUcfirs }}Exception('On IO platforms `path is required`);
14+
} else if(!kIsWeb && path == null && bytes == null) {
15+
throw {{ spec.title | caseUcfirs }}Exception('On IO platforms one of `path` or `bytes` is required`);
1616
}
1717
}
1818
}

0 commit comments

Comments
 (0)