From 00083b6e75173775a7e4796710f04445038e2808 Mon Sep 17 00:00:00 2001 From: orangdeso Date: Sun, 18 May 2025 13:38:22 +0700 Subject: [PATCH] Feat: done logic button switcher --- .../home/pages/booking_tickets_screen.dart | 57 ++++++++++++------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/lib/presentation/screens/home/pages/booking_tickets_screen.dart b/lib/presentation/screens/home/pages/booking_tickets_screen.dart index e59e249..f6e03ed 100644 --- a/lib/presentation/screens/home/pages/booking_tickets_screen.dart +++ b/lib/presentation/screens/home/pages/booking_tickets_screen.dart @@ -211,7 +211,6 @@ class _BookingTicketsState extends State { text: 'Cari Tiket', textColor: Colors.white, onTap: () { - if (selectedAirportFrom == null || selectedAirportTo == null) { SnackbarHelper.showInfo('Info', 'Silakan pilih bandara keberangkatan dan tujuan'); return; @@ -241,27 +240,14 @@ class _BookingTicketsState extends State { ), ), ), - Positioned( - right: 40.w, - top: 65.h, - child: InkWell( - onTap: () {}, - child: Container( - padding: EdgeInsets.symmetric( - horizontal: 10.w, - vertical: 10.h, - ), - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.circle, - border: Border.all( - strokeAlign: 1.5, - color: GrayColors.gray200, - ), - ), - child: CustomeIcons.DataTransferOutline(), - ), - ), + _buttonSwitch( + onTap: () { + setState(() { + final tempAirport = selectedAirportFrom; + selectedAirportFrom = selectedAirportTo; + selectedAirportTo = tempAirport; + }); + }, ) ], ), @@ -270,6 +256,33 @@ class _BookingTicketsState extends State { ); } + Widget _buttonSwitch({required VoidCallback onTap}) { + return Positioned( + right: 40.w, + top: 65.h, + child: ZoomTapAnimation( + child: InkWell( + onTap: onTap, + child: Container( + padding: EdgeInsets.symmetric( + horizontal: 10.w, + vertical: 10.h, + ), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.circle, + border: Border.all( + strokeAlign: 1.5, + color: GrayColors.gray200, + ), + ), + child: CustomeIcons.DataTransferOutline(), + ), + ), + ), + ); + } + Widget _buildFlightClassRadio() { return Padding( padding: EdgeInsets.symmetric(