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/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/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/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/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 '../blocs/past_bookings_bloc/past_bookings_bloc.dart';
|
||||||
import '../widgets/booking_appbar_widget.dart';
|
import '../widgets/booking_appbar_widget.dart';
|
||||||
import '../widgets/current_balance_widget.dart';
|
import '../widgets/current_balance_widget.dart';
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../../../../utils/resource_manager/color_manager.dart';
|
import '../../../../utils/resource_manager/color_manager.dart';
|
||||||
|
import '../screens/book_page.dart';
|
||||||
|
|
||||||
class CurrentBalanceWidget extends StatelessWidget {
|
class CurrentBalanceWidget extends StatelessWidget {
|
||||||
final String? userBalance;
|
final String? userBalance;
|
||||||
@ -17,7 +18,6 @@ class CurrentBalanceWidget extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(20),
|
Radius.circular(20),
|
||||||
)),
|
)),
|
||||||
// height: deviceHeight(context) * 0.3,
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -68,21 +68,27 @@ class CurrentBalanceWidget extends StatelessWidget {
|
|||||||
)),
|
)),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 25,
|
flex: 25,
|
||||||
child: Container(
|
child: InkWell(
|
||||||
alignment: Alignment.center,
|
//TODO:should use custom Navigator
|
||||||
padding: EdgeInsets.only(left: 15),
|
onTap: () => Navigator.of(context).push(MaterialPageRoute(
|
||||||
height: double.infinity,
|
builder: (context) => BookPage(),
|
||||||
decoration: BoxDecoration(
|
)),
|
||||||
color: ColorsManager.blueColor,
|
child: Container(
|
||||||
borderRadius:
|
alignment: Alignment.center,
|
||||||
BorderRadius.horizontal(right: Radius.circular(20)),
|
padding: EdgeInsets.only(left: 15),
|
||||||
),
|
height: double.infinity,
|
||||||
child: Text(
|
decoration: BoxDecoration(
|
||||||
'Book Now',
|
color: ColorsManager.blueColor,
|
||||||
style: TextStyle(
|
borderRadius:
|
||||||
color: ColorsManager.onPrimaryColor,
|
BorderRadius.horizontal(right: Radius.circular(20)),
|
||||||
fontWeight: FontWeight.bold,
|
),
|
||||||
fontSize: 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>(
|
BlocBuilder<PastBookingsBloc, PastBookingsState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state is PastBookingLoadingState) {
|
if (state is PastBookingLoadingState) {
|
||||||
//should use CustomLoadingWidget
|
|
||||||
return CircularProgressIndicator();
|
return CircularProgressIndicator();
|
||||||
} else if (state is PastBookingErrorState) {
|
} else if (state is PastBookingErrorState) {
|
||||||
//shold use CustomErrorWidget
|
|
||||||
return DefaultButton(
|
return DefaultButton(
|
||||||
onPressed: () => context
|
onPressed: () => context
|
||||||
.read<PastBookingsBloc>()
|
.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>(
|
BlocBuilder<UpcomingBookingsBloc, UpcomingBookingsState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state is UpcomingBookingLoadingState) {
|
if (state is UpcomingBookingLoadingState) {
|
||||||
//should use CustomLoadingWidget
|
//TODO:should use CustomLoadingWidget
|
||||||
return CircularProgressIndicator();
|
return CircularProgressIndicator();
|
||||||
} else if (state is UpcomingBookingErrorState) {
|
} else if (state is UpcomingBookingErrorState) {
|
||||||
//shold use CustomErrorWidget
|
//TODO:shold use CustomErrorWidget
|
||||||
return DefaultButton(
|
return DefaultButton(
|
||||||
onPressed: () => context
|
onPressed: () => context
|
||||||
.read<UpcomingBookingsBloc>()
|
.read<UpcomingBookingsBloc>()
|
||||||
|
Reference in New Issue
Block a user