diff --git a/assets/icons/booking_icon.svg b/assets/icons/booking_icon.svg new file mode 100644 index 0000000..39b3f9e --- /dev/null +++ b/assets/icons/booking_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/lib/features/app_layout/bloc/home_cubit.dart b/lib/features/app_layout/bloc/home_cubit.dart index 36e68fb..8cddafb 100644 --- a/lib/features/app_layout/bloc/home_cubit.dart +++ b/lib/features/app_layout/bloc/home_cubit.dart @@ -12,6 +12,7 @@ import 'package:syncrow_app/features/app_layout/model/space_model.dart'; import 'package:syncrow_app/features/app_layout/view/widgets/app_bar_home_dropdown.dart'; import 'package:syncrow_app/features/auth/model/project_model.dart'; import 'package:syncrow_app/features/auth/model/user_model.dart'; +import 'package:syncrow_app/features/booking_system/presentation/screens/booking_system_page.dart'; import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart'; import 'package:syncrow_app/features/devices/model/subspace_model.dart'; import 'package:syncrow_app/features/devices/view/widgets/devices_view_body.dart'; @@ -32,6 +33,7 @@ import 'package:syncrow_app/services/api/spaces_api.dart'; import 'package:syncrow_app/utils/constants/temp_const.dart'; import 'package:syncrow_app/utils/helpers/snack_bar.dart'; import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; +import 'package:syncrow_app/utils/resource_manager/font_manager.dart'; part 'home_state.dart'; class HomeCubit extends Cubit { @@ -538,6 +540,7 @@ class HomeCubit extends Cubit { // onPressed: () {}, // ), ], + 'Booking': [], 'Menu': [ // IconButton( // icon: SvgPicture.asset( @@ -554,6 +557,18 @@ class HomeCubit extends Cubit { // 'Dashboard': const AppBarHomeDropdown(), 'Devices': const AppBarHomeDropdown(), 'Automation': const AppBarHomeDropdown(), + 'Booking': Padding( + padding: const EdgeInsets.only(left: 15), + child: Text( + 'Booking', + style: TextStyle( + color: ColorsManager.textPrimaryColor, + fontSize: 26, + fontFamily: FontsManager.fontFamily, + fontWeight: FontWeight.w700, + ), + ), + ), 'Menu': Padding( padding: const EdgeInsets.only(left: 15), child: Image.asset( @@ -571,6 +586,7 @@ class HomeCubit extends Cubit { defaultBottomNavBarItem(icon: Assets.assetsIconsDevices, label: 'Devices'), defaultBottomNavBarItem( icon: Assets.assetsIconsRoutines, label: 'Automation'), + defaultBottomNavBarItem(icon: Assets.bookingIcon, label: 'Booking'), defaultBottomNavBarItem(icon: Assets.assetsIconsMenu, label: 'Menu'), ]; @@ -582,6 +598,7 @@ class HomeCubit extends Cubit { child: const DevicesViewBody(), ), const RoutinesView(), + const BookingSystemPage(), const MenuView(), ]; diff --git a/lib/features/booking_system/presentation/screens/booking_system_page.dart b/lib/features/booking_system/presentation/screens/booking_system_page.dart index d4dbe26..2fbc276 100644 --- a/lib/features/booking_system/presentation/screens/booking_system_page.dart +++ b/lib/features/booking_system/presentation/screens/booking_system_page.dart @@ -3,9 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart'; import 'package:syncrow_app/features/booking_system/data/booking_dummy_source.dart'; import 'package:syncrow_app/features/booking_system/presentation/blocs/upcoming_bookings_bloc/upcoming_bookings_bloc.dart'; -import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; import '../blocs/past_bookings_bloc/past_bookings_bloc.dart'; -import '../widgets/booking_appbar_widget.dart'; import '../widgets/current_balance_widget.dart'; import '../widgets/past_booking_widget.dart'; import '../widgets/upcoming_bookings_widget.dart'; @@ -26,41 +24,35 @@ class BookingSystemPage extends StatelessWidget { ..add(GetPastBookingsEvent()), ) ], - child: DefaultScaffold( - appBar: BookingAppBar(), - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 20, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 2, + child: CurrentBalanceWidget( + userBalance: HomeCubit.user!.points == null + ? '0' + : HomeCubit.user!.points.toString(), ), - Expanded( - flex: 2, - child: CurrentBalanceWidget( - userBalance: HomeCubit.user!.points == null - ? '0' - : HomeCubit.user!.points.toString(), - ), + ), + SizedBox( + height: 20, + ), + Expanded( + flex: 8, + child: Column( + children: [ + UpcomingBookingsWidget(), + SizedBox( + height: 10, + ), + PastBookingsWidget(), + ], ), - SizedBox( - height: 20, - ), - Expanded( - flex: 8, - child: Column( - children: [ - UpcomingBookingsWidget(), - SizedBox( - height: 10, - ), - PastBookingsWidget(), - ], - ), - ) - ], - ), + ) + ], ), )); } diff --git a/lib/features/booking_system/presentation/widgets/booking_appbar_widget.dart b/lib/features/booking_system/presentation/widgets/booking_appbar_widget.dart index 7b8632e..679f535 100644 --- a/lib/features/booking_system/presentation/widgets/booking_appbar_widget.dart +++ b/lib/features/booking_system/presentation/widgets/booking_appbar_widget.dart @@ -10,10 +10,7 @@ class BookingAppBar extends StatelessWidget implements PreferredSizeWidget { return AppBar( backgroundColor: Colors.transparent, centerTitle: true, - leading: IconButton( - onPressed: () => Navigator.pop(context), - icon: Icon(Icons.arrow_back_ios_new)), - title: Text( + leading: Text( 'Booking', style: TextStyle( color: ColorsManager.blueColor1, diff --git a/lib/features/booking_system/presentation/widgets/past_booking_widget.dart b/lib/features/booking_system/presentation/widgets/past_booking_widget.dart index dd13aa0..ab81974 100644 --- a/lib/features/booking_system/presentation/widgets/past_booking_widget.dart +++ b/lib/features/booking_system/presentation/widgets/past_booking_widget.dart @@ -39,7 +39,7 @@ class PastBookingsWidget extends StatelessWidget { ); } else if (state is PastBookingLoadedState) { return SizedBox( - height: deviceHeight(context) * 0.3, + height: deviceHeight(context) * 0.22, child: state.pastBookings.isEmpty ? Text('You Dont Have past Bookings') : ListView.separated( diff --git a/lib/features/menu/bloc/menu_cubit.dart b/lib/features/menu/bloc/menu_cubit.dart index dbbced2..a920807 100644 --- a/lib/features/menu/bloc/menu_cubit.dart +++ b/lib/features/menu/bloc/menu_cubit.dart @@ -45,18 +45,6 @@ class MenuCubit extends Cubit { } List> menuSections = [ -//Booking System - { - 'title': 'Booking System', - 'color': const Color(0xFF8AB9FF), - 'buttons': [ - { - 'title': 'Booking', - 'Icon': Assets.assetsIconsMenuBookingSystem, - 'page': BookingSystemPage() - }, - ], - }, //Home Management { 'title': 'Home Management', diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart index 614ebe6..8276071 100644 --- a/lib/generated/assets.dart +++ b/lib/generated/assets.dart @@ -1129,6 +1129,7 @@ class Assets { static const String verificationIcon = "assets/icons/verification_icon.svg"; static const String deleteAccountIcon='assets/icons/delete_account_icon.svg'; +static const String bookingIcon='assets/icons/booking_icon.svg'; static const String passwordUnvisibility = "assets/icons/password_unvisibility.svg"; static const String passwordVisibility =