import 'package:flutter/widgets.dart'; import 'package:thesis_shop/stores/cart_store.dart'; import 'package:thesis_shop/stores/product_store.dart'; import 'package:thesis_shop/stores/user_store.dart'; class StoreInjector extends InheritedWidget { final UserStore userStore; final CartStore cartStore; final ProductStore productStore; const StoreInjector({ Key? key, required this.userStore, required this.cartStore, required this.productStore, required Widget child, }) : super(key: key, child: child); static StoreInjector of(BuildContext context) { final StoreInjector? result = context.dependOnInheritedWidgetOfExactType(); assert(result != null, 'No StoreInjector found in context'); return result!; } @override bool updateShouldNotify(StoreInjector oldWidget) { return false; } }