mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-08-25 15:59:39 +00:00
60 lines
2.0 KiB
Dart
60 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
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 '../blocs/past_bookings_bloc/past_bookings_bloc.dart';
|
|
import '../widgets/current_balance_widget.dart';
|
|
import '../widgets/past_booking_widget.dart';
|
|
import '../widgets/upcoming_bookings_widget.dart';
|
|
|
|
class BookingSystemPage extends StatelessWidget {
|
|
const BookingSystemPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MultiBlocProvider(
|
|
providers: [
|
|
BlocProvider<UpcomingBookingsBloc>(
|
|
create: (_) => UpcomingBookingsBloc(BookingDummySource())
|
|
..add(GetUpcomingBookingsEvent()),
|
|
),
|
|
BlocProvider<PastBookingsBloc>(
|
|
create: (_) => PastBookingsBloc(BookingDummySource())
|
|
..add(GetPastBookingsEvent()),
|
|
)
|
|
],
|
|
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(),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 20,
|
|
),
|
|
Expanded(
|
|
flex: 8,
|
|
child: Column(
|
|
children: [
|
|
UpcomingBookingsWidget(),
|
|
SizedBox(
|
|
height: 10,
|
|
),
|
|
PastBookingsWidget(),
|
|
],
|
|
),
|
|
)
|
|
],
|
|
),
|
|
));
|
|
}
|
|
}
|