mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00
make the UI and link it with its blocs
This commit is contained in:
@ -0,0 +1,32 @@
|
|||||||
|
import 'package:bloc/bloc.dart';
|
||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
|
||||||
|
import '../../../domain/booking_model.dart';
|
||||||
|
import '../../../domain/booking_service.dart';
|
||||||
|
|
||||||
|
part 'past_bookings_event.dart';
|
||||||
|
part 'past_bookings_state.dart';
|
||||||
|
|
||||||
|
class PastBookingsBloc extends Bloc<PastBookingsEvent, PastBookingsState> {
|
||||||
|
final BookingService _bookingService;
|
||||||
|
|
||||||
|
PastBookingsBloc(this._bookingService) : super(PastBookingsInitial()) {
|
||||||
|
on<GetPastBookingsEvent>(_onGetPastBookingsEvent);
|
||||||
|
}
|
||||||
|
_onGetPastBookingsEvent(
|
||||||
|
GetPastBookingsEvent event,
|
||||||
|
Emitter<PastBookingsState> emit,
|
||||||
|
) async {
|
||||||
|
emit(PastBookingLoadingState());
|
||||||
|
try {
|
||||||
|
final pastBookings = await _bookingService.get();
|
||||||
|
emit(
|
||||||
|
PastBookingLoadedState(pastBookings: pastBookings),
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
emit(
|
||||||
|
PastBookingErrorState(e.toString()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
part of 'past_bookings_bloc.dart';
|
||||||
|
|
||||||
|
sealed class PastBookingsEvent extends Equatable {
|
||||||
|
const PastBookingsEvent();
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
class GetPastBookingsEvent extends PastBookingsEvent {}
|
@ -0,0 +1,24 @@
|
|||||||
|
part of 'past_bookings_bloc.dart';
|
||||||
|
|
||||||
|
sealed class PastBookingsState extends Equatable {
|
||||||
|
const PastBookingsState();
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
final class PastBookingsInitial extends PastBookingsState {}
|
||||||
|
|
||||||
|
final class PastBookingLoadingState extends PastBookingsState {}
|
||||||
|
|
||||||
|
final class PastBookingLoadedState extends PastBookingsState {
|
||||||
|
final List<BookingModel> pastBookings;
|
||||||
|
const PastBookingLoadedState({
|
||||||
|
required this.pastBookings,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
final class PastBookingErrorState extends PastBookingsState {
|
||||||
|
final String errorMsg;
|
||||||
|
const PastBookingErrorState(this.errorMsg);
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:syncrow_app/features/booking_system/domain/booking_model.dart';
|
||||||
|
import 'package:syncrow_app/features/booking_system/domain/booking_service.dart';
|
||||||
|
|
||||||
|
part 'upcoming_bookings_event.dart';
|
||||||
|
part 'upcoming_bookings_state.dart';
|
||||||
|
|
||||||
|
class UpcomingBookingsBloc
|
||||||
|
extends Bloc<GetUpcomingBookingsEvent, UpcomingBookingsState> {
|
||||||
|
final BookingService _bookingService;
|
||||||
|
UpcomingBookingsBloc(this._bookingService)
|
||||||
|
: super(UpcomingBookingsInitial()) {
|
||||||
|
on<GetUpcomingBookingsEvent>(_onGetUpcomingBookingsEvent);
|
||||||
|
}
|
||||||
|
_onGetUpcomingBookingsEvent(
|
||||||
|
GetUpcomingBookingsEvent event,
|
||||||
|
Emitter<UpcomingBookingsState> emit,
|
||||||
|
) async {
|
||||||
|
emit(UpcomingBookingLoadingState());
|
||||||
|
try {
|
||||||
|
final upcomingBookings = await _bookingService.get();
|
||||||
|
emit(
|
||||||
|
UpcomingBookingLoadedState(upcomingBookings: upcomingBookings),
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
emit(
|
||||||
|
UpcomingBookingErrorState(e.toString()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
part of 'upcoming_bookings_bloc.dart';
|
||||||
|
|
||||||
|
sealed class UpcomingBookingsEvent extends Equatable {
|
||||||
|
const UpcomingBookingsEvent();
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
class GetUpcomingBookingsEvent extends UpcomingBookingsEvent {}
|
@ -0,0 +1,24 @@
|
|||||||
|
part of 'upcoming_bookings_bloc.dart';
|
||||||
|
|
||||||
|
sealed class UpcomingBookingsState extends Equatable {
|
||||||
|
const UpcomingBookingsState();
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
final class UpcomingBookingsInitial extends UpcomingBookingsState {}
|
||||||
|
|
||||||
|
final class UpcomingBookingLoadingState extends UpcomingBookingsState {}
|
||||||
|
|
||||||
|
final class UpcomingBookingLoadedState extends UpcomingBookingsState {
|
||||||
|
final List<BookingModel> upcomingBookings;
|
||||||
|
const UpcomingBookingLoadedState({
|
||||||
|
required this.upcomingBookings,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
final class UpcomingBookingErrorState extends UpcomingBookingsState {
|
||||||
|
final String errorMsg;
|
||||||
|
const UpcomingBookingErrorState(this.errorMsg);
|
||||||
|
}
|
@ -1,57 +1,71 @@
|
|||||||
import 'package:flutter/material.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/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/features/shared_widgets/default_scaffold.dart';
|
||||||
import 'package:syncrow_app/utils/helpers/app_size.dart';
|
import 'package:syncrow_app/utils/helpers/app_size.dart';
|
||||||
import 'package:syncrow_app/utils/resource_manager/color_manager.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/booking_appbar_widget.dart';
|
||||||
import '../widgets/current_balance_widget.dart';
|
import '../widgets/current_balance_widget.dart';
|
||||||
|
import '../widgets/past_booking_widget.dart';
|
||||||
|
import '../widgets/upcoming_bookings_widget.dart';
|
||||||
|
|
||||||
class BookingSystemPage extends StatelessWidget {
|
class BookingSystemPage extends StatelessWidget {
|
||||||
const BookingSystemPage({super.key});
|
const BookingSystemPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return DefaultScaffold(
|
return MultiBlocProvider(
|
||||||
appBar: BookingAppBar(),
|
providers: [
|
||||||
child: Padding(
|
BlocProvider<UpcomingBookingsBloc>(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
create: (_) => UpcomingBookingsBloc(BookingDummySource())
|
||||||
child: Column(
|
..add(GetUpcomingBookingsEvent()),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
),
|
||||||
children: [
|
BlocProvider<PastBookingsBloc>(
|
||||||
SizedBox(
|
create: (_) => PastBookingsBloc(BookingDummySource())
|
||||||
height: 20,
|
..add(GetPastBookingsEvent()),
|
||||||
),
|
)
|
||||||
Expanded(
|
],
|
||||||
child: CurrentBalanceWidget(
|
child: DefaultScaffold(
|
||||||
userBalance: HomeCubit.user!.points == null
|
appBar: BookingAppBar(),
|
||||||
? '0'
|
child: Padding(
|
||||||
: HomeCubit.user!.points.toString(),
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
),
|
child: Column(
|
||||||
),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
SizedBox(
|
children: [
|
||||||
height: 10,
|
SizedBox(
|
||||||
),
|
height: 20,
|
||||||
Expanded(
|
|
||||||
child: UpcomingBookingsWidget(),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Expanded(child: Container()
|
|
||||||
// PastBookingsWidget(),
|
|
||||||
),
|
),
|
||||||
],
|
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();
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,105 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../../utils/resource_manager/color_manager.dart';
|
||||||
|
import '../../domain/booking_model.dart';
|
||||||
|
|
||||||
|
class BookingCardWidget extends StatelessWidget {
|
||||||
|
const BookingCardWidget({
|
||||||
|
super.key,
|
||||||
|
required this.bookingModel,
|
||||||
|
});
|
||||||
|
|
||||||
|
final BookingModel bookingModel;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.all(15),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||||
|
color: ColorsManager.onPrimaryColor,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
bookingModel.roomName,
|
||||||
|
style: TextStyle(
|
||||||
|
color: ColorsManager.blackColor,
|
||||||
|
fontSize: 17,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Booking Date',
|
||||||
|
style: TextStyle(
|
||||||
|
color: ColorsManager.grayColor,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
bookingModel.date,
|
||||||
|
style: TextStyle(
|
||||||
|
color: ColorsManager.blackColor,
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Time slot',
|
||||||
|
style: TextStyle(
|
||||||
|
color: ColorsManager.grayColor,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
bookingModel.timeSlot,
|
||||||
|
style: TextStyle(
|
||||||
|
color: ColorsManager.blackColor,
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 80,
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'cost',
|
||||||
|
style: TextStyle(
|
||||||
|
color: ColorsManager.grayColor,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
bookingModel.cost.toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: ColorsManager.blackColor,
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -21,7 +21,7 @@ class CurrentBalanceWidget extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 7,
|
flex: 75,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(12),
|
padding: EdgeInsets.all(12),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -31,6 +31,7 @@ class CurrentBalanceWidget extends StatelessWidget {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'Current Balance',
|
'Current Balance',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
color: ColorsManager.blackColor,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 17,
|
fontSize: 17,
|
||||||
),
|
),
|
||||||
@ -40,6 +41,7 @@ class CurrentBalanceWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
@ -47,7 +49,7 @@ class CurrentBalanceWidget extends StatelessWidget {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: ColorsManager.blueColor1,
|
color: ColorsManager.blueColor1,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 25),
|
fontSize: 50),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 5,
|
width: 5,
|
||||||
@ -65,7 +67,7 @@ class CurrentBalanceWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 3,
|
flex: 25,
|
||||||
child: Container(
|
child: Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
padding: EdgeInsets.only(left: 15),
|
padding: EdgeInsets.only(left: 15),
|
||||||
|
@ -0,0 +1,66 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
|
import '../../../../utils/helpers/app_size.dart';
|
||||||
|
import '../../../../utils/resource_manager/color_manager.dart';
|
||||||
|
import '../../../shared_widgets/default_button.dart';
|
||||||
|
import '../blocs/past_bookings_bloc/past_bookings_bloc.dart';
|
||||||
|
import 'booking_card_widget.dart';
|
||||||
|
|
||||||
|
class PastBookingsWidget extends StatelessWidget {
|
||||||
|
const PastBookingsWidget({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Past Bookings',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: ColorsManager.grayColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
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>()
|
||||||
|
.add(GetPastBookingsEvent()),
|
||||||
|
child: Text('Try again'),
|
||||||
|
);
|
||||||
|
} else if (state is PastBookingLoadedState) {
|
||||||
|
return SizedBox(
|
||||||
|
height: deviceHeight(context) * 0.3,
|
||||||
|
child: state.pastBookings.isEmpty
|
||||||
|
? Text('You Dont Have past Bookings')
|
||||||
|
: ListView.separated(
|
||||||
|
separatorBuilder: (context, index) => SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
itemCount: state.pastBookings.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final pastBooking = state.pastBookings[index];
|
||||||
|
return BookingCardWidget(bookingModel: pastBooking);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return SizedBox();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import '../../../../utils/helpers/app_size.dart';
|
||||||
|
import '../../../../utils/resource_manager/color_manager.dart';
|
||||||
|
import '../../../shared_widgets/default_button.dart';
|
||||||
|
import '../blocs/upcoming_bookings_bloc/upcoming_bookings_bloc.dart';
|
||||||
|
import 'booking_card_widget.dart';
|
||||||
|
|
||||||
|
class UpcomingBookingsWidget extends StatelessWidget {
|
||||||
|
const UpcomingBookingsWidget({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Upcoming Bookings',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: ColorsManager.grayColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
BlocBuilder<UpcomingBookingsBloc, UpcomingBookingsState>(
|
||||||
|
builder: (context, state) {
|
||||||
|
if (state is UpcomingBookingLoadingState) {
|
||||||
|
//should use CustomLoadingWidget
|
||||||
|
return CircularProgressIndicator();
|
||||||
|
} else if (state is UpcomingBookingErrorState) {
|
||||||
|
//shold use CustomErrorWidget
|
||||||
|
return DefaultButton(
|
||||||
|
onPressed: () => context
|
||||||
|
.read<UpcomingBookingsBloc>()
|
||||||
|
.add(GetUpcomingBookingsEvent()),
|
||||||
|
child: Text('Try again'),
|
||||||
|
);
|
||||||
|
} else if (state is UpcomingBookingLoadedState) {
|
||||||
|
return SizedBox(
|
||||||
|
height: deviceHeight(context) * 0.3,
|
||||||
|
child: state.upcomingBookings.isEmpty
|
||||||
|
? Text('You Dont Have Upcoming Bookings')
|
||||||
|
: ListView.separated(
|
||||||
|
separatorBuilder: (context, index) => SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
itemCount: state.upcomingBookings.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final upcomingBooking = state.upcomingBookings[index];
|
||||||
|
return BookingCardWidget(
|
||||||
|
bookingModel: upcomingBooking);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return SizedBox();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user