import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:thesis_shop/models/product.dart'; import 'package:thesis_shop/stores/product_loading_provider.dart'; import 'package:thesis_shop/stores/user_store.dart'; final productListProvider = Provider>>((ref) { final isSignedIn = ref.watch(userStoreProvider); if (!isSignedIn) { return ref.watch(productLoadingProvider); } return ref.watch(productLoadingProvider).whenData( (products) => products.map((pro) => pro.copyWithDiscount()).toList()); });