Files
eatvio_app/lib/features/notifications/presentation/notifications_screen.dart
2025-04-24 04:20:24 +07:00

35 lines
1.3 KiB
Dart

import 'package:eatvio_app/features/notifications/presentation/notifications_cubit/notifications_cubit.dart';
import 'package:eatvio_app/features/notifications/presentation/notifications_cubit/notifications_state.dart';
import 'package:eatvio_app/features/notifications/presentation/widgets/notification_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class NotificationsScreen extends StatelessWidget {
const NotificationsScreen({super.key});
@override
Widget build(BuildContext context) {
return BlocBuilder<NotificationsCubit, NotificationsState>(
builder: (BuildContext context, NotificationsState state) {
return Scaffold(
appBar: AppBar(
title: const Text('Уведомления'),
),
body: state is NotificationsStateLoaded
? CustomScrollView(
slivers: [
SliverList.builder(
itemBuilder: (context, index) => NotificationWidget(
notification: state.notifications[index],
),
itemCount: state.notifications.length,
)
],
)
: const Placeholder(),
);
},
);
}
}