Skip to content

Commit

Permalink
add tools for message page
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaominfc committed Sep 27, 2019
1 parent ee96209 commit 1aa5d3f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/pages/message_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,14 @@ class _MessagePageState extends State<MessagePage> with WidgetsBindingObserver {

_sendImage(File file) async {
var dio = new Dio();

String fileName = file.path.split("/").last;

FormData formData = new FormData.from({
"file": new UploadFileInfo(
new File("/Users/xiaominfc/Pictures/origin_1.png"), "origin_1.png")
file, fileName)
});
var response = await dio.post("http://msfs.xiaominfc.com/", data: formData);

if (response.statusCode == 200) {
Map<String, dynamic> result = jsonDecode(response.data);
//_sendText("");
Expand Down

0 comments on commit 1aa5d3f

Please sign in to comment.