forked from eatvio/eatvio_app
created notifications model and logic of type based parsing
This commit is contained in:
@@ -4,7 +4,7 @@ import 'package:eatvio_app/features/notifications/presentation/notifications_cub
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
class NotificationsCubit extends Cubit<NotificationsState> {
|
||||
final List<NotificationModel> _notifications = [];
|
||||
final List<BaseNotificationModel> _notifications = [];
|
||||
final WsManager wsManager;
|
||||
|
||||
NotificationsCubit({required this.wsManager}) : super(const NotificationsState.empty()) {
|
||||
|
||||
@@ -10,7 +10,7 @@ abstract class NotificationsState with _$NotificationsState {
|
||||
const factory NotificationsState.empty() = NotificationsStateEmpty;
|
||||
|
||||
const factory NotificationsState.loaded({
|
||||
required List<NotificationModel> notifications,
|
||||
required List<BaseNotificationModel> notifications,
|
||||
required int notificationsCount,
|
||||
}) = NotificationsStateLoaded;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
class NotificationWidget extends StatelessWidget {
|
||||
const NotificationWidget({super.key, required this.notification});
|
||||
final NotificationModel notification;
|
||||
final BaseNotificationModel notification;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// return (notification.type) {
|
||||
@@ -12,4 +12,3 @@ class NotificationWidget extends StatelessWidget {
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user