forked from eatvio/eatvio_app
feat(blackList): Issue-523
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import 'package:eatvio_app/core/locator_service.dart';
|
||||
import 'package:eatvio_app/features/menu/presentation/blocked_user_cubit/blocked_users_cubit.dart';
|
||||
import 'package:eatvio_app/features/menu/presentation/blocked_user_cubit/blocked_users_state.dart';
|
||||
import 'package:eatvio_app/features/menu/presentation/widgets/blocked_user_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
class BlockedUsersScreen extends StatefulWidget {
|
||||
const BlockedUsersScreen({super.key});
|
||||
|
||||
@override
|
||||
State<BlockedUsersScreen> createState() => _BlockedUsersScreenState();
|
||||
}
|
||||
|
||||
class _BlockedUsersScreenState extends State<BlockedUsersScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider<BlockedUsersCubit>(
|
||||
create: (BuildContext context) => sl<BlockedUsersCubit>()..getBlockedUsers(),
|
||||
child: BlocBuilder<BlockedUsersCubit, BlockedUsersState>(
|
||||
builder: (BuildContext context, BlockedUsersState state) {
|
||||
if (state is BlockedUsersStateLoaded) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Чёрный список'),
|
||||
),
|
||||
body: ListView.builder(
|
||||
itemBuilder: (context, index) => BlockedUserWidget(profile: state.profilesList[index]),
|
||||
itemCount: state.profilesList.length,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -53,6 +53,8 @@ class MenuScreen extends StatelessWidget {
|
||||
_tile(leading: ImageConstant.icnGlossary, title: 'Глоссарий', onTap: () => GoRouter.of(context).push('/glossary-screen')),
|
||||
_divider(context),
|
||||
_tile(leading: ImageConstant.icnSupport, title: 'Поддержка', onTap: () => GoRouter.of(context).push('/support-screen')),
|
||||
_divider(context),
|
||||
_tile(leading: 'assets/icons/blocked_users.svg', title: 'Чёрный список', onTap: () => GoRouter.of(context).pushNamed('blockedUsersScreen')),
|
||||
// _divider(context),
|
||||
// _tile(
|
||||
// leading: ImageConstant.icnDevTools,
|
||||
|
||||
Reference in New Issue
Block a user