This commit is contained in:
Phuoc Nguyen
2025-10-23 17:03:58 +07:00
parent 30c245b401
commit 9189b65ebf
22 changed files with 589 additions and 195 deletions

View File

@@ -6,7 +6,8 @@ import '../../../../core/providers/providers.dart';
part 'categories_provider.g.dart';
/// Provider for categories list with online-first approach
@riverpod
/// keepAlive ensures data persists when switching tabs
@Riverpod(keepAlive: true)
class Categories extends _$Categories {
@override
Future<List<Category>> build() async {

View File

@@ -9,21 +9,24 @@ part of 'categories_provider.dart';
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// Provider for categories list with online-first approach
/// keepAlive ensures data persists when switching tabs
@ProviderFor(Categories)
const categoriesProvider = CategoriesProvider._();
/// Provider for categories list with online-first approach
/// keepAlive ensures data persists when switching tabs
final class CategoriesProvider
extends $AsyncNotifierProvider<Categories, List<Category>> {
/// Provider for categories list with online-first approach
/// keepAlive ensures data persists when switching tabs
const CategoriesProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'categoriesProvider',
isAutoDispose: true,
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@@ -36,9 +39,10 @@ final class CategoriesProvider
Categories create() => Categories();
}
String _$categoriesHash() => r'33c33b08f8926e5bbbd112285591c74a3ff0f61c';
String _$categoriesHash() => r'c26eb4b4a76ce796eb65b7843a390805528dec4a';
/// Provider for categories list with online-first approach
/// keepAlive ensures data persists when switching tabs
abstract class _$Categories extends $AsyncNotifier<List<Category>> {
FutureOr<List<Category>> build();