simulacion de estados y flujo de notificacion, modificacion de estilos en todas las vistas

This commit is contained in:
shinra32
2026-05-23 07:08:49 -06:00
parent ca076607c7
commit 92f570294a
43 changed files with 4335 additions and 2035 deletions

View File

@@ -0,0 +1,38 @@
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<List<AppAlert>> {
@override
List<AppAlert> 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, List<AppAlert>>(
AlertsNotifier.new,
);