- Fix gamification endpoints to use Node.js server (app.eventifyplus.com) - Replace 6 mock gamification methods with real API calls (dashboard, leaderboard, shop, redeem, submit) - Add booking models, service, payment service (Razorpay), checkout provider - Add 3-step CheckoutScreen with Razorpay native modal integration - Add Google OAuth login (Flutter + Django backend) - Add full notifications system (Django model + 3 endpoints + Flutter UI) - Register CheckoutProvider, NotificationProvider in main.dart MultiProvider - Wire notification bell in HomeScreen app bar - Add razorpay_flutter ^1.3.7 and google_sign_in ^6.2.2 packages
34 lines
1006 B
Dart
34 lines
1006 B
Dart
// lib/features/notifications/models/notification_model.dart
|
|
|
|
class NotificationModel {
|
|
final int id;
|
|
final String title;
|
|
final String message;
|
|
final String type; // event, promo, system, booking
|
|
bool isRead;
|
|
final DateTime createdAt;
|
|
final String? actionUrl;
|
|
|
|
NotificationModel({
|
|
required this.id,
|
|
required this.title,
|
|
required this.message,
|
|
this.type = 'system',
|
|
this.isRead = false,
|
|
required this.createdAt,
|
|
this.actionUrl,
|
|
});
|
|
|
|
factory NotificationModel.fromJson(Map<String, dynamic> json) {
|
|
return NotificationModel(
|
|
id: (json['id'] as num?)?.toInt() ?? 0,
|
|
title: json['title'] as String? ?? '',
|
|
message: json['message'] as String? ?? '',
|
|
type: json['notification_type'] as String? ?? json['type'] as String? ?? 'system',
|
|
isRead: (json['is_read'] as bool?) ?? false,
|
|
createdAt: DateTime.tryParse(json['created_at'] as String? ?? '') ?? DateTime.now(),
|
|
actionUrl: json['action_url'] as String?,
|
|
);
|
|
}
|
|
}
|