hopefully fixed send
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
import 'dart:io';
|
||||
import 'package:fforte/screens/sharedMethods/http_request.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'l10n/app_localizations.dart';
|
||||
import 'screens/addCam/add_cam_main.dart';
|
||||
@@ -10,16 +7,16 @@ import 'screens/addCam/add_cam_main.dart';
|
||||
class HomePage extends StatelessWidget {
|
||||
const HomePage({super.key});
|
||||
|
||||
void _sendFile() async {
|
||||
FilePickerResult? result = await FilePicker.platform.pickFiles();
|
||||
// void _sendFile() async {
|
||||
// // FilePickerResult? result = await FilePicker.platform.pickFiles();
|
||||
|
||||
if (result != null) {
|
||||
File file = File(result.files.single.path!);
|
||||
String content = await file.readAsString();
|
||||
// // if (result != null) {
|
||||
// // File file = File(result.files.single.path!);
|
||||
// // String content = await file.readAsString();
|
||||
|
||||
HttpRequest.httpRequest(saveDataString: content);
|
||||
}
|
||||
}
|
||||
// // HttpRequest.httpRequest(saveDataString: content);
|
||||
// }
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -104,7 +101,7 @@ class HomePage extends StatelessWidget {
|
||||
minimumSize: const Size(250, 40),
|
||||
),
|
||||
onPressed: () {
|
||||
_sendFile();
|
||||
// _sendFile();
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.sendfile),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user