-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from styrix560/4-handle-duplicate-seats
4 handle duplicate seats
- Loading branch information
Showing
9 changed files
with
112 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import "package:flutter/material.dart"; | ||
import "package:flutter_hooks/flutter_hooks.dart"; | ||
|
||
import "../main.dart"; | ||
import "../types/booking.dart"; | ||
|
||
// When the bookings are merged from the database it is possible, that some | ||
// seats are booked more than once. This dialog allows the user to choose, which | ||
// one of the multiple Bookings attached to a seat they want to edit | ||
class SeatDisambiguationWidget extends HookWidget { | ||
final List<Booking> bookings; | ||
|
||
const SeatDisambiguationWidget(this.bookings); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return AlertDialog( | ||
title: Text("Zu diesem Sitz gehören mehr als eine Buchung."), | ||
content: SingleChildScrollView( | ||
child: Column( | ||
children: [ | ||
Text("Bitte die zu bearbeitende Buchung auswählen:"), | ||
for (final booking in bookings) | ||
Row( | ||
children: [ | ||
Text("${booking.lastName}, ${booking.firstName}"), | ||
Spacer(), | ||
IconButton( | ||
onPressed: () { | ||
navigatorKey.currentState!.pop(booking); | ||
}, | ||
icon: Icon(Icons.edit)), | ||
], | ||
) | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |