import 'package:flutter_riverpod/flutter_riverpod.dart'; class AppAlert { final String id; final String title; final String body; final DateTime timestamp; AppAlert({ required this.id, required this.title, required this.body, required this.timestamp, }); } class AlertsNotifier extends Notifier> { @override List build() => []; void addAlert(String title, String body) { state = [ AppAlert( id: DateTime.now().millisecondsSinceEpoch.toString(), title: title, body: body, timestamp: DateTime.now(), ), ...state, ]; } void clearAll() => state = []; } final alertsProvider = NotifierProvider>( AlertsNotifier.new, );