Feat: done fetch image from database
This commit is contained in:
parent
c3c0f41269
commit
5535879255
|
@ -157,6 +157,24 @@
|
||||||
"packageUri": "lib/",
|
"packageUri": "lib/",
|
||||||
"languageVersion": "3.4"
|
"languageVersion": "3.4"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "firebase_storage",
|
||||||
|
"rootUri": "file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_storage-12.4.4",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "firebase_storage_platform_interface",
|
||||||
|
"rootUri": "file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_storage_platform_interface-5.2.4",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "firebase_storage_web",
|
||||||
|
"rootUri": "file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_storage_web-3.10.11",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.4"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "flutter",
|
"name": "flutter",
|
||||||
"rootUri": "file:///D:/Flutter/flutter_sdk/flutter_3.24.0/packages/flutter",
|
"rootUri": "file:///D:/Flutter/flutter_sdk/flutter_3.24.0/packages/flutter",
|
||||||
|
@ -500,7 +518,7 @@
|
||||||
"languageVersion": "3.4"
|
"languageVersion": "3.4"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"generated": "2025-03-26T12:09:54.704663Z",
|
"generated": "2025-03-29T09:11:46.461455Z",
|
||||||
"generator": "pub",
|
"generator": "pub",
|
||||||
"generatorVersion": "3.5.0",
|
"generatorVersion": "3.5.0",
|
||||||
"flutterRoot": "file:///D:/Flutter/flutter_sdk/flutter_3.24.0",
|
"flutterRoot": "file:///D:/Flutter/flutter_sdk/flutter_3.24.0",
|
||||||
|
|
|
@ -102,6 +102,18 @@ firebase_core_web
|
||||||
3.4
|
3.4
|
||||||
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_core_web-2.21.1/
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_core_web-2.21.1/
|
||||||
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_core_web-2.21.1/lib/
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_core_web-2.21.1/lib/
|
||||||
|
firebase_storage
|
||||||
|
3.2
|
||||||
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_storage-12.4.4/
|
||||||
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_storage-12.4.4/lib/
|
||||||
|
firebase_storage_platform_interface
|
||||||
|
3.2
|
||||||
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_storage_platform_interface-5.2.4/
|
||||||
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_storage_platform_interface-5.2.4/lib/
|
||||||
|
firebase_storage_web
|
||||||
|
3.4
|
||||||
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_storage_web-3.10.11/
|
||||||
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_storage_web-3.10.11/lib/
|
||||||
flutter_picker
|
flutter_picker
|
||||||
2.12
|
2.12
|
||||||
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_picker-2.1.0/
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_picker-2.1.0/
|
||||||
|
|
|
@ -49,6 +49,7 @@ class FlightModel {
|
||||||
final String transitAirplane;
|
final String transitAirplane;
|
||||||
final String stop;
|
final String stop;
|
||||||
final int price;
|
final int price;
|
||||||
|
final String airlineLogo;
|
||||||
final Map<String, SeatInfo> seat;
|
final Map<String, SeatInfo> seat;
|
||||||
|
|
||||||
FlightModel({
|
FlightModel({
|
||||||
|
@ -66,6 +67,7 @@ class FlightModel {
|
||||||
required this.transitAirplane,
|
required this.transitAirplane,
|
||||||
required this.stop,
|
required this.stop,
|
||||||
required this.price,
|
required this.price,
|
||||||
|
required this.airlineLogo,
|
||||||
required this.seat,
|
required this.seat,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -100,6 +102,7 @@ class FlightModel {
|
||||||
transitAirplane: data['transitAirplane'] ?? '',
|
transitAirplane: data['transitAirplane'] ?? '',
|
||||||
stop: data['stop'] ?? '',
|
stop: data['stop'] ?? '',
|
||||||
price: data['price'] ?? 0,
|
price: data['price'] ?? 0,
|
||||||
|
airlineLogo: data['airlineLogo'] ?? '',
|
||||||
seat: seatMap, // masukkan Map<String, SeatInfo>
|
seat: seatMap, // masukkan Map<String, SeatInfo>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -119,7 +122,7 @@ class FlightModel {
|
||||||
'transitAirplane': transitAirplane,
|
'transitAirplane': transitAirplane,
|
||||||
'stop': stop,
|
'stop': stop,
|
||||||
'price': price,
|
'price': price,
|
||||||
// Konversi Map<String, SeatInfo> jadi Map<String, Map<String,dynamic>>
|
'airlineLogo': airlineLogo,
|
||||||
'seat': seat.map((key, value) => MapEntry(key, value.toMap())),
|
'seat': seat.map((key, value) => MapEntry(key, value.toMap())),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import 'package:e_porter/_core/service/logger_service.dart';
|
import 'dart:developer';
|
||||||
import 'package:e_porter/presentation/screens/routes/app_rountes.dart';
|
import 'package:e_porter/presentation/screens/routes/app_rountes.dart';
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -9,7 +9,7 @@ void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
await Firebase.initializeApp();
|
await Firebase.initializeApp();
|
||||||
|
|
||||||
logger.d("Firebase Initialized Successfully!");
|
log("Firebase Initialized Successfully!");
|
||||||
runApp(MyApp(initialRoute: Routes.SPLASH));
|
runApp(MyApp(initialRoute: Routes.SPLASH));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ class CardFlightInformation extends StatelessWidget {
|
||||||
final String? departurePorter;
|
final String? departurePorter;
|
||||||
final String? arrivalPorter;
|
final String? arrivalPorter;
|
||||||
final String? transitPorter;
|
final String? transitPorter;
|
||||||
|
final String? airlineLogo;
|
||||||
|
|
||||||
const CardFlightInformation({
|
const CardFlightInformation({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
@ -37,6 +38,7 @@ class CardFlightInformation extends StatelessWidget {
|
||||||
this.departurePorter,
|
this.departurePorter,
|
||||||
this.arrivalPorter,
|
this.arrivalPorter,
|
||||||
this.transitPorter,
|
this.transitPorter,
|
||||||
|
this.airlineLogo,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -45,7 +47,29 @@ class CardFlightInformation extends StatelessWidget {
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset('assets/images/citilink.svg', width: 40.w, height: 10.h),
|
airlineLogo != null && airlineLogo!.isNotEmpty
|
||||||
|
? Image.network(
|
||||||
|
airlineLogo!,
|
||||||
|
width: 40.w,
|
||||||
|
height: 26.h,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
print("Error loading image: $error");
|
||||||
|
return Container(
|
||||||
|
width: 40.w,
|
||||||
|
height: 10.h,
|
||||||
|
child: Center(child: Icon(Icons.error)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
loadingBuilder: (context, child, loadingProgress) {
|
||||||
|
if (loadingProgress == null) return child;
|
||||||
|
return Container(
|
||||||
|
width: 40.w,
|
||||||
|
height: 10.h,
|
||||||
|
child: Center(child: CircularProgressIndicator(strokeWidth: 1.0)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: SvgPicture.asset('assets/images/citilink.svg', width: 40.w, height: 10.h),
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
|
@ -91,15 +115,15 @@ class CardFlightInformation extends StatelessWidget {
|
||||||
servicePorter != null ? _buildText(context, text: servicePorter!) : SizedBox.shrink(),
|
servicePorter != null ? _buildText(context, text: servicePorter!) : SizedBox.shrink(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (departurePorter != null && departurePorter!.isNotEmpty) ... [
|
if (departurePorter != null && departurePorter!.isNotEmpty) ...[
|
||||||
SizedBox(height: 4.h),
|
SizedBox(height: 4.h),
|
||||||
TypographyStyles.small(departurePorter!, color: GrayColors.gray600, fontWeight: FontWeight.w400),
|
TypographyStyles.small(departurePorter!, color: GrayColors.gray600, fontWeight: FontWeight.w400),
|
||||||
],
|
],
|
||||||
if (arrivalPorter != null && arrivalPorter!.isNotEmpty) ... [
|
if (arrivalPorter != null && arrivalPorter!.isNotEmpty) ...[
|
||||||
SizedBox(height: 4.h),
|
SizedBox(height: 4.h),
|
||||||
TypographyStyles.small(arrivalPorter!, color: GrayColors.gray600, fontWeight: FontWeight.w400),
|
TypographyStyles.small(arrivalPorter!, color: GrayColors.gray600, fontWeight: FontWeight.w400),
|
||||||
],
|
],
|
||||||
if (transitPorter != null && transitPorter!.isNotEmpty) ... [
|
if (transitPorter != null && transitPorter!.isNotEmpty) ...[
|
||||||
SizedBox(height: 4.h),
|
SizedBox(height: 4.h),
|
||||||
TypographyStyles.small(transitPorter!, color: GrayColors.gray600, fontWeight: FontWeight.w400),
|
TypographyStyles.small(transitPorter!, color: GrayColors.gray600, fontWeight: FontWeight.w400),
|
||||||
],
|
],
|
||||||
|
|
|
@ -7,6 +7,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:zoom_tap_animation/zoom_tap_animation.dart';
|
import 'package:zoom_tap_animation/zoom_tap_animation.dart';
|
||||||
|
|
||||||
|
const bool DEBUG_LOGO = false;
|
||||||
|
|
||||||
class CardTickets extends StatelessWidget {
|
class CardTickets extends StatelessWidget {
|
||||||
final String departureCity;
|
final String departureCity;
|
||||||
final String date;
|
final String date;
|
||||||
|
@ -21,6 +23,7 @@ class CardTickets extends StatelessWidget {
|
||||||
final VoidCallback? onTap;
|
final VoidCallback? onTap;
|
||||||
final bool withContainer;
|
final bool withContainer;
|
||||||
final bool showFooter;
|
final bool showFooter;
|
||||||
|
final String? airlineLogo;
|
||||||
|
|
||||||
const CardTickets({
|
const CardTickets({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
@ -37,6 +40,7 @@ class CardTickets extends StatelessWidget {
|
||||||
this.onTap,
|
this.onTap,
|
||||||
this.withContainer = true,
|
this.withContainer = true,
|
||||||
this.showFooter = true,
|
this.showFooter = true,
|
||||||
|
this.airlineLogo,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -44,7 +48,29 @@ class CardTickets extends StatelessWidget {
|
||||||
Widget content = Column(
|
Widget content = Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset('assets/images/citilink.svg', width: 40.w, height: 10.h),
|
airlineLogo != null && airlineLogo!.isNotEmpty
|
||||||
|
? Image.network(
|
||||||
|
airlineLogo!,
|
||||||
|
width: 40.w,
|
||||||
|
height: 26.h,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
print("Error loading image: $error");
|
||||||
|
return Container(
|
||||||
|
width: 40.w,
|
||||||
|
height: 10.h,
|
||||||
|
child: Center(child: Icon(Icons.error)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
loadingBuilder: (context, child, loadingProgress) {
|
||||||
|
if (loadingProgress == null) return child;
|
||||||
|
return Container(
|
||||||
|
width: 40.w,
|
||||||
|
height: 10.h,
|
||||||
|
child: Center(child: CircularProgressIndicator(strokeWidth: 1.0)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: SvgPicture.asset('assets/images/citilink.svg', width: 40.w, height: 26.h),
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
|
|
@ -111,6 +111,7 @@ class _ChooseSeatScreenState extends State<ChooseSeatScreen> {
|
||||||
final codeArrival = flight.codeArrival;
|
final codeArrival = flight.codeArrival;
|
||||||
final codeTransit = flight.codeTransit;
|
final codeTransit = flight.codeTransit;
|
||||||
final flightClass = flight.flightClass;
|
final flightClass = flight.flightClass;
|
||||||
|
final airlineLogo = flight.airlineLogo;
|
||||||
cityDeparture = flight.cityDeparture;
|
cityDeparture = flight.cityDeparture;
|
||||||
cityArrival = flight.cityArrival;
|
cityArrival = flight.cityArrival;
|
||||||
|
|
||||||
|
@ -177,7 +178,14 @@ class _ChooseSeatScreenState extends State<ChooseSeatScreen> {
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
_buildCardFlight(codeDeparture, codeTransit, codeArrival, flightClass, finalDuration),
|
_buildCardFlight(
|
||||||
|
departureCode: codeDeparture,
|
||||||
|
transitCode: codeTransit,
|
||||||
|
arrivalCode: codeArrival,
|
||||||
|
kelas: flightClass,
|
||||||
|
duration: finalDuration,
|
||||||
|
airlineLogo: airlineLogo,
|
||||||
|
),
|
||||||
SizedBox(height: 20.h),
|
SizedBox(height: 20.h),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 84.h,
|
height: 84.h,
|
||||||
|
@ -264,13 +272,42 @@ class _ChooseSeatScreenState extends State<ChooseSeatScreen> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCardFlight(String departureCode, String transitCode, String arrivalCode, String kelas, String duration) {
|
Widget _buildCardFlight({
|
||||||
|
required String departureCode,
|
||||||
|
required String transitCode,
|
||||||
|
required String arrivalCode,
|
||||||
|
required String kelas,
|
||||||
|
required String duration,
|
||||||
|
String? airlineLogo,
|
||||||
|
}) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 20.h),
|
padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 20.h),
|
||||||
child: CustomeShadowCotainner(
|
child: CustomeShadowCotainner(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset('assets/images/citilink.svg', width: 40.w, height: 10.h),
|
airlineLogo != null && airlineLogo.isNotEmpty
|
||||||
|
? Image.network(
|
||||||
|
airlineLogo,
|
||||||
|
width: 40.w,
|
||||||
|
height: 26.h,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
print("Error loading image: $error");
|
||||||
|
return Container(
|
||||||
|
width: 40.w,
|
||||||
|
height: 10.h,
|
||||||
|
child: Center(child: Icon(Icons.error)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
loadingBuilder: (context, child, loadingProgress) {
|
||||||
|
if (loadingProgress == null) return child;
|
||||||
|
return Container(
|
||||||
|
width: 40.w,
|
||||||
|
height: 10.h,
|
||||||
|
child: Center(child: CircularProgressIndicator(strokeWidth: 1.0)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: SvgPicture.asset('assets/images/citilink.svg', width: 40.w, height: 10.h),
|
||||||
SizedBox(width: 16.w),
|
SizedBox(width: 16.w),
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
@ -374,35 +411,6 @@ class _ChooseSeatScreenState extends State<ChooseSeatScreen> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Widget _buildCardSeat(
|
|
||||||
// BuildContext context, {
|
|
||||||
// required label,
|
|
||||||
// }) {
|
|
||||||
// return Expanded(
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// Container(
|
|
||||||
// width: 32.w,
|
|
||||||
// height: 32.h,
|
|
||||||
// child: TypographyStyles.body(label, color: GrayColors.gray800, fontWeight: FontWeight.w500),
|
|
||||||
// ),
|
|
||||||
// SizedBox(height: 6.h),
|
|
||||||
// ListView.builder(
|
|
||||||
// itemCount: 20,
|
|
||||||
// shrinkWrap: true,
|
|
||||||
// physics: NeverScrollableScrollPhysics(),
|
|
||||||
// itemBuilder: (context, index) {
|
|
||||||
// return Padding(
|
|
||||||
// padding: EdgeInsets.symmetric(vertical: 6.h),
|
|
||||||
// child: CardSeat(),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
Widget _buildSeatColumn(String column, List<bool> seatList, int totalSeat) {
|
Widget _buildSeatColumn(String column, List<bool> seatList, int totalSeat) {
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
|
@ -131,6 +131,7 @@ class _SearchTicketsScreenState extends State<SearchTicketsScreen> {
|
||||||
duration: finalDuration,
|
duration: finalDuration,
|
||||||
seatClass: flight.flightClass,
|
seatClass: flight.flightClass,
|
||||||
price: formattedPrice,
|
price: formattedPrice,
|
||||||
|
airlineLogo: flight.airlineLogo,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
final argument = {
|
final argument = {
|
||||||
"ticketId": ticketId,
|
"ticketId": ticketId,
|
||||||
|
|
|
@ -55,6 +55,7 @@ class _TicketBookingStep1ScreenState extends State<TicketBookingStep1Screen> {
|
||||||
String? stop;
|
String? stop;
|
||||||
String? codeDeparture;
|
String? codeDeparture;
|
||||||
String? codeArrival;
|
String? codeArrival;
|
||||||
|
String? airlineLogo;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
@ -134,6 +135,7 @@ class _TicketBookingStep1ScreenState extends State<TicketBookingStep1Screen> {
|
||||||
stop = flight.stop;
|
stop = flight.stop;
|
||||||
codeDeparture = flight.codeDeparture;
|
codeDeparture = flight.codeDeparture;
|
||||||
codeArrival = flight.codeArrival;
|
codeArrival = flight.codeArrival;
|
||||||
|
airlineLogo = flight.airlineLogo;
|
||||||
|
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
@ -152,6 +154,7 @@ class _TicketBookingStep1ScreenState extends State<TicketBookingStep1Screen> {
|
||||||
passenger: '$passenger',
|
passenger: '$passenger',
|
||||||
transiAirplane: '$transitAirplane',
|
transiAirplane: '$transitAirplane',
|
||||||
stop: '$stop',
|
stop: '$stop',
|
||||||
|
airlineLogo: airlineLogo,
|
||||||
),
|
),
|
||||||
SizedBox(height: 32.h),
|
SizedBox(height: 32.h),
|
||||||
TypographyStyles.h6('Detail Pemesanan', color: GrayColors.gray800),
|
TypographyStyles.h6('Detail Pemesanan', color: GrayColors.gray800),
|
||||||
|
@ -194,6 +197,7 @@ class _TicketBookingStep1ScreenState extends State<TicketBookingStep1Screen> {
|
||||||
'stop': stop,
|
'stop': stop,
|
||||||
'codeDeparture': codeDeparture,
|
'codeDeparture': codeDeparture,
|
||||||
'codeArrival': codeArrival,
|
'codeArrival': codeArrival,
|
||||||
|
'airlineLogo': airlineLogo,
|
||||||
'passenger': passenger,
|
'passenger': passenger,
|
||||||
'selectedPassenger': selectedPassengers,
|
'selectedPassenger': selectedPassengers,
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,6 +36,7 @@ class _TicketBookingStep2ScreenState extends State<TicketBookingStep2Screen> {
|
||||||
String? stop;
|
String? stop;
|
||||||
String? codeDeparture;
|
String? codeDeparture;
|
||||||
String? codeArrival;
|
String? codeArrival;
|
||||||
|
String? airlineLogo;
|
||||||
late final int passenger;
|
late final int passenger;
|
||||||
late final List<PassengerModel?> selectedPassengers;
|
late final List<PassengerModel?> selectedPassengers;
|
||||||
late List<String> selectedSeatNumbers;
|
late List<String> selectedSeatNumbers;
|
||||||
|
@ -58,6 +59,7 @@ class _TicketBookingStep2ScreenState extends State<TicketBookingStep2Screen> {
|
||||||
stop = args['stop'];
|
stop = args['stop'];
|
||||||
codeDeparture = args['codeDeparture'];
|
codeDeparture = args['codeDeparture'];
|
||||||
codeArrival = args['codeArrival'];
|
codeArrival = args['codeArrival'];
|
||||||
|
airlineLogo = args['airlineLogo'] ?? '';
|
||||||
passenger = args['passenger'];
|
passenger = args['passenger'];
|
||||||
selectedPassengers = args['selectedPassenger'] ?? [];
|
selectedPassengers = args['selectedPassenger'] ?? [];
|
||||||
selectedSeatNumbers = args['selectedSeatNumbers'] ?? List.filled(passenger, '');
|
selectedSeatNumbers = args['selectedSeatNumbers'] ?? List.filled(passenger, '');
|
||||||
|
@ -93,6 +95,7 @@ class _TicketBookingStep2ScreenState extends State<TicketBookingStep2Screen> {
|
||||||
passenger: '$passenger',
|
passenger: '$passenger',
|
||||||
transiAirplane: '$transitAirplane',
|
transiAirplane: '$transitAirplane',
|
||||||
stop: '$stop',
|
stop: '$stop',
|
||||||
|
airlineLogo: airlineLogo,
|
||||||
),
|
),
|
||||||
SizedBox(height: 32.h),
|
SizedBox(height: 32.h),
|
||||||
TypographyStyles.h6('Pilih Kursi', color: GrayColors.gray800),
|
TypographyStyles.h6('Pilih Kursi', color: GrayColors.gray800),
|
||||||
|
|
|
@ -214,6 +214,7 @@ class _TicketBookingStep3ScreenState extends State<TicketBookingStep3Screen> {
|
||||||
passenger: "$passenger",
|
passenger: "$passenger",
|
||||||
stop: "${flightData?.stop}",
|
stop: "${flightData?.stop}",
|
||||||
transiAirplane: "${flightData?.transitAirplane}",
|
transiAirplane: "${flightData?.transitAirplane}",
|
||||||
|
airlineLogo: "${flightData?.airlineLogo}",
|
||||||
),
|
),
|
||||||
SizedBox(height: 32.h),
|
SizedBox(height: 32.h),
|
||||||
TypographyStyles.h6("Layanan Porter", color: GrayColors.gray800),
|
TypographyStyles.h6("Layanan Porter", color: GrayColors.gray800),
|
||||||
|
|
|
@ -58,21 +58,6 @@ class _TicketBookingStep4ScreenState extends State<TicketBookingStep4Screen> {
|
||||||
selectedServiceLabels = args['selectedServiceLabels'] ?? [];
|
selectedServiceLabels = args['selectedServiceLabels'] ?? [];
|
||||||
selectedPorterServices = args['selectedPorterServices'] ?? {};
|
selectedPorterServices = args['selectedPorterServices'] ?? {};
|
||||||
|
|
||||||
// log('Ticket ID Step 4: $ticketId');
|
|
||||||
// log('Opsi Penerbangan Step 4: $selectedServiceLabels');
|
|
||||||
|
|
||||||
// if (selectedServiceLabels.isNotEmpty) {
|
|
||||||
// log('Opsi Penerbangan Step 4: ${selectedServiceLabels.join(", ")}');
|
|
||||||
// } else {
|
|
||||||
// log('Tidak ada opsi penerbangan yang dipilih');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// selectedPorterServices.forEach((key, value) {
|
|
||||||
// if (value != null) {
|
|
||||||
// log('Porter $key: ${value.name} - Rp ${value.price}');
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
fetchDataFlight();
|
fetchDataFlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,6 +137,7 @@ class _TicketBookingStep4ScreenState extends State<TicketBookingStep4Screen> {
|
||||||
arrivalPorter: hasArrivalPorter ? "Kedatangan (${getPorterInfo('arrival')})" : null,
|
arrivalPorter: hasArrivalPorter ? "Kedatangan (${getPorterInfo('arrival')})" : null,
|
||||||
transitPorter: hasTransitPorter ? "Transit (${getPorterInfo('transit')})" : null,
|
transitPorter: hasTransitPorter ? "Transit (${getPorterInfo('transit')})" : null,
|
||||||
stop: "${flightData?.stop}",
|
stop: "${flightData?.stop}",
|
||||||
|
airlineLogo: "${flightData?.airlineLogo}",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 32.h),
|
SizedBox(height: 32.h),
|
||||||
|
@ -165,16 +151,9 @@ class _TicketBookingStep4ScreenState extends State<TicketBookingStep4Screen> {
|
||||||
height: MediaQuery.of(context).size.height * 0.4,
|
height: MediaQuery.of(context).size.height * 0.4,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
_buildAirline(
|
||||||
children: [
|
text: '${flightData?.airLines} (${flightData?.code})',
|
||||||
TypographyStyles.body(
|
airlineLogo: '${flightData?.airlineLogo}',
|
||||||
"${flightData?.airLines} (${flightData?.code})",
|
|
||||||
color: GrayColors.gray800,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
SizedBox(width: 10.w),
|
|
||||||
SvgPicture.asset('assets/images/citilink.svg', width: 40.w, height: 10.h),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
SizedBox(height: 2.h),
|
SizedBox(height: 2.h),
|
||||||
_buildRowPorterWithClass(
|
_buildRowPorterWithClass(
|
||||||
|
@ -298,6 +277,43 @@ class _TicketBookingStep4ScreenState extends State<TicketBookingStep4Screen> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildAirline({required String text, String? airlineLogo}) {
|
||||||
|
return Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
TypographyStyles.body(
|
||||||
|
text,
|
||||||
|
color: GrayColors.gray800,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
SizedBox(width: 10.w),
|
||||||
|
airlineLogo != null && airlineLogo.isNotEmpty
|
||||||
|
? Image.network(
|
||||||
|
airlineLogo,
|
||||||
|
width: 40.w,
|
||||||
|
height: 26.h,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
print("Error loading image: $error");
|
||||||
|
return Container(
|
||||||
|
width: 40.w,
|
||||||
|
height: 10.h,
|
||||||
|
child: Center(child: Icon(Icons.error)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
loadingBuilder: (context, child, loadingProgress) {
|
||||||
|
if (loadingProgress == null) return child;
|
||||||
|
return Container(
|
||||||
|
width: 40.w,
|
||||||
|
height: 10.h,
|
||||||
|
child: Center(child: CircularProgressIndicator(strokeWidth: 1.0)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: SvgPicture.asset('assets/images/citilink.svg', width: 40.w, height: 10.h),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildTextService() {
|
Widget _buildTextService() {
|
||||||
final hasDeparturePorter =
|
final hasDeparturePorter =
|
||||||
selectedPorterServices.containsKey('departure') && selectedPorterServices['departure'] != null;
|
selectedPorterServices.containsKey('departure') && selectedPorterServices['departure'] != null;
|
||||||
|
|
|
@ -8,6 +8,7 @@ import Foundation
|
||||||
import cloud_firestore
|
import cloud_firestore
|
||||||
import firebase_auth
|
import firebase_auth
|
||||||
import firebase_core
|
import firebase_core
|
||||||
|
import firebase_storage
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
import shared_preferences_foundation
|
import shared_preferences_foundation
|
||||||
|
|
||||||
|
@ -15,6 +16,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin"))
|
FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin"))
|
||||||
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
|
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
|
||||||
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
|
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
|
||||||
|
FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||||
}
|
}
|
||||||
|
|
24
pubspec.lock
24
pubspec.lock
|
@ -209,6 +209,30 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.21.1"
|
version: "2.21.1"
|
||||||
|
firebase_storage:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: firebase_storage
|
||||||
|
sha256: "2274bb277d0d56d4a106fd89bad5e8f7c005bae77dc3df5abd36101957010840"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "12.4.4"
|
||||||
|
firebase_storage_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: firebase_storage_platform_interface
|
||||||
|
sha256: "36ed6ebc2453a500c6d1e63c8126459056a70a798d53636242b0325951814cf5"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.2.4"
|
||||||
|
firebase_storage_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: firebase_storage_web
|
||||||
|
sha256: e169fc825cbd91c70d73f75b7e8be9ada272b4297184f779ca124b42945828fe
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.10.11"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|
|
@ -2,7 +2,7 @@ name: e_porter
|
||||||
description: "A new Flutter project."
|
description: "A new Flutter project."
|
||||||
# The following line prevents the package from being accidentally published to
|
# The following line prevents the package from being accidentally published to
|
||||||
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
||||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
# The following defines the version and build number for your application.
|
# The following defines the version and build number for your application.
|
||||||
# A version number is three numbers separated by dots, like 1.2.43
|
# A version number is three numbers separated by dots, like 1.2.43
|
||||||
|
@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
version: 1.0.0+1
|
version: 1.0.0+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.4.4 <4.0.0'
|
sdk: ">=3.4.4 <4.0.0"
|
||||||
|
|
||||||
# Dependencies specify other packages that your package needs in order to work.
|
# Dependencies specify other packages that your package needs in order to work.
|
||||||
# To automatically upgrade your package dependencies to the latest versions
|
# To automatically upgrade your package dependencies to the latest versions
|
||||||
|
@ -31,7 +31,6 @@ dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.6
|
cupertino_icons: ^1.0.6
|
||||||
|
@ -47,16 +46,17 @@ dependencies:
|
||||||
firebase_core: ^3.11.0
|
firebase_core: ^3.11.0
|
||||||
cloud_firestore: ^5.6.4
|
cloud_firestore: ^5.6.4
|
||||||
firebase_auth: ^5.5.1
|
firebase_auth: ^5.5.1
|
||||||
|
firebase_storage: ^12.4.4
|
||||||
shared_preferences: ^2.4.6
|
shared_preferences: ^2.4.6
|
||||||
logger: ^2.5.0
|
logger: ^2.5.0
|
||||||
dropdown_button2: ^2.3.9
|
dropdown_button2: ^2.3.9
|
||||||
google_fonts: ^6.2.1
|
google_fonts: ^6.2.1
|
||||||
dotted_dashed_line: ^0.0.3
|
dotted_dashed_line: ^0.0.3
|
||||||
barcode_widget: ^2.0.4
|
barcode_widget: ^2.0.4
|
||||||
|
|
||||||
# pin_code_fields: ^8.0.1
|
# pin_code_fields: ^8.0.1
|
||||||
# dio: ^5.8.0+1
|
# dio: ^5.8.0+1
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <cloud_firestore/cloud_firestore_plugin_c_api.h>
|
#include <cloud_firestore/cloud_firestore_plugin_c_api.h>
|
||||||
#include <firebase_auth/firebase_auth_plugin_c_api.h>
|
#include <firebase_auth/firebase_auth_plugin_c_api.h>
|
||||||
#include <firebase_core/firebase_core_plugin_c_api.h>
|
#include <firebase_core/firebase_core_plugin_c_api.h>
|
||||||
|
#include <firebase_storage/firebase_storage_plugin_c_api.h>
|
||||||
|
|
||||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
CloudFirestorePluginCApiRegisterWithRegistrar(
|
CloudFirestorePluginCApiRegisterWithRegistrar(
|
||||||
|
@ -17,4 +18,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi"));
|
registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi"));
|
||||||
FirebaseCorePluginCApiRegisterWithRegistrar(
|
FirebaseCorePluginCApiRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
|
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
|
||||||
|
FirebaseStoragePluginCApiRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("FirebaseStoragePluginCApi"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
cloud_firestore
|
cloud_firestore
|
||||||
firebase_auth
|
firebase_auth
|
||||||
firebase_core
|
firebase_core
|
||||||
|
firebase_storage
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||||
|
|
Loading…
Reference in New Issue