mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-08-26 07:49:40 +00:00
make the UI and link it with its blocs
This commit is contained in:
@ -1,57 +1,71 @@
|
||||
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 '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';
|
||||
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 DefaultScaffold(
|
||||
appBar: BookingAppBar(),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Expanded(
|
||||
child: CurrentBalanceWidget(
|
||||
userBalance: HomeCubit.user!.points == null
|
||||
? '0'
|
||||
: HomeCubit.user!.points.toString(),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: UpcomingBookingsWidget(),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Expanded(child: Container()
|
||||
// PastBookingsWidget(),
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider<UpcomingBookingsBloc>(
|
||||
create: (_) => UpcomingBookingsBloc(BookingDummySource())
|
||||
..add(GetUpcomingBookingsEvent()),
|
||||
),
|
||||
BlocProvider<PastBookingsBloc>(
|
||||
create: (_) => PastBookingsBloc(BookingDummySource())
|
||||
..add(GetPastBookingsEvent()),
|
||||
)
|
||||
],
|
||||
child: DefaultScaffold(
|
||||
appBar: BookingAppBar(),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
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(),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
class UpcomingBookingsWidget extends StatelessWidget {
|
||||
const UpcomingBookingsWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Placeholder();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user