Skip to content

Commit

Permalink
Revert "WIP refactor uploading to be handled in-message"
Browse files Browse the repository at this point in the history
This reverts commit ed84315.
  • Loading branch information
aguilaair committed Oct 17, 2021
1 parent ed84315 commit be1699c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
8 changes: 1 addition & 7 deletions lib/utils/fileInteraction/nativeFilePicker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@ void nativeFilePicker(
{required FileType type,
required BuildContext context,
required widget,
required Function onUploadSuccess,
required Function onUploadStarted}) async {
required Function onUploadSuccess}) async {
try {
final _paths = (await FilePicker.platform.pickFiles(
type: type,
))
?.files;
if (_paths != null && _paths.first.path != null) {
onUploadStarted(_paths
.map((e) => PapercupsAttachment(
fileName: e.name,
))
.toList());
Alert.show(
"Uploading...",
context,
Expand Down
21 changes: 0 additions & 21 deletions lib/widgets/sendMessage/sendMessage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -154,27 +154,6 @@ class _SendMessageState extends State<SendMessage> {
onSelected: (type) => nativeFilePicker(
context: context,
onUploadSuccess: _onUploadSuccess,
onUploadStarted: (List<PapercupsAttachment> files) {
List<String> fileIds = files.map((e) => e.id ?? "").toList();
_sendMessage(
_msgFocusNode,
_msgController,
widget.customer,
widget.props,
widget.setCustomer,
widget.conversation,
widget.setConversation,
widget.setConversationChannel,
widget.conversationChannel,
widget.socket,
widget.setState,
widget.messages,
widget.sending,
files,
fileIds,
true,
);
},
type: type,
widget: widget,
),
Expand Down

0 comments on commit be1699c

Please sign in to comment.