feat: Implement notifications feature, enhance profile settings with new sections, and integrate Firebase configurations for multiple environments.

This commit is contained in:
pradeepkumar
2026-03-08 21:48:56 +05:30
parent 0362d7cfe0
commit 744b7b7ca8
24 changed files with 3413 additions and 557 deletions

View File

@@ -0,0 +1,53 @@
class AppNotification {
final String id;
final String userId;
final String type; // 'connection' | 'message' | 'system' | 'update' | 'request'
final String title;
final String description;
final bool read;
final String? actionUrl;
final Map<String, String>? data;
final DateTime createdAt;
const AppNotification({
required this.id,
required this.userId,
required this.type,
required this.title,
required this.description,
required this.read,
this.actionUrl,
this.data,
required this.createdAt,
});
factory AppNotification.fromJson(Map<String, dynamic> json) {
return AppNotification(
id: json['id'] as String,
userId: json['userId'] as String? ?? '',
type: json['type'] as String? ?? 'system',
title: json['title'] as String? ?? '',
description: json['description'] as String? ?? '',
read: json['read'] as bool? ?? false,
actionUrl: json['actionUrl'] as String?,
data: json['data'] != null
? Map<String, String>.from(json['data'] as Map)
: null,
createdAt: DateTime.parse(json['createdAt'] as String),
);
}
AppNotification copyWith({bool? read}) {
return AppNotification(
id: id,
userId: userId,
type: type,
title: title,
description: description,
read: read ?? this.read,
actionUrl: actionUrl,
data: data,
createdAt: createdAt,
);
}
}