@@ -911,8 +911,8 @@ class _EditMessageContentInput extends StatelessWidget {
911911///
912912/// A convenience class to represent data from the generic file picker,
913913/// the media library, and the camera, in a single form.
914- class _File {
915- _File ({
914+ class FileToUpload {
915+ FileToUpload ({
916916 required this .content,
917917 required this .length,
918918 required this .filename,
@@ -929,14 +929,14 @@ Future<void> _uploadFiles({
929929 required BuildContext context,
930930 required ComposeContentController contentController,
931931 required FocusNode contentFocusNode,
932- required Iterable <_File > files,
932+ required Iterable <FileToUpload > files,
933933}) async {
934934 assert (context.mounted);
935935 final store = PerAccountStoreWidget .of (context);
936936 final zulipLocalizations = ZulipLocalizations .of (context);
937937
938- final List <_File > tooLargeFiles = [];
939- final List <_File > rightSizeFiles = [];
938+ final List <FileToUpload > tooLargeFiles = [];
939+ final List <FileToUpload > rightSizeFiles = [];
940940 for (final file in files) {
941941 if ((file.length / (1 << 20 )) > store.maxFileUploadSizeMib) {
942942 tooLargeFiles.add (file);
@@ -959,7 +959,7 @@ Future<void> _uploadFiles({
959959 listMessage));
960960 }
961961
962- final List <(int , _File )> uploadsInProgress = [];
962+ final List <(int , FileToUpload )> uploadsInProgress = [];
963963 for (final file in rightSizeFiles) {
964964 final tag = contentController.registerUploadStart (file.filename,
965965 zulipLocalizations);
@@ -970,7 +970,7 @@ Future<void> _uploadFiles({
970970 }
971971
972972 for (final (tag, file) in uploadsInProgress) {
973- final _File (: content, : length, : filename, : mimeType) = file;
973+ final FileToUpload (: content, : length, : filename, : mimeType) = file;
974974 String ? url;
975975 try {
976976 final result = await uploadFile (store.connection,
@@ -1009,7 +1009,7 @@ abstract class _AttachUploadsButton extends StatelessWidget {
10091009 ///
10101010 /// To signal exiting the interaction with no files chosen,
10111011 /// return an empty [Iterable] after showing user feedback as appropriate.
1012- Future <Iterable <_File >> getFiles (BuildContext context);
1012+ Future <Iterable <FileToUpload >> getFiles (BuildContext context);
10131013
10141014 void _handlePress (BuildContext context) async {
10151015 final files = await getFiles (context);
@@ -1043,7 +1043,7 @@ abstract class _AttachUploadsButton extends StatelessWidget {
10431043 }
10441044}
10451045
1046- Future <Iterable <_File >> _getFilePickerFiles (BuildContext context, FileType type) async {
1046+ Future <Iterable <FileToUpload >> _getFilePickerFiles (BuildContext context, FileType type) async {
10471047 FilePickerResult ? result;
10481048 try {
10491049 result = await ZulipBinding .instance
@@ -1088,7 +1088,7 @@ Future<Iterable<_File>> _getFilePickerFiles(BuildContext context, FileType type)
10881088 f.path ?? '' ,
10891089 headerBytes: f.bytes? .take (defaultMagicNumbersMaxLength).toList (),
10901090 );
1091- return _File (
1091+ return FileToUpload (
10921092 content: f.readStream! ,
10931093 length: f.size,
10941094 filename: f.name,
@@ -1108,7 +1108,7 @@ class _AttachFileButton extends _AttachUploadsButton {
11081108 zulipLocalizations.composeBoxAttachFilesTooltip;
11091109
11101110 @override
1111- Future <Iterable <_File >> getFiles (BuildContext context) async {
1111+ Future <Iterable <FileToUpload >> getFiles (BuildContext context) async {
11121112 return _getFilePickerFiles (context, FileType .any);
11131113 }
11141114}
@@ -1124,7 +1124,7 @@ class _AttachMediaButton extends _AttachUploadsButton {
11241124 zulipLocalizations.composeBoxAttachMediaTooltip;
11251125
11261126 @override
1127- Future <Iterable <_File >> getFiles (BuildContext context) async {
1127+ Future <Iterable <FileToUpload >> getFiles (BuildContext context) async {
11281128 // TODO(#114): This doesn't give quite the right UI on Android.
11291129 return _getFilePickerFiles (context, FileType .media);
11301130 }
@@ -1141,7 +1141,7 @@ class _AttachFromCameraButton extends _AttachUploadsButton {
11411141 zulipLocalizations.composeBoxAttachFromCameraTooltip;
11421142
11431143 @override
1144- Future <Iterable <_File >> getFiles (BuildContext context) async {
1144+ Future <Iterable <FileToUpload >> getFiles (BuildContext context) async {
11451145 final zulipLocalizations = ZulipLocalizations .of (context);
11461146 final XFile ? result;
11471147 try {
@@ -1192,7 +1192,7 @@ class _AttachFromCameraButton extends _AttachUploadsButton {
11921192 } catch (e) {
11931193 // TODO(log)
11941194 }
1195- return [_File (
1195+ return [FileToUpload (
11961196 content: result.openRead (),
11971197 length: length,
11981198 filename: result.name,
0 commit comments