mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-08-26 07:29:40 +00:00
the Book Page is Ready now but not linked with any logic
This commit is contained in:
@ -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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -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';
|
||||
|
@ -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),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
@ -29,10 +29,8 @@ class PastBookingsWidget extends StatelessWidget {
|
||||
BlocBuilder<PastBookingsBloc, PastBookingsState>(
|
||||
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<PastBookingsBloc>()
|
||||
|
@ -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,
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -28,10 +28,10 @@ class UpcomingBookingsWidget extends StatelessWidget {
|
||||
BlocBuilder<UpcomingBookingsBloc, UpcomingBookingsState>(
|
||||
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<UpcomingBookingsBloc>()
|
||||
|
Reference in New Issue
Block a user