3 Commits

Author SHA1 Message Date
Vinayakkadge04
c54f80626a Implemented bloc in itinerary creation screen 2025-10-24 11:18:56 +05:30
Vinayakkadge04
56e7613323 Merge remote-tracking branch 'origin/dinesh' into vinayak
# Conflicts:
#	lib/main.dart
2025-10-16 19:13:11 +05:30
fe4ed84c3f attractin details page added and added completed the registered_user_home_page.dart 2025-10-16 19:09:38 +05:30
44 changed files with 1644 additions and 287 deletions

BIN
assets/dummy/dummy_1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
assets/dummy/dummy_2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
assets/dummy/dummy_3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
assets/dummy/dummy_4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
assets/dummy/dummy_5.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@@ -0,0 +1,29 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import '../models/attraction_model.dart';
import '../repository/attractions_repository.dart';
part 'attractions_event.dart';
part 'attractions_state.dart';
class AttractionsBloc extends Bloc<AttractionsEvent, AttractionsState> {
final AttractionsRepository repository;
AttractionsBloc(this.repository) : super(AttractionsInitial()) {
on<LoadAttractions>((event, emit) {
final attractions = repository.fetchAttractions();
emit(AttractionsLoaded(attractions));
});
on<SearchAttractions>((event, emit) {
if (state is AttractionsLoaded) {
final currentState = state as AttractionsLoaded;
final filtered = currentState.attractions
.where((a) =>
a.title.toLowerCase().contains(event.query.toLowerCase()) ||
a.location.toLowerCase().contains(event.query.toLowerCase()))
.toList();
emit(AttractionsLoaded(filtered));
}
});
}
}

View File

@@ -0,0 +1,10 @@
part of 'attractions_bloc.dart';
abstract class AttractionsEvent {}
class LoadAttractions extends AttractionsEvent {}
class SearchAttractions extends AttractionsEvent {
final String query;
SearchAttractions(this.query);
}

View File

@@ -0,0 +1,10 @@
part of 'attractions_bloc.dart';
abstract class AttractionsState {}
class AttractionsInitial extends AttractionsState {}
class AttractionsLoaded extends AttractionsState {
final List<Attraction> attractions;
AttractionsLoaded(this.attractions);
}

View File

@@ -0,0 +1,15 @@
class Attraction {
final String title;
final String location;
final String price;
final String image;
final List<String> tags;
Attraction({
required this.title,
required this.location,
required this.price,
required this.image,
required this.tags,
});
}

View File

@@ -0,0 +1,43 @@
import '../models/attraction_model.dart';
class AttractionsRepository {
List<Attraction> fetchAttractions() {
return [
Attraction(
title: "Koh Rong Samloem",
location: "Krong Siem Reap",
price: "\$25",
image: "assets/dummy/dummy_1.jpg",
tags: ["Unlimited Card", "Flexi Card"],
),
Attraction(
title: "Siem Reap",
location: "Krong Siem Reap",
price: "\$25",
image: "assets/dummy/dummy_2.jpg",
tags: ["Unlimited Card"],
),
Attraction(
title: "Dart Palace",
location: "Krong Siem Reap",
price: "\$25",
image: "assets/dummy/dummy_3.jpg",
tags: ["Unlimited Card", "Flexi Card"],
),
Attraction(
title: "Koh Rong Samloem",
location: "Krong Siem Reap",
price: "\$25",
image: "assets/dummy/dummy_4.jpg",
tags: ["Flexi Card"],
),
Attraction(
title: "Dart Palace",
location: "Krong Siem Reap",
price: "\$25",
image: "assets/dummy/dummy_5.jpg",
tags: ["Unlimited Card", "Flexi Card"],
),
];
}
}

View File

@@ -0,0 +1,122 @@
import 'package:citycards_customer/common_packages/app_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../common_packages/custom_search_field.dart';
import '../blocs/attractions_bloc.dart';
import '../repository/attractions_repository.dart';
import '../widget/attraction_card.dart';
import '../widget/filter_chip.dart';
class AttractionsPage extends StatelessWidget {
const AttractionsPage({super.key});
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (_) => AttractionsBloc(AttractionsRepository())..add(LoadAttractions()),
child: BlocBuilder<AttractionsBloc, AttractionsState>(
builder: (context, state) {
final bloc = context.read<AttractionsBloc>();
return Scaffold(
backgroundColor: Colors.white,
body: SafeArea(
child: SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// App bar
CommonAppBar(isWhiteLogo: false, isProfilePage: false),
SizedBox(height: 12.h),
Divider(height: 1.h, color: const Color(0xFFD9D9D9)),
SizedBox(height: 22.h),
// Back row
Row(
children: [
GestureDetector(
onTap: () => Navigator.pop(context),
child: Icon(Icons.arrow_back, size: 24.sp),
),
SizedBox(width: 8.w),
Text(
"Your Attraction",
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w400,
color: Colors.black87,
),
),
],
),
const SizedBox(height: 20),
// 🔍 Search field
CommonSearchField(
hint: "Search attractions...",
onChanged: (value) {
if (value.isEmpty) {
bloc.add(LoadAttractions());
} else {
bloc.add(SearchAttractions(value));
}
},
),
const SizedBox(height: 16),
// 🏝️ Category chips row
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
buildCategoryChip("Beach"),
buildCategoryChip("Hike"),
buildCategoryChip("Popular"),
buildCategoryChip("Best in Summer"),
],
),
),
const SizedBox(height: 10),
// 🏙️ Attraction list
if (state is AttractionsLoaded)
state.attractions.isEmpty
? Center(
child: Padding(
padding: const EdgeInsets.only(top: 60),
child: Text(
"No attractions found",
style: TextStyle(
color: Colors.grey[600],
fontSize: 14.sp,
),
),
),
)
: Column(
children: state.attractions
.map((attraction) => AttractionCard(
attraction: attraction))
.toList(),
)
else
const Center(
child: Padding(
padding: EdgeInsets.only(top: 60),
child: CircularProgressIndicator(),
),
),
],
),
),
),
);
},
),
);
}
}

View File

@@ -0,0 +1,99 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../models/attraction_model.dart';
class AttractionCard extends StatelessWidget {
final Attraction attraction;
const AttractionCard({super.key, required this.attraction});
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 8),
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
border: Border.all(color: const Color(0xffFDCDCE)),
borderRadius: BorderRadius.circular(15),
color: Color(0xffFFF5F5),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Image.asset(
attraction.image,
height: 94,
width: 94,
fit: BoxFit.cover,
),
),
const SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(attraction.title,
style: TextStyle(
fontSize: 16, fontWeight: FontWeight.w500)),
const SizedBox(height: 6),
Text(attraction.location,
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Color(0xff464646))),
const SizedBox(height: 6),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "from ${attraction.price}",
style: const TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Colors.black,
),
),
const TextSpan(
text: "/person",
style:
TextStyle(fontSize: 10, color: Colors.black, fontWeight: FontWeight.w400,),
),
],
),
),
const SizedBox(height: 6),
Wrap(
spacing: 6,
children: attraction.tags
.map((tag) => Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
decoration: BoxDecoration(
color: tag == "Flexi Card"
? const Color(0xffF95FAF).withOpacity(0.1)
: const Color(0xffF95F62).withOpacity(0.1),
border: Border.all(
color: tag == "Flexi Card"
? const Color(0xffF95FAF)
: const Color(0xffF95F62),
),
borderRadius: BorderRadius.circular(20),
),
child: Text(
tag,
style: GoogleFonts.poppins(
fontSize: 11,
color: Color(0xff1A1A1A),
fontWeight: FontWeight.w400,
),
),
))
.toList(),
)
,
],
),
),
],
),
);
}
}

View File

@@ -0,0 +1,20 @@
import "package:flutter/material.dart";
Widget buildCategoryChip(String label) {
return Container(
margin: const EdgeInsets.only(right: 8),
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
decoration: BoxDecoration(
color: const Color(0xffF95F62),
borderRadius: BorderRadius.circular(40),
),
child: Text(
label,
style: const TextStyle(
color: Colors.white,
fontSize: 13,
fontWeight: FontWeight.w500,
),
),
);
}

View File

@@ -34,7 +34,8 @@ class CommonAppBar extends StatelessWidget {
if(!isProfilePage)
GestureDetector(
onTap: (){
Navigator.pushNamed(context, RouteConstants.profile);
Navigator.of(context, rootNavigator: true)
.pushNamed(RouteConstants.profile);
},
child: CircleAvatar(
backgroundColor: Color(0xffFFDFDF),

View File

@@ -0,0 +1,35 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class CommonSearchField extends StatelessWidget {
final ValueChanged<String> onChanged;
final String hint;
const CommonSearchField({
super.key,
required this.onChanged,
this.hint = "Search attractions",
});
@override
Widget build(BuildContext context) {
return TextField(
onChanged: onChanged,
decoration: InputDecoration(
hintText: hint,
hintStyle: GoogleFonts.poppins(color: Colors.grey.shade500),
filled: true,
fillColor: Colors.white,
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xffF95F62).withOpacity(0.4)),
borderRadius: BorderRadius.circular(12),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xffF95F62).withOpacity(0.4)),
borderRadius: BorderRadius.circular(12),
),
),
);
}
}

View File

@@ -1,4 +1,5 @@
import 'package:citycards_customer/common_bloc/language_selection_bloc.dart';
import 'package:citycards_customer/common_packages/custom_filled_button.dart';
import 'package:citycards_customer/common_packages/custom_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -82,6 +83,95 @@ class LanguageSelectionBottomsheet extends StatelessWidget {
context.read<LanguageBloc>().add(
UpdateLanguage(item),
);
Navigator.of(context).pop();
showModalBottomSheet(
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(12.r),
),
),
builder: (context) => Padding(
padding: EdgeInsets.symmetric(
horizontal: 20.w,
vertical: 16.h,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 40.w,
height: 4.h,
decoration: BoxDecoration(
color: Color(0xFF2D3134),
borderRadius: BorderRadius.circular(4.r),
),
),
SizedBox(height: 20.h),
Text(
"Are you sure you want to switch to",
style: TextStyle(
color: Colors.black.withOpacity(.6),
fontWeight: FontWeight.w400,
fontSize: 18.sp
),
),
SizedBox(height: 8.h),
Text(
item,
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w500,
),
),
SizedBox(height: 20.h),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: OutlinedButton(
onPressed: () =>
Navigator.of(context).pop(),
style: OutlinedButton.styleFrom(
side: BorderSide(
color: Colors.transparent,
),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(40.r),
),
minimumSize: Size(
double.infinity,
42.h,
),
),
child: Text(
"Cancel",
style: TextStyle(
color: Color(0xFFF95F62),
fontWeight: FontWeight.w500,
),
),
),
),
SizedBox(width: 16.w),
CustomFilledButton(
width: 166.w,
height: 42.h,
onTap: () {
Navigator.pop(context);
},
label: "Save",
),
],
),
SizedBox(height: 16.h),
],
),
),
);
},
child: state.selectedLanguage == item
? Image.asset(

View File

@@ -5,7 +5,7 @@ import 'package:citycards_customer/edit_profile/edit_profile_view.dart';
import 'package:citycards_customer/esim_offer/esim_offer_view.dart';
import 'package:citycards_customer/faq/faq_view.dart';
import 'package:citycards_customer/hotel_offer/hotel_offer_view.dart';
import 'package:citycards_customer/itinerary_creation/bloc/date_selection_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_detail_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:citycards_customer/itinerary_creation/views/itinerary_creation_start_view.dart';
import 'package:citycards_customer/itinerary_creation/views/itinerary_creation_view.dart';
@@ -13,6 +13,7 @@ import 'package:citycards_customer/privacy/privacy_view.dart';
import 'package:citycards_customer/terms_and_condition/terms_and_condition_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../attractions/views/attractions_page_view.dart';
import '../common_bloc/bottom_navigation_bloc.dart';
import '../home/views/home_page_view.dart';
import 'route_constants.dart';
@@ -30,7 +31,8 @@ class AppRouter {
);
},
);
case RouteConstants.attractionsPage:
return MaterialPageRoute(builder: (_) => const AttractionsPage());
case RouteConstants.profile:
return MaterialPageRoute(
builder: (_) {
@@ -83,12 +85,13 @@ class AppRouter {
builder: (_) {
return MultiBlocProvider(
providers: [
BlocProvider<UpdateSelectedDateBloc>(
create: (_) => UpdateSelectedDateBloc(),
),
BlocProvider<ItineraryStepNavigationBloc>(
create: (_) => ItineraryStepNavigationBloc(),
),
BlocProvider<AddItineraryDetailBloc>(
create: (_) => AddItineraryDetailBloc(),
),
],
child: const ItineraryCreationPage(),
);
@@ -96,10 +99,11 @@ class AppRouter {
);
case RouteConstants.hotelOffer:
return MaterialPageRoute(builder: (_){
return HotelOfferView();
});
return MaterialPageRoute(
builder: (_) {
return HotelOfferView();
},
);
case RouteConstants.esimOffer:
return MaterialPageRoute(

View File

@@ -1,5 +1,8 @@
class RouteConstants {
/****************************** HOME SECTION ************************************/
static const String home = '/home';
static const String attractionsPage = "/attractions";
/* ****************************** Profile Section **************************/

View File

@@ -1,9 +1,10 @@
import 'package:citycards_customer/home/views/registered_user_home_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../attractions/views/attractions_page_view.dart';
import '../../common_bloc/bottom_navigation_bloc.dart';
import '../../common_packages/custom_bottom_navbar.dart';
import '../../core/route_constants.dart';
import 'first_time_user_home_page.dart';
class HomePage extends StatefulWidget {
@@ -14,30 +15,58 @@ class HomePage extends StatefulWidget {
}
class _HomePageState extends State<HomePage> {
final _navigatorKeys = [
GlobalKey<NavigatorState>(), // tab 0
GlobalKey<NavigatorState>(), // tab 1
];
@override
Widget build(BuildContext context) {
return BlocBuilder<NavigationBloc, NavigationState>(
builder: (context, state) {
Widget body;
switch (state.selectedIndex){
case 0:
body = const FirstTimeUserHomePage();
case 1:
body = const RegisteredUserHomePage();
break;
default:
body = const FirstTimeUserHomePage();
}
final currentIndex = state.selectedIndex;
return SafeArea(
top: false,
child: Scaffold(
body: body,
body: Stack(
children: [
_buildOffstageNavigator(0, currentIndex, const FirstTimeUserHomePage()),
_buildOffstageNavigator(1, currentIndex, const RegisteredUserHomePage()),
],
),
bottomNavigationBar: CustomBottomNavBar(),
),
);
}
},
);
}
Widget _buildOffstageNavigator(int index, int currentIndex, Widget child) {
return Offstage(
offstage: currentIndex != index,
child: Navigator(
key: _navigatorKeys[index],
onGenerateRoute: (settings) {
switch (settings.name) {
case '/':
return MaterialPageRoute(builder: (_) => child);
case RouteConstants.attractionsPage:
return MaterialPageRoute(
builder: (_) => const AttractionsPage(),
);
default:
return MaterialPageRoute(
builder: (_) => const Scaffold(
body: Center(child: Text('Page not found')),
),
);
}
},
),
);
}
}

View File

@@ -1,7 +1,10 @@
import 'package:citycards_customer/home/widgets/e_sim_offer_section.dart';
import 'package:citycards_customer/home/widgets/hotel_offers_section.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../../common_packages/app_bar.dart';
import '../../core/route_constants.dart';
import '../widgets/attractions_list.dart';
import '../widgets/get_your_pass_card.dart';
import '../widgets/gradient_container_bg.dart';
@@ -122,7 +125,9 @@ class _RegisteredUserHomePageState extends State<RegisteredUserHomePage> {
),
),
InkWell(
onTap: (){},
onTap: (){
Navigator.of(context).pushNamed(RouteConstants.attractionsPage);
},
child: Text("View all",
style: TextStyle(
fontSize: 12,
@@ -146,6 +151,9 @@ class _RegisteredUserHomePageState extends State<RegisteredUserHomePage> {
)
),
const SizedBox(height: 10),
ESimOfferSection(),
HotelOffersSection(),
const SizedBox(height: 10),
Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
@@ -166,9 +174,7 @@ class _RegisteredUserHomePageState extends State<RegisteredUserHomePage> {
ChooseYourPassSection(),
const SizedBox(height: 20),
// ===== GET YOUR PASS SECTION =====
GetYourPassCard(),
const SizedBox(height: 40),
],
),
),

View File

@@ -0,0 +1,149 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class ESimOfferSection extends StatelessWidget {
const ESimOfferSection({super.key});
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
gradient: const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF2A2B7B), // deep navy blue
Color(0xFF9E1E2E), // rich red tone
],
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// ===== HEADER LINE =====
RichText(
text: TextSpan(
children: [
TextSpan(
text: "Explore ",
style: GoogleFonts.poppins(
color: const Color(0xFFF95F62),
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
TextSpan(
text: "More Cities.",
style: GoogleFonts.poppins(
color: Colors.white.withOpacity(0.9),
fontSize: 14,
fontWeight: FontWeight.w400,
),
),
],
),
),
const SizedBox(height: 10),
// ===== MAIN HEADING =====
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// Stay Connected
Text.rich(
TextSpan(
children: [
TextSpan(
text: "Stay ",
style: GoogleFonts.poppins(
color: Colors.white,
fontSize: 28,
fontWeight: FontWeight.w500,
),
),
TextSpan(
text: "Connected",
style: GoogleFonts.poppins(
color: const Color(0xFFF95F62),
fontSize: 28,
fontWeight: FontWeight.w600,
),
),
],
),
),
const SizedBox(height: 2),
// Everywhere (centered)
Center(
child: Text(
"Everywhere",
style: GoogleFonts.poppins(
color: Colors.white,
fontSize: 28,
fontWeight: FontWeight.w500,
),
),
),
],
),
const SizedBox(height: 20),
// ===== SUB CARD =====
Container(
width: double.infinity,
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: const Color(0xFFF95F62),
borderRadius: BorderRadius.circular(16),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Claim e-Sim offers with\nCityCard",
style: GoogleFonts.poppins(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
Container(
decoration: const BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
padding: const EdgeInsets.all(12),
child: Image.asset(
"assets/icons/arrow_angle_up.png",
color: Color(0xFFF95F62),
scale: 4,
),
)
],
),
const SizedBox(height: 4),
Text(
"Lorem ipsum dolor sit amet...",
style: GoogleFonts.poppins(
color: Colors.white.withOpacity(0.85),
fontSize: 13,
fontWeight: FontWeight.w400,
),
),
],
),
),
],
),
);
}
}

View File

@@ -8,52 +8,63 @@ class GetYourPassCard extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
margin: const EdgeInsets.symmetric(horizontal: 14, vertical: 0),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
decoration: BoxDecoration(
color: const Color(0xFFFFF1F1),
borderRadius: BorderRadius.circular(40),
border: Border.all(color: Color(0xffFDCDCE))
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Column(
children: [
// ===== Left Section =====
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Left texts and overlapping images
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Get your Pass",
style: GoogleFonts.poppins(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Colors.black,
),
),
const SizedBox(height: 6),
Row(
children: [
// Stacked circular attraction images
AttractionsAvatarStack(imagePath: 'assets/images/get_your_pass_bg.jpg',),
const SizedBox(width: 8),
Text(
"Attractions",
style: GoogleFonts.poppins(
fontSize: 13,
color: Colors.black87,
),
),
],
),
],
Text(
"Get your Pass",
style: GoogleFonts.poppins(
fontSize: 18,
fontWeight: FontWeight.w500,
color: Colors.black,
),
),
Container(
padding: const EdgeInsets.all(8),
decoration: const BoxDecoration(
color: Color(0xffF95F62),
shape: BoxShape.circle,
),
child: const Icon(
Icons.arrow_forward,
color: Colors.black,
size: 18,
),
),
],
),
// ===== Right Section =====
const SizedBox(
height: 7,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AttractionsAvatarStack(imagePath: 'assets/images/get_your_pass_bg.jpg',),
const SizedBox(width: 8),
Text(
"Attractions",
style: GoogleFonts.poppins(
fontSize: 13,
color: Colors.black,
fontWeight: FontWeight.w400
),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
@@ -87,20 +98,6 @@ class GetYourPassCard extends StatelessWidget {
),
],
),
const SizedBox(width: 12),
// Circular Arrow Button
Container(
padding: const EdgeInsets.all(10),
decoration: const BoxDecoration(
color: Color(0xffF95F62),
shape: BoxShape.circle,
),
child: const Icon(
Icons.arrow_forward,
color: Colors.white,
size: 18,
),
),
],
),
],
@@ -113,7 +110,7 @@ class AttractionsAvatarStack extends StatelessWidget {
const AttractionsAvatarStack({
super.key,
required this.imagePath, // from your assets/figma
this.size = 26, // circle diameter
this.size = 35, // circle diameter
this.count = 4, // total circles including the last “16+”
this.overlap = 8, // how much they overlap
this.moreText = '16+',

View File

@@ -0,0 +1,173 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart';
class HotelOffersSection extends StatelessWidget {
const HotelOffersSection({super.key});
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFFFFCA8E).withOpacity(0.24), // deep navy blue
Color(0xFFDB00FF).withOpacity(0.24), // rich red tone
Color(0xFFF95F62).withOpacity(0.24),
],
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// ===== HEADER LINE =====
RichText(
text: TextSpan(
children: [
TextSpan(
text: "MARRIOTT ",
style: GoogleFonts.poppins(
color: const Color(0xFFF95F62),
fontSize: 12,
fontWeight: FontWeight.w600,
),
),
TextSpan(
text: "MOMENTS",
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 12,
fontWeight: FontWeight.w400,
),
),
TextSpan(
text: ", ",
style: GoogleFonts.poppins(
color: const Color(0xFFF95F62),
fontSize: 12,
fontWeight: FontWeight.w600,
),
),
TextSpan(
text: "CITYCARD ",
style: GoogleFonts.poppins(
color: const Color(0xFFF95F62),
fontSize: 12,
fontWeight: FontWeight.w600,
),
),
TextSpan(
text: "PRICES",
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 12,
fontWeight: FontWeight.w400,
),
),
],
),
),
const SizedBox(height: 10),
// ===== MAIN HEADING =====
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// Stay Connected
Text.rich(
TextSpan(
children: [
TextSpan(
text: "Premium ",
style: GoogleFonts.poppins(
color: const Color(0xFFF95F62),
fontSize: 32.sp,
fontWeight: FontWeight.w600,
),
),
TextSpan(
text: "Stays",
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 32.sp,
fontWeight: FontWeight.w400,
),
),
],
),
),
Center(
child: Text(
"CityCard Prices",
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 32.sp,
fontWeight: FontWeight.w400,
),
),
),
],
),
const SizedBox(height: 20),
// ===== SUB CARD =====
Container(
width: double.infinity,
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: const Color(0xFFF95F62),
borderRadius: BorderRadius.circular(16),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Claim Hotel Discount offers\nwith CityCard",
style: GoogleFonts.poppins(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
Container(
decoration: const BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
padding: const EdgeInsets.all(12),
child: Image.asset(
"assets/icons/arrow_angle_up.png",
color: Color(0xFFF95F62),
scale: 4,
),
)
],
),
const SizedBox(height: 4),
Text(
"Lorem ipsum dolor sit amet...",
style: GoogleFonts.poppins(
color: Colors.white.withOpacity(0.85),
fontSize: 13,
fontWeight: FontWeight.w400,
),
),
],
),
),
],
),
);
}
}

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart';
class ChooseYourPassSection extends StatefulWidget {
@@ -131,21 +132,35 @@ class _ChooseYourPassSectionState extends State<ChooseYourPassSection> {
),
),
const SizedBox(height: 6),
Text(
"From ${item['price']}",
style: GoogleFonts.poppins(
fontSize: 16,
color: item['color'],
fontWeight: FontWeight.w600,
Text.rich(
TextSpan(
children: [
TextSpan(
text: "From ",
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.w400,
color: Color(0xff535353),
),
),
),
TextSpan(
text: item['price'],
style: TextStyle(
fontSize: 16.sp,
color: item['color'],
fontWeight: FontWeight.w600
),
),
],
),
),
const SizedBox(height: 12),
Text(
"Dive into an extensive selection of thrilling destinations, "
"thoughtfully categorized to help you find the perfect getaway.",
style: GoogleFonts.poppins(
fontSize: 12,
color: Colors.grey[800],
color: Color(0xff5B5F62),
height: 1.4,
),
),
@@ -156,7 +171,7 @@ class _ChooseYourPassSectionState extends State<ChooseYourPassSection> {
"• Fusce tincidunt interdum ex, in tincidunt libero porttitor vel.",
style: TextStyle(
fontSize: 12,
color: Colors.black54,
color: Color(0xff5B5F62),
height: 1.5,
),
),
@@ -175,8 +190,8 @@ class _ChooseYourPassSectionState extends State<ChooseYourPassSection> {
child: Text(
"Get a Pass",
style: GoogleFonts.poppins(
fontWeight: FontWeight.w600,
fontSize: 14,
fontWeight: FontWeight.w500,
fontSize: 14.sp,
color: Colors.white,
),
),

View File

@@ -2,7 +2,6 @@ import 'package:citycards_customer/common_packages/app_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:citycards_customer/common_packages/custom_filled_button.dart';
import 'package:citycards_customer/common_packages/custom_text.dart';
class HotelOfferView extends StatelessWidget {
const HotelOfferView({super.key});

View File

@@ -1,28 +0,0 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:intl/intl.dart';
abstract class SelectDateEvent {}
class SelectItineraryDateEvent extends SelectDateEvent {
final String date;
SelectItineraryDateEvent(this.date);
}
class SelectItineraryDateState {
final String selectedDate;
const SelectItineraryDateState(this.selectedDate);
}
class UpdateSelectedDateBloc
extends Bloc<SelectDateEvent, SelectItineraryDateState> {
UpdateSelectedDateBloc()
: super(
SelectItineraryDateState(
DateFormat('EEEE, MMMM d, yyyy').format(DateTime.now()),
),
) {
on<SelectItineraryDateEvent>((event, emit) {
emit(SelectItineraryDateState(event.date));
});
}
}

View File

@@ -0,0 +1,183 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:intl/intl.dart';
abstract class ItineraryDetailEvent {}
class AddDateToItinerary extends ItineraryDetailEvent {
final String date;
AddDateToItinerary(this.date);
}
class AddCityToItinerary extends ItineraryDetailEvent {
final String city;
AddCityToItinerary(this.city);
}
class AddEnergyToItinerary extends ItineraryDetailEvent {
final String energy;
AddEnergyToItinerary(this.energy);
}
class AddWithKidsToItinerary extends ItineraryDetailEvent {
final String withKid;
AddWithKidsToItinerary(this.withKid);
}
class AddDietaryToItinerary extends ItineraryDetailEvent {
final String dietary;
AddDietaryToItinerary(this.dietary);
}
class AddMuseumRating extends ItineraryDetailEvent {
final String museumRating;
AddMuseumRating(this.museumRating);
}
class AddScenicRating extends ItineraryDetailEvent {
final String scenicRating;
AddScenicRating(this.scenicRating);
}
class AddCulturalRating extends ItineraryDetailEvent {
final String culturalRating;
AddCulturalRating(this.culturalRating);
}
class AddWildLifeRating extends ItineraryDetailEvent {
final String wildlifeRating;
AddWildLifeRating(this.wildlifeRating);
}
class AddShoppingRating extends ItineraryDetailEvent {
final String shoppingRating;
AddShoppingRating(this.shoppingRating);
}
class ItineraryDetailState {
final String? selectedDate;
final String? selectedCity;
final String? selectedEnergy;
final String? withKid;
final List<String>? selectedDietary;
final String? museumRating;
final String? scenicRating;
final String? culturalRating;
final String? wildLifeRating;
final String? shoppingRating;
ItineraryDetailState({
this.selectedDate,
this.selectedCity,
this.selectedEnergy,
this.withKid,
this.selectedDietary,
this.museumRating,
this.scenicRating,
this.culturalRating,
this.wildLifeRating,
this.shoppingRating,
});
ItineraryDetailState copyWith({
String? selectedDate,
String? selectedCity,
String? selectedEnergy,
String? withKid,
List<String>? selectedDietary,
String? museumRating,
String? scenicRating,
String? culturalRating,
String? wildLifeRating,
String? shoppingRating,
}) {
return ItineraryDetailState(
selectedDate: selectedDate ?? this.selectedDate,
selectedCity: selectedCity ?? this.selectedCity,
selectedEnergy: selectedEnergy ?? this.selectedEnergy,
withKid: withKid ?? this.withKid,
selectedDietary: selectedDietary ?? this.selectedDietary,
museumRating: museumRating ?? this.museumRating,
scenicRating: scenicRating ?? this.scenicRating,
culturalRating: culturalRating ?? this.culturalRating,
wildLifeRating: wildLifeRating ?? this.wildLifeRating,
shoppingRating: shoppingRating ?? this.shoppingRating,
);
}
}
class AddItineraryDetailBloc
extends Bloc<ItineraryDetailEvent, ItineraryDetailState> {
AddItineraryDetailBloc()
: super(
ItineraryDetailState(
selectedDate: DateFormat('EEEE, MMMM d, yyyy').format(DateTime.now()),
selectedCity: "Paris",
selectedEnergy: "",
withKid: "",
selectedDietary: const [],
museumRating: "",
scenicRating: "",
culturalRating: "",
wildLifeRating: "",
shoppingRating: "",
),
) {
on<AddDateToItinerary>((event, emit) {
emit(state.copyWith(selectedDate: event.date));
});
on<AddCityToItinerary>((event, emit) {
print("Selected city: ${event.city}");
emit(state.copyWith(selectedCity: event.city));
});
on<AddEnergyToItinerary>((event, emit) {
emit(state.copyWith(selectedEnergy: event.energy));
});
on<AddWithKidsToItinerary>((event, emit) {
emit(state.copyWith(withKid: event.withKid));
});
on<AddDietaryToItinerary>((event, emit) {
final currentSelection = List<String>.from(state.selectedDietary ?? []);
if (currentSelection.contains(event.dietary)) {
currentSelection.remove(event.dietary);
} else {
currentSelection.add(event.dietary);
}
emit(state.copyWith(selectedDietary: currentSelection));
});
on<AddMuseumRating>((event, emit) {
emit(state.copyWith(museumRating: event.museumRating));
});
on<AddScenicRating>((event, emit) {
emit(state.copyWith(scenicRating: event.scenicRating));
});
on<AddCulturalRating>((event, emit) {
emit(state.copyWith(culturalRating: event.culturalRating));
});
on<AddWildLifeRating>((event, emit) {
emit(state.copyWith(wildLifeRating: event.wildlifeRating));
});
on<AddShoppingRating>((event, emit) {
emit(state.copyWith(shoppingRating: event.shoppingRating));
});
}
}

View File

@@ -6,6 +6,8 @@ class ItineraryStepNavigationNextEvent extends ItineraryStepNavigationEvent {}
class ItineraryStepNavigationPreviousEvent extends ItineraryStepNavigationEvent {}
class ItineraryStepStartOver extends ItineraryStepNavigationEvent{}
class ItineraryStepNavigationState {
final int selectedIndex;
const ItineraryStepNavigationState(this.selectedIndex);
@@ -18,7 +20,6 @@ class ItineraryStepNavigationBloc
ItineraryStepNavigationBloc({this.maxIndex = 2})
: super(const ItineraryStepNavigationState(0)) {
on<ItineraryStepNavigationNextEvent>((event, emit) {
final nextIndex = state.selectedIndex + 1;
if (nextIndex <= 10) {
@@ -32,5 +33,9 @@ class ItineraryStepNavigationBloc
emit(ItineraryStepNavigationState(prevIndex));
}
});
on<ItineraryStepStartOver>((event, emit){
emit(ItineraryStepNavigationState(0));
});
}
}

View File

@@ -1,10 +1,32 @@
import 'package:citycards_customer/common_packages/custom_filled_button.dart';
import 'package:citycards_customer/common_packages/custom_search_field.dart';
import 'package:citycards_customer/common_packages/custom_text.dart';
import 'package:citycards_customer/common_packages/custom_textfield.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_detail_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class MenuItem {
final int id;
final String label;
final String flag;
MenuItem(this.id, this.label, this.flag);
}
List<MenuItem> menuItems = [
MenuItem(1, 'Paris', "🇫🇷"),
MenuItem(2, 'Tokyo', "🇯🇵"),
MenuItem(3, 'New York', "🇺🇸"),
MenuItem(4, 'London', "🇬🇧"),
MenuItem(5, 'Barcelona', "🇪🇸"),
MenuItem(6, 'Dubai', "🇦🇪"),
MenuItem(7, 'Rome', "🇮🇹"),
MenuItem(8, 'Bangkok', "🇹🇭"),
];
class CitySelectionView extends StatelessWidget {
CitySelectionView({super.key});
@@ -19,6 +41,8 @@ class CitySelectionView extends StatelessWidget {
{"flag": "🇹🇭", "city": "Bangkok"},
];
final TextEditingController cityController = TextEditingController();
@override
Widget build(BuildContext context) {
return Center(
@@ -35,27 +59,111 @@ class CitySelectionView extends StatelessWidget {
textAlign: TextAlign.center,
),
SizedBox(height: 32.h),
Container(
height: 56.h,
width: double.infinity,
padding: EdgeInsets.only(left: 20.w),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Color(0xFFF95F62)),
borderRadius: BorderRadius.circular(28.r),
borderRadius: BorderRadius.circular(28),
),
child: Row(
children: [
Image.asset("assets/icons/location.png", scale: 4),
SizedBox(width: 12.w),
CustomText(
text: "Tokyo",
color: Color(0xFF737373),
size: 14.sp,
Expanded(
child: SizedBox(
child:
BlocBuilder<
AddItineraryDetailBloc,
ItineraryDetailState
>(
builder: (context, state) {
final selectedMenuItem = menuItems.firstWhere(
(menu) => menu.label == state.selectedCity,
orElse: () =>
menuItems.first, // fallback if not found
);
return DropdownMenu<MenuItem>(
controller: cityController,
initialSelection: selectedMenuItem,
width: double.infinity,
hintText: "Select City",
requestFocusOnTap: true,
enableFilter: true,
showTrailingIcon: false,
onSelected: (MenuItem? menu) {
context.read<AddItineraryDetailBloc>().add(
AddCityToItinerary(menu!.label),
);
},
inputDecorationTheme: InputDecorationTheme(
contentPadding: EdgeInsets.symmetric(
vertical: 6.h,
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(28),
borderSide: const BorderSide(
color: Colors.transparent,
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(28),
borderSide: const BorderSide(
color: Colors.transparent,
),
),
),
menuStyle: MenuStyle(
backgroundColor: WidgetStateProperty.all(
Colors.white,
),
maximumSize: WidgetStateProperty.all(
Size.infinite,
),
),
dropdownMenuEntries: menuItems
.map<DropdownMenuEntry<MenuItem>>((
MenuItem menu,
) {
return DropdownMenuEntry<MenuItem>(
value: menu,
label: menu.label,
leadingIcon: CustomText(text: menu.flag),
);
})
.toList(),
);
},
),
),
),
],
),
),
// Container(
// height: 56.h,
// width: double.infinity,
// padding: EdgeInsets.only(left: 20.w),
// decoration: BoxDecoration(
// color: Colors.white,
// border: Border.all(color: Color(0xFFF95F62)),
// borderRadius: BorderRadius.circular(28.r),
// ),
// child: Row(
// children: [
// Image.asset("assets/icons/location.png", scale: 4),
// SizedBox(width: 12.w),
// CustomText(
// text: "Tokyo",
// color: Color(0xFF737373),
// size: 14.sp,
// ),
// ],
// ),
// ),
SizedBox(height: 16.h),
Align(
alignment: Alignment.topLeft,
@@ -69,46 +177,66 @@ class CitySelectionView extends StatelessWidget {
SizedBox(height: 10.h),
SizedBox(
height: 175.h,
child: GridView.builder(
physics: const NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
mainAxisSpacing: 16.h,
crossAxisSpacing: 16.w,
),
itemCount: cityList.length,
itemBuilder: (context, index) {
final item = cityList[index];
return Container(
height: 78.h,
width: 76.w,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
child: BlocBuilder<AddItineraryDetailBloc, ItineraryDetailState>(
builder: (context, state) {
return GridView.builder(
physics: const NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
mainAxisSpacing: 16.h,
crossAxisSpacing: 16.w,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CustomText(text: item['flag'] ?? ""),
SizedBox(height: 4.h),
CustomText(
text: item['city'] ?? "",
size: 12.sp,
color: Color(0xFF364153),
itemCount: cityList.length,
itemBuilder: (context, index) {
final item = cityList[index];
final isSelected = item['city'] == state.selectedCity;
return GestureDetector(
onTap: () {
context.read<AddItineraryDetailBloc>().add(
AddCityToItinerary(item['city'] ?? ""),
);
},
child: Container(
height: 78.h,
width: 76.w,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
border: Border.all(
color: isSelected
? Color(0xFFF95F62)
: Colors.transparent,
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CustomText(text: item['flag'] ?? ""),
SizedBox(height: 4.h),
CustomText(
text: item['city'] ?? "",
size: 12.sp,
color: Color(0xFF364153),
),
],
),
),
],
),
);
},
);
},
),
),
SizedBox(height: 40.h),
CustomFilledButton(onTap: () {
context.read<ItineraryStepNavigationBloc>().add(
ItineraryStepNavigationNextEvent(),
);
}, label: "Continue", showArrow: true),
CustomFilledButton(
onTap: () {
context.read<ItineraryStepNavigationBloc>().add(
ItineraryStepNavigationNextEvent(),
);
},
label: "Continue",
showArrow: true,
),
],
),
);

View File

@@ -1,4 +1,5 @@
import 'package:citycards_customer/common_packages/custom_text.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_detail_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -8,10 +9,26 @@ class HistoricalSiteRatingView extends StatelessWidget {
HistoricalSiteRatingView({super.key});
final List<Map<String, String>> historicalRatingOption = [
{"icon": "assets/icons/hi_rate1.png", "option": "Not interested"},
{"icon": "assets/icons/hi_rate2.png", "option": "A few key sites"},
{"icon": "assets/icons/hi_rate3.png", "option": "Yes, I enjoy them!"},
{"icon": "assets/icons/hi_rate4.png", "option": "Can't miss them!"},
{
"icon": "assets/icons/hi_rate1.png",
"option": "Not interested",
"star": "",
},
{
"icon": "assets/icons/hi_rate2.png",
"option": "A few key sites",
"star": "⭐⭐",
},
{
"icon": "assets/icons/hi_rate3.png",
"option": "Yes, I enjoy them!",
"star": "⭐⭐⭐",
},
{
"icon": "assets/icons/hi_rate4.png",
"option": "Can't miss them!",
"star": "⭐⭐⭐⭐",
},
];
@override
@@ -37,9 +54,13 @@ class HistoricalSiteRatingView extends StatelessWidget {
padding: EdgeInsets.only(bottom: 12.h),
child: GestureDetector(
onTap: () {
context.read<AddItineraryDetailBloc>().add(
AddCulturalRating(item['star'] ?? ""),
);
context.read<ItineraryStepNavigationBloc>().add(
ItineraryStepNavigationNextEvent(),
);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 24.w),
@@ -47,23 +68,20 @@ class HistoricalSiteRatingView extends StatelessWidget {
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16.r),
border: Border.all(
color: Color(0xFFE5E7EB),
width: 1.1
),
border: Border.all(color: Color(0xFFE5E7EB), width: 1.1),
boxShadow: [
BoxShadow(
color: Colors.black12,
offset: Offset(1,2),
offset: Offset(1, 2),
blurRadius: 1,
)
]
),
],
),
alignment: Alignment.center,
child: Row(
children: [
Image.asset(item['icon']?? "", scale: 4,),
SizedBox(width: 16.w,),
Image.asset(item['icon'] ?? "", scale: 4),
SizedBox(width: 16.w),
CustomText(
text: item['option'] ?? "",
size: 16.sp,

View File

@@ -1,6 +1,6 @@
import 'package:citycards_customer/common_packages/custom_filled_button.dart';
import 'package:citycards_customer/common_packages/custom_text.dart';
import 'package:citycards_customer/itinerary_creation/bloc/date_selection_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_detail_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -43,11 +43,11 @@ class DateSelectionView extends StatelessWidget {
},
child: Image.asset("assets/icons/calender.png", scale: 4),
),
SizedBox(width: 16.w,),
BlocBuilder<UpdateSelectedDateBloc, SelectItineraryDateState>(
SizedBox(width: 16.w),
BlocBuilder<AddItineraryDetailBloc, ItineraryDetailState>(
builder: (context, state) {
return CustomText(
text: state.selectedDate,
text: state.selectedDate ?? "",
size: 14.sp,
color: Color(0xFF101828),
);
@@ -99,8 +99,8 @@ class DateSelectionView extends StatelessWidget {
);
if (picked != null) {
final formattedDate = DateFormat('EEEE, MMMM d, y').format(picked);
context.read<UpdateSelectedDateBloc>().add(
SelectItineraryDateEvent(formattedDate),
context.read<AddItineraryDetailBloc>().add(
AddDateToItinerary(formattedDate),
);
}
}

View File

@@ -1,6 +1,6 @@
import 'package:citycards_customer/common_packages/custom_filled_button.dart';
import 'package:citycards_customer/common_packages/custom_text.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_detail_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -51,44 +51,62 @@ class _DietarySelectionViewState extends State<DietarySelectionView> {
SizedBox(height: 38.h),
SizedBox(
height: 350.h,
child: GridView.builder(
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
mainAxisSpacing: 12,
crossAxisSpacing: 16,
crossAxisCount: 2,
childAspectRatio: 1.7,
),
itemCount: options.length,
itemBuilder: (BuildContext context, int index) {
final item = options[index];
return GestureDetector(
onTap: () {},
child: Container(
width: 168.w,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(24),
),
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(item["icon"] ?? "", scale: 4),
SizedBox(height: 8),
CustomText(
text: item["name"] ?? "",
size: 16.sp,
weight: FontWeight.w500,
color: const Color(0xFF364153),
),
],
),
),
);
},
),
child:
BlocBuilder<
AddItineraryDetailBloc,
ItineraryDetailState
>(
builder: (context, sate) {
return GridView.builder(
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
mainAxisSpacing: 12,
crossAxisSpacing: 16,
crossAxisCount: 2,
childAspectRatio: 1.7,
),
itemCount: options.length,
itemBuilder: (BuildContext context, int index) {
final item = options[index];
final isSelected = (sate.selectedDietary ?? []).contains(
item['name'],
);
return GestureDetector(
onTap: () {
context.read<AddItineraryDetailBloc>().add(
AddDietaryToItinerary(item['name'] ?? ""),
);
},
child: Container(
width: 168.w,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(24),
border: isSelected
? Border.all(color: Color(0xFFF95F62))
: Border.all(color: Colors.transparent),
),
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(item["icon"] ?? "", scale: 4),
SizedBox(height: 8),
CustomText(
text: item["name"] ?? "",
size: 16.sp,
weight: FontWeight.w500,
color: const Color(0xFF364153),
),
],
),
),
);
},
);
},
),
),
SizedBox(height: 41.h),

View File

@@ -1,5 +1,6 @@
import 'package:citycards_customer/common_packages/custom_filled_button.dart';
import 'package:citycards_customer/common_packages/custom_text.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_detail_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -31,15 +32,20 @@ class EnergySelectionView extends StatelessWidget {
),
SizedBox(height: 32.h),
...List.generate(options.length, (index) {
final item = options[index];
return Padding(
padding: EdgeInsets.only(bottom: 12.h),
child: GestureDetector(
onTap: (){
onTap: () {
context.read<AddItineraryDetailBloc>().add(
AddEnergyToItinerary(item['name'] ?? ""),
);
context.read<ItineraryStepNavigationBloc>().add(
ItineraryStepNavigationNextEvent(),
);
},
child: Container(
height: 86.h,
@@ -51,12 +57,12 @@ class EnergySelectionView extends StatelessWidget {
alignment: Alignment.center,
child: Row(
children: [
Image.asset(item['img'] ?? "",scale: 4,),
SizedBox(width: 15,),
Image.asset(item['img'] ?? "", scale: 4),
SizedBox(width: 15),
CustomText(
text: item['name'] ?? "",
size: 14.sp,
color: const Color(0xFF101828),
color: const Color(0xFF101828),
weight: FontWeight.w500,
),
],
@@ -65,7 +71,6 @@ class EnergySelectionView extends StatelessWidget {
),
);
}),
],
);
}

View File

@@ -1,4 +1,7 @@
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_detail_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:citycards_customer/common_packages/custom_text.dart';
import 'package:citycards_customer/common_packages/custom_filled_button.dart';
@@ -45,28 +48,63 @@ class ItineraryCompletionView extends StatelessWidget {
borderRadius: BorderRadius.circular(24.r),
border: Border.all(color: Color(0xFFF3F4F6), width: 1.1),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomText(
text: "Your Profile:",
size: 16.sp,
weight: FontWeight.w500,
color: const Color(0xFF364153),
child:
BlocBuilder<AddItineraryDetailBloc, ItineraryDetailState>(
builder: (context, state) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomText(
text: "Your Profile:",
size: 16.sp,
weight: FontWeight.w500,
color: const Color(0xFF364153),
),
SizedBox(height: 16.h),
_buildProfileRow(
"Visit Date",
state.selectedDate ?? "",
),
_buildProfileRow(
"City",
state.selectedCity ?? "",
),
_buildProfileRow(
"Energy",
state.selectedEnergy ?? "",
),
_buildProfileRow(
"With kids",
state.withKid ?? "",
),
_buildProfileRow(
"Dietary",
(state.selectedDietary ?? []).join(', '),
),
_buildProfileRow(
"Museums",
state.museumRating ?? "",
),
_buildProfileRow(
"Scenic",
state.scenicRating ?? "",
),
_buildProfileRow(
"Cultural",
state.culturalRating ?? "",
),
_buildProfileRow(
"Wildlife",
state.wildLifeRating ?? "",
),
_buildProfileRow(
"Shopping",
state.shoppingRating ?? "",
),
],
);
},
),
SizedBox(height: 16.h),
_buildProfileRow("Visit Date", "Oct 15, 2025"),
_buildProfileRow("City", "Tokyo"),
_buildProfileRow("Energy", "Relaxed"),
_buildProfileRow("With kids", "Yes"),
_buildProfileRow("Dietary", "Vegan"),
_buildProfileRow("Museums", ""),
_buildProfileRow("Scenic", ""),
_buildProfileRow("Cultural", "⭐⭐⭐"),
_buildProfileRow("Wildlife", "⭐⭐"),
_buildProfileRow("Shopping", "⭐⭐⭐"),
],
),
),
SizedBox(height: 32.h),
OutlinedButton(
@@ -81,7 +119,9 @@ class ItineraryCompletionView extends StatelessWidget {
minimumSize: Size(double.infinity, 42.h),
),
onPressed: () {
// Reset or restart flow
context.read<ItineraryStepNavigationBloc>().add(
ItineraryStepStartOver(),
);
},
child: CustomText(
text: "Start Over",

View File

@@ -1,5 +1,6 @@
import 'package:citycards_customer/common_packages/custom_filled_button.dart';
import 'package:citycards_customer/common_packages/custom_text.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_detail_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -34,6 +35,10 @@ class KidsSelectionView extends StatelessWidget {
padding: EdgeInsets.only(bottom: 12.h),
child: GestureDetector(
onTap: () {
context.read<AddItineraryDetailBloc>().add(
AddWithKidsToItinerary(item["option"] ?? ""),
);
context.read<ItineraryStepNavigationBloc>().add(
ItineraryStepNavigationNextEvent(),
);

View File

@@ -1,4 +1,5 @@
import 'package:citycards_customer/common_packages/custom_text.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_detail_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -8,10 +9,10 @@ class ArtGallerySelectionView extends StatelessWidget {
ArtGallerySelectionView({super.key});
final List<Map<String, String>> options = [
{"icon": "😴", "name": "Not interested"},
{"icon": "🤔", "name": "Maybe one or two"},
{"icon": "😊", "name": "Yes, sounds good!"},
{"icon": "🤩", "name": "Absolutely love them!"},
{"icon": "😴", "name": "Not interested", "star": ""},
{"icon": "🤔", "name": "Maybe one or two", "star": "⭐⭐"},
{"icon": "😊", "name": "Yes, sounds good!", "star": "⭐⭐⭐"},
{"icon": "🤩", "name": "Absolutely love them!", "star": "⭐⭐⭐⭐"},
];
@override
@@ -35,9 +36,14 @@ class ArtGallerySelectionView extends StatelessWidget {
padding: EdgeInsets.only(bottom: 12.h),
child: GestureDetector(
onTap: () {
context.read<AddItineraryDetailBloc>().add(
AddMuseumRating(item['star'] ?? ""),
);
context.read<ItineraryStepNavigationBloc>().add(
ItineraryStepNavigationNextEvent(),
);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 24.w),
@@ -55,7 +61,7 @@ class ArtGallerySelectionView extends StatelessWidget {
color: const Color(0xFF101828),
weight: FontWeight.w500,
),
SizedBox(width: 16.w,),
SizedBox(width: 16.w),
CustomText(
text: item['name'] ?? "",
size: 16.sp,

View File

@@ -1,4 +1,5 @@
import 'package:citycards_customer/common_packages/custom_text.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_detail_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -8,10 +9,10 @@ class ScenicViewpointsRatingView extends StatelessWidget {
ScenicViewpointsRatingView({super.key});
final List<Map<String, String>> options = [
{"icon": "😐", "name": "Not my thing"},
{"icon": "📸", "name": "If we have time"},
{"icon": "😍", "name": "Yes, definitely!"},
{"icon": "🌄", "name": "Must-have!"},
{"icon": "😐", "name": "Not my thing", "star": ""},
{"icon": "📸", "name": "If we have time", "star": "⭐⭐"},
{"icon": "😍", "name": "Yes, definitely!", "star": "⭐⭐⭐"},
{"icon": "🌄", "name": "Must-have!", "star": "⭐⭐⭐⭐"},
];
@override
@@ -20,7 +21,7 @@ class ScenicViewpointsRatingView extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"👋 Hello! We'd love to know more about you. Do you enjoy visiting museums and art galleries?",
"👋 Hello! We'd love to know more about you. Do you enjoy scenic viewpoints and photo spots?",
style: TextStyle(
color: Color(0xFF101828),
fontSize: 24.sp,
@@ -35,9 +36,14 @@ class ScenicViewpointsRatingView extends StatelessWidget {
padding: EdgeInsets.only(bottom: 12.h),
child: GestureDetector(
onTap: () {
context.read<AddItineraryDetailBloc>().add(
AddScenicRating(item['star'] ?? ""),
);
context.read<ItineraryStepNavigationBloc>().add(
ItineraryStepNavigationNextEvent(),
);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 24.w),
@@ -55,7 +61,7 @@ class ScenicViewpointsRatingView extends StatelessWidget {
color: const Color(0xFF101828),
weight: FontWeight.w500,
),
SizedBox(width: 16.w,),
SizedBox(width: 16.w),
CustomText(
text: item['name'] ?? "",
size: 16.sp,

View File

@@ -1,4 +1,5 @@
import 'package:citycards_customer/common_packages/custom_text.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_detail_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -8,13 +9,28 @@ class ShoppingRatingView extends StatelessWidget {
ShoppingRatingView({super.key});
final List<Map<String, String>> shoppingRatingOption = [
{"icon": "assets/icons/tr_rate1.png", "option": "Not interested"},
{"icon": "assets/icons/tr_rate2.png", "option": "Just for souvenirs"},
{"icon": "assets/icons/tr_rate3.png", "option": "Love browsing!"},
{"icon": "assets/icons/tr_rate4.png", "option": "Shopping is a must!"},
{
"icon": "assets/icons/tr_rate1.png",
"option": "Not interested",
"star": "",
},
{
"icon": "assets/icons/tr_rate2.png",
"option": "Just for souvenirs",
"star": "⭐⭐",
},
{
"icon": "assets/icons/tr_rate3.png",
"option": "Love browsing!",
"star": "⭐⭐⭐",
},
{
"icon": "assets/icons/tr_rate4.png",
"option": "Shopping is a must!",
"star": "⭐⭐⭐⭐",
},
];
@override
Widget build(BuildContext context) {
return Column(
@@ -38,33 +54,35 @@ class ShoppingRatingView extends StatelessWidget {
padding: EdgeInsets.only(bottom: 12.h),
child: GestureDetector(
onTap: () {
context.read<AddItineraryDetailBloc>().add(
AddShoppingRating(item['star'] ?? ""),
);
context.read<ItineraryStepNavigationBloc>().add(
ItineraryStepNavigationNextEvent(),
);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 24.w),
height: 82.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16.r),
border: Border.all(
color: Color(0xFFE5E7EB),
width: 1.1
color: Colors.white,
borderRadius: BorderRadius.circular(16.r),
border: Border.all(color: Color(0xFFE5E7EB), width: 1.1),
boxShadow: [
BoxShadow(
color: Colors.black12,
offset: Offset(1, 2),
blurRadius: 1,
),
boxShadow: [
BoxShadow(
color: Colors.black12,
offset: Offset(1,2),
blurRadius: 1,
)
]
],
),
alignment: Alignment.center,
child: Row(
children: [
Image.asset(item['icon']?? "", scale: 4,),
SizedBox(width: 16.w,),
Image.asset(item['icon'] ?? "", scale: 4),
SizedBox(width: 16.w),
CustomText(
text: item['option'] ?? "",
size: 16.sp,

View File

@@ -1,4 +1,5 @@
import 'package:citycards_customer/common_packages/custom_text.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_detail_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -9,10 +10,10 @@ class WildlifeRatingView extends StatelessWidget {
final List<Map<String, String>> wildlifeRatingOption = [
{"icon": "assets/icons/wi_rate1.png", "option": "No thanks"},
{"icon": "assets/icons/wi_rate2.png", "option": "If it happens naturally"},
{"icon": "assets/icons/wi_rate3.png", "option": "Yes, would be nice!"},
{"icon": "assets/icons/wi_rate4.png", "option": "Absolutely essential!"},
{"icon": "assets/icons/wi_rate1.png", "option": "No thanks", "star" :""},
{"icon": "assets/icons/wi_rate2.png", "option": "If it happens naturally", "star" :"⭐⭐"},
{"icon": "assets/icons/wi_rate3.png", "option": "Yes, would be nice!", "star" :"⭐⭐⭐"},
{"icon": "assets/icons/wi_rate4.png", "option": "Absolutely essential!", "star" :"⭐⭐⭐⭐"},
];
@override
@@ -38,9 +39,14 @@ class WildlifeRatingView extends StatelessWidget {
padding: EdgeInsets.only(bottom: 12.h),
child: GestureDetector(
onTap: () {
context.read<AddItineraryDetailBloc>().add(
AddWildLifeRating(item['star'] ?? ""),
);
context.read<ItineraryStepNavigationBloc>().add(
ItineraryStepNavigationNextEvent(),
);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 24.w),

View File

@@ -1,15 +1,14 @@
import 'package:citycards_customer/itinerary_creation/bloc/date_selection_bloc.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'itinerary_creation_steps/art_gallery_selection_view.dart';
import 'itinerary_creation_steps/museums_rating_selection_view.dart';
import 'itinerary_creation_steps/city_selection_view.dart';
import 'itinerary_creation_steps/date_selection_view.dart';
import 'itinerary_creation_steps/dietary_selection_view.dart';
import 'itinerary_creation_steps/energy_selection_view.dart';
import 'itinerary_creation_steps/historical_site_rating_view.dart';
import 'itinerary_creation_steps/cultural_landmark_rating_view.dart';
import 'itinerary_creation_steps/itinerary_completion_view.dart';
import 'itinerary_creation_steps/kids_selection_view.dart';
import 'itinerary_creation_steps/scenic_viewpoints_rating_view.dart';
@@ -29,6 +28,7 @@ class _ItineraryCreationPageState extends State<ItineraryCreationPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: Color(0xFFFFF5F5),
appBar: AppBar(
backgroundColor: Color(0xFFFFF5F5),
@@ -94,7 +94,7 @@ class _ItineraryCreationPageState extends State<ItineraryCreationPage> {
),
),
),
Expanded(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w),
@@ -102,11 +102,8 @@ class _ItineraryCreationPageState extends State<ItineraryCreationPage> {
controller: _pageController,
physics: const NeverScrollableScrollPhysics(),
children: [
BlocProvider(create: (_){
return UpdateSelectedDateBloc();
},
child: DateSelectionView(),
),
DateSelectionView(),
CitySelectionView(),
EnergySelectionView(),
KidsSelectionView(),

View File

@@ -29,7 +29,7 @@ class MyApp extends StatelessWidget {
builder: (context, child) {
return MaterialApp(
onGenerateRoute: _appRouter.onGenerateRoute,
initialRoute: RouteConstants.hotelOffer,
initialRoute: RouteConstants.profile,
debugShowCheckedModeBanner: false,
title: 'City Cards',
theme: ThemeData(

View File

@@ -0,0 +1,100 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class PostcardPage extends StatelessWidget {
const PostcardPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: SafeArea(
child: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 24.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// 🖼️ Postcard image
ClipRRect(
borderRadius: BorderRadius.circular(12),
child: Image.asset(
"assets/images/postcard_bg.png", // <-- your image
width: double.infinity,
height: 200.h,
fit: BoxFit.cover,
),
),
SizedBox(height: 32.h),
// 🌴📮💌 emojis
const Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("🌴", style: TextStyle(fontSize: 24)),
SizedBox(width: 8),
Text("📮", style: TextStyle(fontSize: 24)),
SizedBox(width: 8),
Text("💌", style: TextStyle(fontSize: 24)),
],
),
SizedBox(height: 24.h),
// 📝 Title and subtitle
Text(
"Make the most of your trip",
style: GoogleFonts.poppins(
fontSize: 20.sp,
fontWeight: FontWeight.w600,
color: const Color(0xffF95F62),
),
textAlign: TextAlign.center,
),
SizedBox(height: 8.h),
Text(
"Design your own unique postcards to\ncherish your unforgettable moments.",
style: GoogleFonts.poppins(
fontSize: 13.sp,
fontWeight: FontWeight.w400,
color: const Color(0xff464646),
height: 1.5,
),
textAlign: TextAlign.center,
),
SizedBox(height: 36.h),
// 🟥 CTA button
SizedBox(
width: double.infinity,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xffF95F62),
padding: EdgeInsets.symmetric(vertical: 16.h),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40),
),
),
onPressed: () {
// Add navigation or bloc event here
},
child: Text(
"Lets Create",
style: GoogleFonts.poppins(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w600,
),
),
),
),
],
),
),
),
);
}
}

View File

@@ -66,6 +66,7 @@ flutter:
- assets/logo/
- assets/images/
- assets/icons/
- assets/dummy/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images