Feat: adding id field to airport collection
This commit is contained in:
parent
71a5762fa9
commit
1f83b5f2fd
|
@ -1,6 +1,7 @@
|
|||
import 'package:e_porter/_core/constants/colors.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:zoom_tap_animation/zoom_tap_animation.dart';
|
||||
|
||||
import '../../constants/typography.dart';
|
||||
|
||||
|
@ -26,24 +27,26 @@ class ButtonOutline extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: buttonWidth ?? double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: onTap,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(35.r),
|
||||
return ZoomTapAnimation(
|
||||
child: SizedBox(
|
||||
width: buttonWidth ?? double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: onTap,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(35.r),
|
||||
),
|
||||
side: BorderSide(
|
||||
width: 2.w,
|
||||
color: PrimaryColors.primary800,
|
||||
),
|
||||
),
|
||||
side: BorderSide(
|
||||
width: 2.w,
|
||||
color: PrimaryColors.primary800,
|
||||
child: Padding(
|
||||
padding: padding ?? EdgeInsets.symmetric(vertical: 14.h),
|
||||
child: isLoading ? _rowLoading() : _buildText(),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: padding ?? EdgeInsets.symmetric(vertical: 14.h),
|
||||
child: isLoading ? _rowLoading() : _buildText(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
class Airport {
|
||||
final String? id;
|
||||
final String? city;
|
||||
final String? code;
|
||||
final String? name;
|
||||
|
||||
Airport({required this.city, required this.code, required this.name});
|
||||
Airport({this.id, required this.city, required this.code, required this.name});
|
||||
|
||||
factory Airport.fromMap(Map<String, dynamic> map) {
|
||||
factory Airport.fromMap(Map<String, dynamic> map, String documentId) {
|
||||
return Airport(
|
||||
id: documentId,
|
||||
city: map['city'] as String?,
|
||||
code: map['kode'] as String?,
|
||||
name: map['name'] as String?,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:e_porter/_core/component/appbar/appbar_component.dart';
|
||||
import 'package:e_porter/_core/component/button/button_fill.dart';
|
||||
import 'package:e_porter/_core/component/card/custome_shadow_cotainner.dart';
|
||||
|
@ -210,12 +212,16 @@ class _BookingTicketsState extends State<BookingTickets> {
|
|||
onTap: () {
|
||||
if (selectedAirportFrom != null && selectedAirportTo != null) {
|
||||
final searchParams = {
|
||||
"toId": selectedAirportTo!.id,
|
||||
"fromId": selectedAirportFrom!.id,
|
||||
"from": '${selectedAirportFrom!.city}',
|
||||
"to": '${selectedAirportTo!.city}',
|
||||
"leavingDate": selectedDate,
|
||||
"flightClass": selectedClass.value,
|
||||
"passengerCount": selectedPassengerCount,
|
||||
};
|
||||
log('[To ID] : ${selectedAirportTo!.id}');
|
||||
log('[From ID] : ${selectedAirportFrom!.id}');
|
||||
Get.toNamed(Routes.SEARCHTICKETS, arguments: searchParams);
|
||||
} else {
|
||||
Get.snackbar("Error", "Silakan pilih bandara keberangkatan dan tujuan");
|
||||
|
|
Loading…
Reference in New Issue