added update sent. No idea if it works
This commit is contained in:
@@ -262,6 +262,7 @@ class _AddCamMainState extends State<AddCamMain> {
|
||||
await saveFile();
|
||||
// ignore: use_build_context_synchronously
|
||||
Navigator.pushNamedAndRemoveUntil(
|
||||
// ignore: use_build_context_synchronously
|
||||
context, '/home', (route) => false);
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.saveasfile))
|
||||
@@ -273,15 +274,8 @@ class _AddCamMainState extends State<AddCamMain> {
|
||||
void _httpRequest() async {
|
||||
Map<String, dynamic> place = getPlace();
|
||||
|
||||
/* final response = await http.post(
|
||||
Uri.parse('http://192.168.1.106/www.dbb-wolf.de/data/_app24.php'),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
body: '{"test": "test"}'
|
||||
); */
|
||||
|
||||
print(jsonEncode(place));
|
||||
// print(jsonEncode(place));
|
||||
|
||||
final dio = Dio();
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
@@ -295,14 +289,19 @@ class _AddCamMainState extends State<AddCamMain> {
|
||||
data: jsonEncode(place));
|
||||
} on DioException catch (e) {
|
||||
if (e.response?.statusCode == 500) {
|
||||
print('-------------------------');
|
||||
print('code 500');
|
||||
/* print('-------------------------');
|
||||
print('code 500'); */
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (response.statusCode == 201) {
|
||||
print(response.statusCode);
|
||||
// TODO Hackal setzen
|
||||
|
||||
|
||||
var placeDB = DBHelper();
|
||||
|
||||
placeDB.updateSent();
|
||||
} else {
|
||||
print(response.statusCode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user