Implemented bloc in itinerary creation screen
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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';
|
||||
@@ -32,9 +32,7 @@ class AppRouter {
|
||||
},
|
||||
);
|
||||
case RouteConstants.attractionsPage:
|
||||
return MaterialPageRoute(
|
||||
builder: (_) => const AttractionsPage(),
|
||||
);
|
||||
return MaterialPageRoute(builder: (_) => const AttractionsPage());
|
||||
case RouteConstants.profile:
|
||||
return MaterialPageRoute(
|
||||
builder: (_) {
|
||||
@@ -87,12 +85,13 @@ class AppRouter {
|
||||
builder: (_) {
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider<UpdateSelectedDateBloc>(
|
||||
create: (_) => UpdateSelectedDateBloc(),
|
||||
),
|
||||
BlocProvider<ItineraryStepNavigationBloc>(
|
||||
create: (_) => ItineraryStepNavigationBloc(),
|
||||
),
|
||||
|
||||
BlocProvider<AddItineraryDetailBloc>(
|
||||
create: (_) => AddItineraryDetailBloc(),
|
||||
),
|
||||
],
|
||||
child: const ItineraryCreationPage(),
|
||||
);
|
||||
@@ -100,10 +99,11 @@ class AppRouter {
|
||||
);
|
||||
|
||||
case RouteConstants.hotelOffer:
|
||||
return MaterialPageRoute(builder: (_){
|
||||
return HotelOfferView();
|
||||
});
|
||||
|
||||
return MaterialPageRoute(
|
||||
builder: (_) {
|
||||
return HotelOfferView();
|
||||
},
|
||||
);
|
||||
|
||||
case RouteConstants.esimOffer:
|
||||
return MaterialPageRoute(
|
||||
|
||||
@@ -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});
|
||||
|
||||
@@ -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));
|
||||
});
|
||||
}
|
||||
}
|
||||
183
lib/itinerary_creation/bloc/itinerary_detail_bloc.dart
Normal file
183
lib/itinerary_creation/bloc/itinerary_detail_bloc.dart
Normal 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));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
@@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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 {
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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(),
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user