Skip to content

Commit

Permalink
adding update product
Browse files Browse the repository at this point in the history
  • Loading branch information
1FarZ1 committed May 1, 2023
1 parent ddd83c9 commit d63a045
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/core/providers/product_provider.dart
Expand Up @@ -18,6 +18,11 @@ class ProductSt extends StateNotifier<List<Product>> {
}

void updateProduct(Product p) async {
state[state.indexOf(p)] = p;
state.where((element) {
if (element.id == p.id) {
element = p;
}
return true;
});
}
}

0 comments on commit d63a045

Please sign in to comment.