refactor: migrate to riverpod 3

This commit is contained in:
cogwheel0
2025-09-21 22:31:44 +05:30
parent 37e5633c5c
commit 462bf4cde2
20 changed files with 834 additions and 453 deletions

View File

@@ -498,8 +498,9 @@ final fileAttachmentServiceProvider = Provider<dynamic>((ref) {
});
// State notifier for managing attached files
class AttachedFilesNotifier extends StateNotifier<List<FileUploadState>> {
AttachedFilesNotifier() : super([]);
class AttachedFilesNotifier extends Notifier<List<FileUploadState>> {
@override
List<FileUploadState> build() => [];
void addFiles(List<File> files) {
final newStates = files
@@ -536,6 +537,6 @@ class AttachedFilesNotifier extends StateNotifier<List<FileUploadState>> {
}
final attachedFilesProvider =
StateNotifierProvider<AttachedFilesNotifier, List<FileUploadState>>((ref) {
return AttachedFilesNotifier();
});
NotifierProvider<AttachedFilesNotifier, List<FileUploadState>>(
AttachedFilesNotifier.new,
);