Feat: done logic button switcher

This commit is contained in:
orangdeso 2025-05-18 13:38:22 +07:00
parent 45194729c6
commit 00083b6e75
1 changed files with 35 additions and 22 deletions

View File

@ -211,7 +211,6 @@ class _BookingTicketsState extends State<BookingTickets> {
text: 'Cari Tiket',
textColor: Colors.white,
onTap: () {
if (selectedAirportFrom == null || selectedAirportTo == null) {
SnackbarHelper.showInfo('Info', 'Silakan pilih bandara keberangkatan dan tujuan');
return;
@ -241,11 +240,29 @@ class _BookingTicketsState extends State<BookingTickets> {
),
),
),
Positioned(
_buttonSwitch(
onTap: () {
setState(() {
final tempAirport = selectedAirportFrom;
selectedAirportFrom = selectedAirportTo;
selectedAirportTo = tempAirport;
});
},
)
],
),
),
),
);
}
Widget _buttonSwitch({required VoidCallback onTap}) {
return Positioned(
right: 40.w,
top: 65.h,
child: ZoomTapAnimation(
child: InkWell(
onTap: () {},
onTap: onTap,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10.w,
@ -262,10 +279,6 @@ class _BookingTicketsState extends State<BookingTickets> {
child: CustomeIcons.DataTransferOutline(),
),
),
)
],
),
),
),
);
}