Skip to content

Commit

Permalink
Remove delay and debugPrint statement
Browse files Browse the repository at this point in the history
  • Loading branch information
bizz84 committed May 15, 2024
1 parent 95891b2 commit f10a2cf
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -23,7 +22,6 @@ class FakeProductsRepository {
}

Future<List<Product>> fetchProductsList() async {
await Future.delayed(const Duration(milliseconds: 1500));
return Future.value(_products.value);
}

Expand Down Expand Up @@ -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);
});

0 comments on commit f10a2cf

Please sign in to comment.