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 'products_provider.g.dart';
/// Provider for products list with online-first approach
@riverpod
/// keepAlive ensures data persists when switching tabs
@Riverpod(keepAlive: true)
class Products extends _$Products {
@override
Future<List<Product>> build() async {

View File

@@ -9,21 +9,24 @@ part of 'products_provider.dart';
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// Provider for products list with online-first approach
/// keepAlive ensures data persists when switching tabs
@ProviderFor(Products)
const productsProvider = ProductsProvider._();
/// Provider for products list with online-first approach
/// keepAlive ensures data persists when switching tabs
final class ProductsProvider
extends $AsyncNotifierProvider<Products, List<Product>> {
/// Provider for products list with online-first approach
/// keepAlive ensures data persists when switching tabs
const ProductsProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'productsProvider',
isAutoDispose: true,
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@@ -36,9 +39,10 @@ final class ProductsProvider
Products create() => Products();
}
String _$productsHash() => r'0ff8c2de46bb4b1e29678cc811ec121c9fb4c8eb';
String _$productsHash() => r'1fa5341d86a35a3b3d6666da88e0c5db757cdcdb';
/// Provider for products list with online-first approach
/// keepAlive ensures data persists when switching tabs
abstract class _$Products extends $AsyncNotifier<List<Product>> {
FutureOr<List<Product>> build();