From f10a2cfea50d7b30b7f6445f711d0a0d226a75d2 Mon Sep 17 00:00:00 2001 From: Andrea Bizzotto Date: Fri, 7 Oct 2022 11:05:47 +0100 Subject: [PATCH] Remove delay and debugPrint statement --- .../features/products/data/fake_products_repository.dart | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ecommerce_app/lib/src/features/products/data/fake_products_repository.dart b/ecommerce_app/lib/src/features/products/data/fake_products_repository.dart index 17f222ae..1ca02658 100644 --- a/ecommerce_app/lib/src/features/products/data/fake_products_repository.dart +++ b/ecommerce_app/lib/src/features/products/data/fake_products_repository.dart @@ -4,7 +4,6 @@ import 'package:ecommerce_app/src/constants/test_products.dart'; import 'package:ecommerce_app/src/features/products/domain/product.dart'; import 'package:ecommerce_app/src/utils/delay.dart'; import 'package:ecommerce_app/src/utils/in_memory_store.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; class FakeProductsRepository { @@ -23,7 +22,6 @@ class FakeProductsRepository { } Future> fetchProductsList() async { - await Future.delayed(const Duration(milliseconds: 1500)); return Future.value(_products.value); } @@ -104,10 +102,7 @@ final productsListSearchProvider = FutureProvider.autoDispose final timer = Timer(const Duration(seconds: 5), () { link.close(); }); - ref.onDispose(() { - timer.cancel(); - debugPrint('disposed: $query'); - }); + ref.onDispose(() => timer.cancel()); final productsRepository = ref.watch(productsRepositoryProvider); return productsRepository.searchProducts(query); });