mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-28 00:45:17 -04:00
contact invitation accept notifications
This commit is contained in:
parent
6080c2f0c6
commit
1455aabe6c
27 changed files with 718 additions and 220 deletions
26
lib/notifications/cubits/notifications_cubit.dart
Normal file
26
lib/notifications/cubits/notifications_cubit.dart
Normal file
|
@ -0,0 +1,26 @@
|
|||
import 'package:fast_immutable_collections/fast_immutable_collections.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../notifications.dart';
|
||||
|
||||
class NotificationsCubit extends Cubit<NotificationsState> {
|
||||
NotificationsCubit(super.initialState);
|
||||
|
||||
void info({required String text, String? title}) {
|
||||
emit(state.copyWith(
|
||||
queue: state.queue.add(NotificationItem(
|
||||
type: NotificationType.info, text: text, title: title))));
|
||||
}
|
||||
|
||||
void error({required String text, String? title}) {
|
||||
emit(state.copyWith(
|
||||
queue: state.queue.add(NotificationItem(
|
||||
type: NotificationType.info, text: text, title: title))));
|
||||
}
|
||||
|
||||
IList<NotificationItem> popAll() {
|
||||
final out = state.queue;
|
||||
emit(state.copyWith(queue: state.queue.clear()));
|
||||
return out;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue