diff --git a/lib/features/booking_system/presentation/screens/book_page.dart b/lib/features/booking_system/presentation/screens/book_page.dart new file mode 100644 index 0000000..e3a8ac8 --- /dev/null +++ b/lib/features/booking_system/presentation/screens/book_page.dart @@ -0,0 +1,89 @@ +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/booking_system/presentation/widgets/booking_appbar_widget.dart'; +import 'package:syncrow_app/features/shared_widgets/default_button.dart'; +import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; +import 'package:syncrow_app/utils/helpers/app_size.dart'; + +import '../../../../utils/resource_manager/color_manager.dart'; +import '../widgets/row_of_title_arrow_widget.dart'; + +class BookPage extends StatelessWidget { + const BookPage({super.key}); + + @override + Widget build(BuildContext context) { + return DefaultScaffold( + padding: EdgeInsets.all(0), + appBar: BookingAppBar(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 10), + child: Text( + 'Booking Details', + style: TextStyle( + fontSize: 15, + color: ColorsManager.grayColor, + fontWeight: FontWeight.bold, + ), + ), + ), + SizedBox( + height: 5, + ), + Container( + padding: EdgeInsets.all(10), + height: deviceHeight(context) * 0.25, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20)), + color: ColorsManager.onPrimaryColor, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RowOfTitleAndArrowWidget( + title: 'Space', + onTap: () {}, + ), + Divider( + color: ColorsManager.grayButtonColors, + ), + RowOfTitleAndArrowWidget( + title: 'Booking Date', + onTap: () {}, + ), + Divider( + color: ColorsManager.grayButtonColors, + ), + RowOfTitleAndArrowWidget( + title: 'Time Slot', + onTap: () {}, + ) + ], + ), + ), + SizedBox( + height: 30, + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 10), + child: DefaultButton( + backgroundColor: ColorsManager.blueColor1, + child: Text( + 'Book Now', + style: TextStyle( + fontSize: 17, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ], + ), + ); + } +} 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 71f4065..d4dbe26 100644 --- a/lib/features/booking_system/presentation/screens/booking_system_page.dart +++ b/lib/features/booking_system/presentation/screens/booking_system_page.dart @@ -3,11 +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_button.dart'; import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; -import 'package:syncrow_app/utils/helpers/app_size.dart'; -import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; - import '../blocs/past_bookings_bloc/past_bookings_bloc.dart'; import '../widgets/booking_appbar_widget.dart'; import '../widgets/current_balance_widget.dart'; diff --git a/lib/features/booking_system/presentation/widgets/current_balance_widget.dart b/lib/features/booking_system/presentation/widgets/current_balance_widget.dart index 24759db..37e9305 100644 --- a/lib/features/booking_system/presentation/widgets/current_balance_widget.dart +++ b/lib/features/booking_system/presentation/widgets/current_balance_widget.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import '../../../../utils/resource_manager/color_manager.dart'; +import '../screens/book_page.dart'; class CurrentBalanceWidget extends StatelessWidget { final String? userBalance; @@ -17,7 +18,6 @@ class CurrentBalanceWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(20), )), - // height: deviceHeight(context) * 0.3, child: Row( children: [ Expanded( @@ -68,21 +68,27 @@ class CurrentBalanceWidget extends StatelessWidget { )), Expanded( flex: 25, - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.only(left: 15), - height: double.infinity, - decoration: BoxDecoration( - color: ColorsManager.blueColor, - borderRadius: - BorderRadius.horizontal(right: Radius.circular(20)), - ), - child: Text( - 'Book Now', - style: TextStyle( - color: ColorsManager.onPrimaryColor, - fontWeight: FontWeight.bold, - fontSize: 20), + child: InkWell( + //TODO:should use custom Navigator + onTap: () => Navigator.of(context).push(MaterialPageRoute( + builder: (context) => BookPage(), + )), + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.only(left: 15), + height: double.infinity, + decoration: BoxDecoration( + color: ColorsManager.blueColor, + borderRadius: + BorderRadius.horizontal(right: Radius.circular(20)), + ), + child: Text( + 'Book Now', + style: TextStyle( + color: ColorsManager.onPrimaryColor, + fontWeight: FontWeight.bold, + fontSize: 20), + ), ), ), ) 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 4b8eeae..dd13aa0 100644 --- a/lib/features/booking_system/presentation/widgets/past_booking_widget.dart +++ b/lib/features/booking_system/presentation/widgets/past_booking_widget.dart @@ -29,10 +29,8 @@ class PastBookingsWidget extends StatelessWidget { BlocBuilder( builder: (context, state) { if (state is PastBookingLoadingState) { - //should use CustomLoadingWidget return CircularProgressIndicator(); } else if (state is PastBookingErrorState) { -//shold use CustomErrorWidget return DefaultButton( onPressed: () => context .read() diff --git a/lib/features/booking_system/presentation/widgets/row_of_title_arrow_widget.dart b/lib/features/booking_system/presentation/widgets/row_of_title_arrow_widget.dart new file mode 100644 index 0000000..29ba474 --- /dev/null +++ b/lib/features/booking_system/presentation/widgets/row_of_title_arrow_widget.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; + +import '../../../../utils/resource_manager/color_manager.dart'; + +class RowOfTitleAndArrowWidget extends StatelessWidget { + final String title; + final void Function() onTap; + const RowOfTitleAndArrowWidget({ + super.key, + required this.title, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: Text( + title, + style: TextStyle( + fontSize: 17, + fontWeight: FontWeight.bold, + ), + ), + ), + IconButton( + onPressed: onTap, + icon: Icon( + Icons.arrow_forward_ios, + color: ColorsManager.grayColor, + size: 15, + ), + ) + ], + ); + } +} diff --git a/lib/features/booking_system/presentation/widgets/upcoming_bookings_widget.dart b/lib/features/booking_system/presentation/widgets/upcoming_bookings_widget.dart index 0d697a6..883f972 100644 --- a/lib/features/booking_system/presentation/widgets/upcoming_bookings_widget.dart +++ b/lib/features/booking_system/presentation/widgets/upcoming_bookings_widget.dart @@ -28,10 +28,10 @@ class UpcomingBookingsWidget extends StatelessWidget { BlocBuilder( builder: (context, state) { if (state is UpcomingBookingLoadingState) { - //should use CustomLoadingWidget + //TODO:should use CustomLoadingWidget return CircularProgressIndicator(); } else if (state is UpcomingBookingErrorState) { -//shold use CustomErrorWidget +//TODO:shold use CustomErrorWidget return DefaultButton( onPressed: () => context .read()