luc sitzung
This commit is contained in:
@@ -11,6 +11,7 @@ import 'package:intl/intl.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:animations/animations.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
class AddCamMain extends StatefulWidget {
|
||||
final bool isTemplate;
|
||||
@@ -264,12 +265,38 @@ class _AddCamMainState extends State<AddCamMain> {
|
||||
'KontSum': kontSumC.text,
|
||||
};
|
||||
|
||||
final response = await http.post(Uri.parse("http://192.168.178.30/www.dbb-wolf.de/data/_nicoapi.php"),
|
||||
/* 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: jsonEncode(place));
|
||||
print(response);
|
||||
body: '{"test": "test"}'
|
||||
); */
|
||||
|
||||
print(jsonEncode(place));
|
||||
|
||||
final dio = Dio();
|
||||
dio.options.responseType = ResponseType.plain;
|
||||
Response response =
|
||||
Response(requestOptions: RequestOptions(path: ''), statusCode: 400);
|
||||
|
||||
try {
|
||||
response = await dio.post(
|
||||
'http://192.168.1.106/www.dbb-wolf.de/data/_app24.php',
|
||||
data: jsonEncode(place));
|
||||
} on DioException catch (e) {
|
||||
if (e.response?.statusCode == 500) {
|
||||
print('-------------------------');
|
||||
print('code 500');
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (response.statusCode == 201) {
|
||||
print(response.statusCode);
|
||||
// TODO Hackal setzen
|
||||
} else {
|
||||
print(response.statusCode);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> saveFile() async {
|
||||
@@ -459,12 +486,16 @@ class _AddCamMainState extends State<AddCamMain> {
|
||||
title: Text(AppLocalizations.of(context)!.firstStep),
|
||||
content: Column(
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: AltStOrt(altStOrtC: altStOrtC),
|
||||
),
|
||||
CamId(id: id),
|
||||
Rudel(rudelC: rudelC),
|
||||
Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: FFTyp(ffTypC: ffTypC),
|
||||
),
|
||||
Rudel(rudelC: rudelC),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
@@ -725,10 +756,6 @@ class _AddCamMainState extends State<AddCamMain> {
|
||||
});
|
||||
},
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: AltStOrt(altStOrtC: altStOrtC),
|
||||
),
|
||||
],
|
||||
)),
|
||||
Step(
|
||||
@@ -783,7 +810,7 @@ class _AddCamMainState extends State<AddCamMain> {
|
||||
|
||||
// Here the site is built inclusive the steps from above
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text(AppLocalizations.of(context)!.addCam)),
|
||||
appBar: AppBar(title: Text(AppLocalizations.of(context)!.addplace)),
|
||||
body: PageTransitionSwitcher(
|
||||
duration: const Duration(milliseconds: 800),
|
||||
transitionBuilder: (Widget child, Animation<double> animation,
|
||||
|
||||
Reference in New Issue
Block a user