Adjusted appearance of car management page and removed debug prints
This commit is contained in:
@ -41,7 +41,11 @@ class _CarManagementOverviewState extends State<CarManagementOverview> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCarOverview() {
|
Widget _buildCarOverview() {
|
||||||
return Padding(
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Padding(padding: const EdgeInsets.all(15), child: Text("Fahrzeuge", style: Theme.of(context).textTheme.headlineSmall),),
|
||||||
|
Expanded(child: Padding(
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
child: widget.cars.isEmpty ? const Center(child: Text("keine Fahrzeuge vorhanden")) : ListView.builder(
|
child: widget.cars.isEmpty ? const Center(child: Text("keine Fahrzeuge vorhanden")) : ListView.builder(
|
||||||
itemBuilder:
|
itemBuilder:
|
||||||
@ -52,18 +56,14 @@ class _CarManagementOverviewState extends State<CarManagementOverview> {
|
|||||||
),
|
),
|
||||||
itemCount: widget.cars.length,
|
itemCount: widget.cars.length,
|
||||||
),
|
),
|
||||||
|
))
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
|
||||||
title: Text(
|
|
||||||
"Fahrzeugverwaltung",
|
|
||||||
style: Theme.of(context).textTheme.headlineMedium,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: _addCar,
|
onPressed: _addCar,
|
||||||
backgroundColor: Theme.of(context).primaryColor,
|
backgroundColor: Theme.of(context).primaryColor,
|
||||||
|
|||||||
@ -28,11 +28,7 @@ class CarService {
|
|||||||
throw UserUnauthorized();
|
throw UserUnauthorized();
|
||||||
}
|
}
|
||||||
|
|
||||||
var body = response.body;
|
Map<String, dynamic> responseJson = jsonDecode(response.body);
|
||||||
|
|
||||||
debugPrint("BODY: $body");
|
|
||||||
|
|
||||||
Map<String, dynamic> responseJson = jsonDecode(body);
|
|
||||||
CarAddResponseDTO responseDto = CarAddResponseDTO.fromJson(responseJson);
|
CarAddResponseDTO responseDto = CarAddResponseDTO.fromJson(responseJson);
|
||||||
|
|
||||||
if (responseDto.succeeded == true) {
|
if (responseDto.succeeded == true) {
|
||||||
@ -65,8 +61,6 @@ class CarService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> responseJson = jsonDecode(response.body);
|
Map<String, dynamic> responseJson = jsonDecode(response.body);
|
||||||
debugPrint(responseJson.toString());
|
|
||||||
|
|
||||||
BasicResponseDTO responseDto = BasicResponseDTO.fromJson(responseJson);
|
BasicResponseDTO responseDto = BasicResponseDTO.fromJson(responseJson);
|
||||||
|
|
||||||
if (responseDto.succeeded == true) {
|
if (responseDto.succeeded == true) {
|
||||||
@ -96,7 +90,6 @@ class CarService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> responseJson = jsonDecode(response.body);
|
Map<String, dynamic> responseJson = jsonDecode(response.body);
|
||||||
debugPrint(responseJson.toString());
|
|
||||||
BasicResponseDTO responseDto = BasicResponseDTO.fromJson(responseJson);
|
BasicResponseDTO responseDto = BasicResponseDTO.fromJson(responseJson);
|
||||||
|
|
||||||
if (responseDto.succeeded == true) {
|
if (responseDto.succeeded == true) {
|
||||||
@ -127,10 +120,6 @@ class CarService {
|
|||||||
throw UserUnauthorized();
|
throw UserUnauthorized();
|
||||||
}
|
}
|
||||||
|
|
||||||
var body = response.body;
|
|
||||||
|
|
||||||
debugPrint("BODY: $body");
|
|
||||||
|
|
||||||
Map<String, dynamic> responseJson = jsonDecode(response.body);
|
Map<String, dynamic> responseJson = jsonDecode(response.body);
|
||||||
CarGetResponseDTO responseDto = CarGetResponseDTO.fromJson(responseJson);
|
CarGetResponseDTO responseDto = CarGetResponseDTO.fromJson(responseJson);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user