Skip to content

Analyze state management (@explore subagent)

Field Value
Source opencode CLI/web
Session ses_fa8943fcbffeuYb10nYHdQwgV5
Started 2026-08-31 10:44
Messages 17
Parts 124 (text+patch+tool) · 8 reasoning · 70 tool calls
Model opencode:big-pickle
Directory /home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App

In the Flutter app at /home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App, thoroughly analyze:

  1. The state management approach used (Provider, Bloc, Riverpod, GetX, etc.)
  2. All state management files - controllers, providers, blocs, cubits, etc.
  3. How state is shared between screens
  4. How API responses are handled and cached
  5. The data flow pattern (repository pattern, service layer, etc.)

Search in lib/ for files related to state management, controllers, providers, blocs. Read key files and provide a complete picture of how state is managed.

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib</path>
<type>directory</type>
<entries>
data_model/
main.dart
screens/
services/
utils/
widgets/
(6 entries)
</entries>

glob — {"pattern": "lib/**/*.dart", "path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App"}

/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/widgets/wishlist_compare_widget.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/widgets/show_message.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/widgets/price_widget.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/widgets/loader.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/widgets/image_view.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/widgets/gdpr_webview.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/wi
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens</path>
<type>directory</type>
<entries>
account/
add_edit_address/
add_review/
address_list/
cart_screen/
categories_screen/
checkout/
cms_screen/
compare/
contact_us/
currency/
dashboard/
downloadable_products/
drawer_sub_categories/
drawer/
filter_screen/
forget_password/
gdpr/
home_page/
language/
location/
order_detail/
order_invoices/
order_refund/
order_shipping/
orders/
product_screen/
recent_product/
review/
search_screen/
sign_in/
sign_up/
splash_screen/
wishList/
(34 entries)
</entries>

glob — {"path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App", "pattern": "lib/**/*bloc*"}

/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/contact_us/bloc/contact_us_bloc.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/checkout/guest_add_address/bloc/guest_address_bloc.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/checkout/checkout_review/bloc/checkout_review_bloc.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/order_detail/bloc/order_detail_bloc.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/wishList/bloc/wishlist_bloc.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/e
…[truncated]

glob — {"path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App", "pattern": "lib/**/*provider*"}

/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/theme_provider.dart

glob — {"path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App", "pattern": "lib/**/*cubit*"}

No files found

glob — {"path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App", "pattern": "lib/**/*controller*"}

/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/recent_product/utils/recent_view_controller.dart

glob — {"path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App", "pattern": "lib/**/*repository*"}

/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/wishList/bloc/wishlist_repository.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/sign_up/bloc/sign_up_repository.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/order_shipping/bloc/order_shipments_repository.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/order_refund/bloc/order_refund_repository.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/drawer_sub_categories/bloc/drawer_sub_categories_repository.dart
/home/sambasene/dev/Yonko Business/
…[truncated]

glob — {"path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App", "pattern": "lib/**/*event*"}

/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/forget_password/bloc/forget_password_event.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/filter_screen/bloc/filter_event.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/downloadable_products/bloc/downloadable_products_events.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/drawer_sub_categories/bloc/drawer_sub_categories_event.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/drawer/bloc/drawer_events.dart
/home/sambasene/dev/Yonko Business/Bag
…[truncated]

glob — {"path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App", "pattern": "lib/**/*state*"}

/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/filter_screen/bloc/filter_state.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/wishList/bloc/wishlist_state.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/orders/bloc/order_list_state.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/drawer_sub_categories/bloc/drawer_sub_categories_state.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/order_shipping/bloc/order_shipments_state.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Fl
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/pubspec.yaml"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/pubspec.yaml</path>
<type>file</type>
<content>
1: name: bagisto_app_demo
2: description: A new Flutter project.
3: # The following line prevents the package from being accidentally published to
4: # pub.dev using `flutter pub publish`. This is preferred for private packages.
5: publish_to: 'none' # Remove this line if you wish to publish to pub.dev
6:
7: # The following defines the version and build number for your application.
8: # A version number is three numbers separated by dots, like 1.2.43
9: # followed by an optional build number separated by a +.
10: # Both the version and the builder number may be over
…[truncated]

Now let me read the key architectural files to understand the patterns in depth:

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/main.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/main.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: // must_be_immutable, void_checks
12:
13: import 'dart:io';
14:
15: import 'package:bagisto_app_demo/screens/home_page/data_model/get_categories_drawer_data_model.dart';
16: import 'package:bagisto_app_demo/screens/product_screen/utils/index.dart';
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/services/api_client.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/services/api_client.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'dart:developer';
12: import 'dart:io';
13:
14: import 'package:bagisto_app_demo/data_model/account_models/account_update_model.dart';
15: import 'package:bagisto_app_demo/data_model/gdpr_models/gdpr_pdf_model.dart';
16: import
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/services/graph_ql.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/services/graph_ql.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'dart:developer';
12:
13: import 'package:graphql_flutter/graphql_flutter.dart';
14:
15: import '../utils/app_global_data.dart';
16: import '../utils/server_configuration.dart';
17: import '../utils/shared_preference_helper.dart'
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/services/mutation_query.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/services/mutation_query.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'dart:convert';
12:
13: import 'package:bagisto_app_demo/screens/cart_screen/utils/cart_index.dart';
14:
15: import '../utils/app_global_data.dart';
16:
17: /// This class contains all the graphql queries and mutations
18:
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/theme_provider.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/theme_provider.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/utils/shared_preference_helper.dart';
12: import 'package:flutter/material.dart';
13:
14: class ThemeProvider extends ChangeNotifier {
15: late String _isDark;
16: late final SharedPreferenceHelper app
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/app_global_data.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/app_global_data.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'dart:async';
12:
13: import '../data_model/core_configs_model.dart';
14: import '../data_model/currency_language_model.dart';
15: import '../screens/cms_screen/data_model/cms_model.dart';
16: import '../screens/home_page/data
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/shared_preference_helper.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/shared_preference_helper.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/utils/server_configuration.dart';
12: import 'package:bagisto_app_demo/utils/shared_preference_keys.dart';
13: import 'package:bagisto_app_demo/utils/string_constants.dart';
14: import 'packag
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/prefetching_helper.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/prefetching_helper.dart</path>
<type>file</type>
<content>
1:
2: /*
3: * Webkul Software.
4: * @package Mobikul Application Code.
5: * @Category Mobikul
6: * @author Webkul <support@webkul.com>
7: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
8: * @license https://store.webkul.com/license.html
9: * @link https://store.webkul.com/license.html
10: */
11:
12: import 'package:bagisto_app_demo/utils/server_configuration.dart';
13: import 'package:flutter/material.dart';
14: import '../data_model/currency_language_model.dart';
15: import '../services/api_client.dart';
16: import 'app_
…[truncated]

Now let me read representative bloc, event, state, and repository files to understand the full pattern:

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/bloc/home_page_bloc.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/bloc/home_page_bloc.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'dart:developer';
12:
13: import 'package:bagisto_app_demo/screens/home_page/utils/index.dart';
14:
15: import '../../../data_model/add_to_wishlist_model/add_wishlist_model.dart';
16: import '../../cart_screen
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/bloc/home_page_event.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/bloc/home_page_event.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import '../data_model/new_product_data.dart';
12:
13: abstract class HomePageEvent {}
14:
15: class FetchAddWishlistHomepageEvent extends HomePageEvent {
16: NewProducts? datum;
17: String? productId;
18: FetchAddWi
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/bloc/home_page_state.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/bloc/home_page_state.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import '../../../data_model/add_to_wishlist_model/add_wishlist_model.dart';
12: import '../../cart_screen/cart_model/cart_data_model.dart';
13: import '../../cms_screen/data_model/cms_model.dart';
14: import '../data_
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/bloc/home_page_repository.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/bloc/home_page_repository.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/screens/home_page/utils/index.dart';
12:
13: import '../../../data_model/add_to_wishlist_model/add_wishlist_model.dart';
14: import '../../cart_screen/cart_model/cart_data_model.
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen/bloc/cart_screen_bloc.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen/bloc/cart_screen_bloc.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/screens/cart_screen/utils/cart_index.dart';
12:
13: class CartScreenBloc extends Bloc<CartScreenBaseEvent, CartScreenBaseState> {
14: CartScreenRepository? repository;
15:
16: Car
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen/bloc/cart_screen_event.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen/bloc/cart_screen_event.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11:
12:
13: import 'package:bagisto_app_demo/screens/cart_screen/utils/cart_index.dart';
14:
15: abstract class CartScreenBaseEvent{}
16:
17: class RemoveCouponCartEvent extends CartScreenBaseEvent{
18: CartModel?
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen/bloc/cart_screen_state.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen/bloc/cart_screen_state.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11:
12:
13: import 'package:bagisto_app_demo/screens/cart_screen/utils/cart_index.dart';
14:
15:
16: abstract class CartScreenBaseState {}
17: enum CartStatus { success, fail }
18:
19: class ShowLoaderCartState e
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen/bloc/cart_screen_repository.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen/bloc/cart_screen_repository.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11:
12:
13: import 'package:bagisto_app_demo/screens/cart_screen/utils/cart_index.dart';
14:
15: abstract class CartScreenRepository {
16: Future<CartModel?> getCartData();
17:
18: Future<AddToCartModel?> upd
…[truncated]

Now let me examine how Blocs are provided to widgets and how state is shared:

glob — {"path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App", "pattern": "lib/screens/home_page/**/*.dart"}

/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/widget/view_all_button.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/widget/static_content_widget.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/widget/service_content.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/widget/reach_top.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/widget/new_product_view.dart
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens
…[truncated]

grep — {"pattern": "BlocProvider|BlocBuilder|BlocListener|BlocConsumer", "include": "*.dart", "path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page"}

Found 2 matches
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/home_page.dart:
Line 78: return BlocConsumer<DrawerBloc, DrawerPageBaseState>(
Line 121: return BlocConsumer<HomePageBloc, HomePageBaseState>(

grep — {"pattern": "BlocProvider|BlocBuilder|BlocListener|BlocConsumer", "include": "*.dart", "path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen"}

Found 1 matches
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen/cart_screen.dart:
Line 62: return BlocConsumer<CartScreenBloc, CartScreenBaseState>(

grep — {"pattern": "BlocProvider|BlocBuilder|BlocListener|BlocConsumer", "include": "*.dart", "path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/drawer"}

No files found

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/home_page.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/home_page.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'dart:async';
12: import 'dart:io';
13: import 'package:bagisto_app_demo/screens/home_page/utils/index.dart';
14: import 'data_model/theme_customization.dart';
15:
16: class HomeScreen extends StatefulWidget {
17: const
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen/cart_screen.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen/cart_screen.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/screens/cart_screen/utils/cart_index.dart';
12:
13: class CartScreen extends StatefulWidget {
14: const CartScreen({Key? key}) : super(key: key);
15:
16: @override
17: State<CartScreen> cre
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/utils/index.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/utils/index.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: export 'package:bagisto_app_demo/utils/index.dart';
12: export 'package:bagisto_app_demo/screens/home_page/utils/route_argument_helper.dart';
13: export 'package:bagisto_app_demo/screens/home_page/widget/home_page_loader_view.
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen/utils/cart_index.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/cart_screen/utils/cart_index.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: export 'package:bagisto_app_demo/screens/cart_screen/widget/cart_item.dart';
12: export 'package:bagisto_app_demo/screens/cart_screen/widget/cart_loader_screen.dart';
13: export 'package:bagisto_app_demo/utils/applicati
…[truncated]

Now let me examine the routing, drawer bloc (shared across screens), and sign-in bloc:

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/app_navigation.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/app_navigation.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/data_model/app_route_arguments.dart';
12: import 'package:bagisto_app_demo/data_model/order_model/order_detail_model.dart';
13: import 'package:bagisto_app_demo/screens/account/bloc/account_info_bloc.da
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/drawer/bloc/drawer_bloc.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/drawer/bloc/drawer_bloc.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/screens/drawer/utils/index.dart';
12:
13: class DrawerBloc extends Bloc<DrawerEvent, DrawerPageBaseState> {
14: DrawerPageRepository? repository;
15:
16: DrawerBloc({this.repository}) : sup
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/sign_in/bloc/sign_in_bloc.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/sign_in/bloc/sign_in_bloc.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11:
12:
13: import 'package:bagisto_app_demo/screens/sign_in/utils/index.dart';
14:
15: class SignInBloc extends Bloc<SignInBaseEvent, SignInBaseState> {
16: SignInRepository? repository;
17:
18: SignInBloc({@required this
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/sign_in/bloc/sign_in_event.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/sign_in/bloc/sign_in_event.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: // ignore_for_file: file_names, must_be_immutable
12:
13:
14: abstract class SignInBaseEvent /*extends Equatable*/{}
15:
16: class FetchSignInEvent extends SignInBaseEvent {
17: String? email;
18: String? password;
19:
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/sign_in/bloc/sign_in_state.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/sign_in/bloc/sign_in_state.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11:
12:
13: import 'package:bagisto_app_demo/screens/sign_in/utils/index.dart';
14:
15: abstract class SignInBaseState{}
16:
17: enum SignInStatus { success, fail }
18:
19: class InitialState extends SignInBaseState {
20
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/sign_in/bloc/sign_in_repository.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/sign_in/bloc/sign_in_repository.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11:
12: import 'package:bagisto_app_demo/screens/sign_in/utils/index.dart';
13:
14: abstract class SignInRepository {
15: Future<SignInModel> callSignInApi(String email, String password);
16:
17: Future<SignInModel?>
…[truncated]

Let me examine how the cart bloc is shared via navigation (checkout) and the controller pattern:

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/checkout/view/checkout_screen.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/checkout/view/checkout_screen.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/screens/checkout/utils/index.dart';
12: import '../checkout_payment/view/checkout_payment_view.dart';
13:
14: class CheckoutScreen extends StatefulWidget {
15: final CartScreenBloc? ca
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/recent_product/utils/recent_view_controller.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/recent_product/utils/recent_view_controller.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'dart:async';
12:
13: class RecentViewController {
14: RecentViewController._();
15:
16: static StreamController<String?> controller = StreamController.broadcast();
17:
18: static final RecentVi
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/server_configuration.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/server_configuration.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: // Application Specific Constants
12: import 'dart:ui';
13:
14: const int defaultSplashDelay = 3;
15:
16: const String baseDomain = "";
17:
18: ///base url for the application
19: const String baseUrl = "$baseDomain/graphql";
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/data_model"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/data_model</path>
<type>directory</type>
<entries>
account_models/
add_to_wishlist_model/
app_route_arguments.dart
categories_data_model/
core_configs_model.dart
currency_language_model.dart
gdpr_models/
google_place_model.dart
graphql_base_error_model.dart
graphql_base_model.dart
order_model/
product_model/
review_model/
sign_in_model/
sign_up_model/
(15 entries)
</entries>

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/index.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/index.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: export 'package:bagisto_app_demo/utils/app_constants.dart';
12: export 'package:bagisto_app_demo/utils/app_global_data.dart';
13: export 'package:bagisto_app_demo/utils/application_localization.dart';
14: export 'package:bagisto_app_demo/utils/
…[truncated]

Let me look at the data model files to understand how API responses are modeled and check the splash screen, plus a few more features:

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/data_model/graphql_base_model.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/data_model/graphql_base_model.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: // file_names, constant_identifier_names
12: import 'package:json_annotation/json_annotation.dart';
13:
14: part 'graphql_base_model.g.dart';
15:
16: /// BaseModel class having some general variables which will use by other
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/data_model/graphql_base_error_model.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/data_model/graphql_base_error_model.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:json_annotation/json_annotation.dart';
12:
13: part 'graphql_base_error_model.g.dart';
14:
15: @JsonSerializable()
16: class GraphQlBaseErrorModel {
17: String? success;
18: bool? responseStatus;
19:
2
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/splash_screen/view/splash_screen.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/splash_screen/view/splash_screen.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11:
12:
13: import 'package:bagisto_app_demo/screens/splash_screen/utils/index.dart';
14:
15: import '../../../utils/prefetching_helper.dart';
16: class SplashScreen extends StatefulWidget {
17: const SplashScreen({K
…[truncated]

grep — {"include": "*.dart", "path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib", "pattern": "context\\.read<|MultiBlocProvider|BlocProvider\\.value|BlocProvider\\."}

Found 55 matches
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/wishList/view/wishlist_screen.dart:
Line 37: wishListBloc = context.read<WishListBloc>();
Line 159: WishListBloc wishListBloc = context.read<WishListBloc>();
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/check_box_group.dart:
Line 72: productScreenBLoc = context.read<ProductScreenBLoc>();
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/app_navigation.dart:
Line 122: builder: (_) => MultiBlocProvider(
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/order_shipping/shipments_d
…[truncated]

Now let me examine the drawer repository and a couple more repositories, plus the dashboard (which likely shares the drawer bloc), and check how the HomePageBloc data flow through streams and GlobalData:

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/drawer/bloc/drawer_repository.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/drawer/bloc/drawer_repository.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11:
12:
13: import '../../cms_screen/data_model/cms_model.dart';
14: import 'package:bagisto_app_demo/screens/drawer/utils/index.dart';
15:
16: abstract class DrawerPageRepository {
17: Future<GetDrawerCategoriesData> g
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/dashboard/view/dashboard.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/dashboard/view/dashboard.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/screens/dashboard/utils/index.dart';
12:
13: class DashboardScreen extends StatefulWidget {
14: const DashboardScreen({Key? key}) : super(key: key);
15:
16: @override
17: State<DashboardSc
…[truncated]

grep — {"include": "*.dart", "path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib", "pattern": "cartCountController"}

Found 30 matches
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/widgets/common_app_bar.dart:
Line 59: stream: GlobalData.cartCountController.stream,
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/app_global_data.dart:
Line 32: static final StreamController cartCountController =
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/wishList/view/wishlist_screen.dart:
Line 34: GlobalData.cartCountController.sink.add(value);
Line 64: stream: GlobalData.cartCountController.stream,
Line 181: GlobalData.cartCountController.sink
Line 222: GlobalData.cartCountController.sink
/home/sambasen
…[truncated]

Let me look at the common_app_bar (which uses the global cart count stream) and the product screen bloc to understand more about the streams used:

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/widgets/common_app_bar.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/widgets/common_app_bar.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/utils/route_constants.dart';
12: import 'package:flutter/material.dart';
13: import '../utils/app_constants.dart';
14: import '../utils/app_global_data.dart';
15: import '../utils/badge_helper.dart';
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/product_screen/bloc/product_page_bloc.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/product_screen/bloc/product_page_bloc.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/data_model/product_model/booking_slots_modal.dart';
12:
13: import '../../../data_model/add_to_wishlist_model/add_wishlist_model.dart';
14: import 'package:bagisto_app_demo/scr
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/product_screen/bloc/product_page_repository.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/product_screen/bloc/product_page_repository.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/data_model/product_model/booking_slots_modal.dart';
12:
13: import '../../../data_model/add_to_wishlist_model/add_wishlist_model.dart';
14: import 'package:bagisto_app_de
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/product_screen/bloc/product_page_event.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/product_screen/bloc/product_page_event.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/screens/home_page/data_model/new_product_data.dart';
12:
13: abstract class ProductScreenBaseEvent {}
14:
15: class OnClickProductLoaderEvent extends ProductScreenBaseEvent {
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/product_screen/bloc/product_page_state.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/product_screen/bloc/product_page_state.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/data_model/product_model/booking_slots_modal.dart';
12:
13: import '../../../data_model/add_to_wishlist_model/add_wishlist_model.dart';
14: import 'package:bagisto_app_demo/sc
…[truncated]

Let me look at a couple more things - how Hive is used for caching, the account_info bloc (which handles shared user data), and how the sign-in screen updates global state after login:

grep — {"include": "*.dart", "path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib", "pattern": "Hive\\.|Box\\(|Hive\\.box"}

Found 100 matches (more matches available)
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/widgets/loader.dart:
Line 32: if ((loadingMessage ?? "").isNotEmpty) const SizedBox(height: 24),
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/widgets/common_drop_down_field.dart:
Line 40: ? const SizedBox()
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/widgets/empty_data_view.dart:
Line 46: if(showDescription==false) const SizedBox(
Line 53: if(showDescription) const SizedBox(
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/widgets/common_widgets.dart:
Line 104: Widget ge
…[truncated]

grep — {"include": "*.dart", "path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib", "pattern": "HiveStore|GraphQLCache|cacheRereadPolicy|FetchPolicy"}

Found 73 matches
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/services/graph_ql.dart:
Line 42: cache: GraphQLCache(store: HiveStore()),
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/services/api_client.dart:
Line 124: cacheRereadPolicy:
Line 127: ? FetchPolicy.cacheAndNetwork
Line 128: : FetchPolicy.networkOnly));
Line 142: cacheRereadPolicy: CacheRereadPolicy.mergeOptimistic,
Line 144: ? FetchPolicy.cacheAndNetwork
Line 145: : FetchPolicy.networkOnly));
Line 159: fetchPolicy: FetchPolicy.noCache,
Line 160: cacheRereadPolicy: CacheRereadPolicy.ignoreAll));
Line 174: cacheRereadPolicy: CacheRereadPolicy.mergeOp
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/account/bloc/account_info_bloc.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/account/bloc/account_info_bloc.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11:
12: import '../../../data_model/account_models/account_update_model.dart';
13: import '../utils/index.dart';
14:
15: class AccountInfoBloc extends Bloc<AccountInfoBaseEvent, AccountInfoBaseState> {
16: AccountInfoRe
…[truncated]

grep — {"include": "*.dart", "path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib", "pattern": "ChangeNotifier|notifyListeners|Provider\\.|Consumer<|MultiProvider"}

Found 39 matches
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/main.dart:
Line 193: child: ChangeNotifierProvider(
Line 195: child: Consumer<ThemeProvider>(
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/theme_provider.dart:
Line 14: class ThemeProvider extends ChangeNotifier {
Line 29: notifyListeners();
Line 36: notifyListeners();
Line 56: notifyListeners();
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/wishList/view/wishlist_screen.dart:
Line 116: return BlocConsumer<WishListBloc, WishListBaseState>(
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter
…[truncated]

Let me look at the sign-in screen to see how it uses GlobalData/shared pref after login and check the remaining recent_product controller usage, plus look at wishlist event to understand the full picture:

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/sign_in/view/sign_in_screen.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/sign_in/view/sign_in_screen.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11:
12: import 'package:bagisto_app_demo/screens/sign_in/utils/index.dart';
13:
14: import '../../../utils/server_configuration.dart';
15:
16: class SignInScreen extends StatefulWidget {
17: const SignInScreen({Key? key})
…[truncated]

grep — {"include": "*.dart", "path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib", "pattern": "RecentViewController"}

Found 6 matches
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/product_screen/view/product_screen.dart:
Line 675: RecentViewController.controller.sink.add(productData?.id),
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/recent_product/recent_product_view.dart:
Line 37: RecentViewController.controller.stream.listen((event) {
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/recent_product/utils/recent_view_controller.dart:
Line 13: class RecentViewController {
Line 14: RecentViewController._();
Line 18: static final RecentViewController _instance = RecentViewController._()
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/orders/bloc/order_list_bloc.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/orders/bloc/order_list_bloc.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11:
12: import 'package:bagisto_app_demo/screens/orders/utils/index.dart';
13:
14: class OrderListBloc extends Bloc<OrderListEvent, OrderListBaseState> {
15: OrderListRepository? repository;
16:
17: OrderListBloc({this.re
…[truncated]

I now have a comprehensive picture. Let me check the recent_product_view briefly and verify there are no other state management libraries (like GetX) in use, and look at how the drawer bloc relates via the drawer_sub_categories:

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/recent_product/recent_product_view.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/recent_product/recent_product_view.dart</path>
<type>file</type>
<content>
1:
2: /*
3: * Webkul Software.
4: * @package Mobikul Application Code.
5: * @Category Mobikul
6: * @author Webkul <support@webkul.com>
7: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
8: * @license https://store.webkul.com/license.html
9: * @link https://store.webkul.com/license.html
10: */
11:
12:
13: import 'package:bagisto_app_demo/screens/recent_product/utils/index.dart';
14: import 'package:hive/hive.dart';
15: class RecentView extends StatefulWidget {
16: final bool? isLogin;
17:
18: const Recen
…[truncated]

grep — `{“include”: “*.dart”, “path”: “/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib”, “pattern”: “GetxController|GetBuilder|Get\.put|Get\.find|RxInt|Riverpod|StateNotifier|Pr

…[truncated]`

Found 1 matches
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/main.dart:
Line 193: child: ChangeNotifierProvider(

grep — {"include": "*.dart", "path": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib", "pattern": "isPreFetchingEnable|allProducts\\["}

Found 7 matches
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/utils/server_configuration.dart:
Line 54: const bool isPreFetchingEnable = true;
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/services/api_client.dart:
Line 126: fetchPolicy: ((filters ?? []).isEmpty && isPreFetchingEnable)
Line 143: fetchPolicy: isPreFetchingEnable
Line 175: fetchPolicy: isPreFetchingEnable
Line 436: fetchPolicy: isPreFetchingEnable
/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/widget/home_page_view.dart:
Line 207: final productsModel = GlobalData.allProducts[id];
/home/sambasene/dev/Yonk
…[truncated]

Let me read the home_page_view to see how GlobalData.allProducts is consumed, and also the product_screen where recent products are stored to Hive:

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/widget/home_page_view.dart"}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/home_page/widget/home_page_view.dart</path>
<type>file</type>
<content>
1: /*
2: * Webkul Software.
3: * @package Mobikul Application Code.
4: * @Category Mobikul
5: * @author Webkul <support@webkul.com>
6: * @Copyright (c) Webkul Software Private Limited (https://webkul.com)
7: * @license https://store.webkul.com/license.html
8: * @link https://store.webkul.com/license.html
9: */
10:
11: import 'package:bagisto_app_demo/screens/home_page/data_model/theme_customization.dart';
12: import 'package:bagisto_app_demo/screens/home_page/utils/index.dart';
13: import 'package:bagisto_app_demo/screens/home_pag
…[truncated]

read — {"filePath": "/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/product_screen/view/product_screen.dart", "offset": 640, "limit": 80}

<path>/home/sambasene/dev/Yonko Business/Bagisto Mobikul/eCommerce-Flutter-App/lib/screens/product_screen/view/product_screen.dart</path>
<type>file</type>
<content>
640: if ((productData?.configurableData?.index ?? []).isNotEmpty) {
641: id = productData?.configurableData?.index?[0].id;
642: }
643: for (var indexData = 0;
644: indexData < (productData?.configurableData?.index?.length ?? 0);
645: indexData++) {
646: List map = [];
647:
648: Index? data = productData?.configurableData?.index?[indexData];
649:
650: for (int i = 0; i < (data?.attributeOptionIds?.length ?? 0); i++) {
651: AttributeOptionIds? item = data?.attributeOptionIds?[i];
652: for (int j = 0; j < (configurableParams?.len
…[truncated]

I now have a very thorough picture of the state management in this application. Let me compile a complete analysis.


State Management Analysis: Bagisto Mobikul eCommerce Flutter App

Section titled “State Management Analysis: Bagisto Mobikul eCommerce Flutter App”

The app uses a hybrid state management approach, primarily built around the Bloc pattern (via flutter_bloc: ^9.1.0) with several supporting mechanisms:

Mechanism Library Usage
Bloc pattern flutter_bloc: ^9.1.0 Primary per-screen state management (34 blocs)
Provider (ChangeNotifier) provider: ^6.0.1 App-wide theme management only
Global singletons + static state app_global_data.dart Cross-screen shared data (cart count, products cache)
Broadcast Streams dart:async Cart count notifications, product data, recent-viewed
Local persistence get_storage (GetStorage), hive: ^2.2.3 Persisting auth/theme/config and recent products

Not used: Riverpod, GetX controllers/state (GetX is not used; get_storage is used for persistence only), no cubits, no StateNotifier.


Blocs (34 total — found in lib/screens/**/bloc/)

Section titled “Blocs (34 total — found in lib/screens/**/bloc/)”

Each feature screen follows the BLoC triad pattern: <name>_bloc.dart, <name>_event.dart, <name>_state.dart, plus a <name>_repository.dart.

Screen Bloc Repository
Home page home_page_bloc.dart home_page_repository.dart
Drawer drawer_bloc.dart drawer_repository.dart
Cart cart_screen_bloc.dart cart_screen_repository.dart
Categories categories_bloc.dart categories_repository.dart
Drawer sub-categories drawer_sub_categories_bloc.dart drawer_sub_categories_repository.dart
Product page product_page_bloc.dart product_page_repository.dart
Sign-in sign_in_bloc.dart sign_in_repository.dart
Sign-up sign_up_bloc.dart sign_up_repository.dart
Forget password forget_password_bloc.dart forget_password_repository.dart
Account account_info_bloc.dart account_info_repository.dart
Address list address_bloc.dart address_repository.dart
Add/Edit address add_edit_address_bloc.dart add_edit_address_repository.dart
Orders order_list_bloc.dart (via order_list_repo.dart)
Order detail order_detail_bloc.dart order_detail_repository.dart
Order invoices order_invoice_bloc.dart order_invoice_repository.dart
Order shipments order_shipments_bloc.dart order_shipments_repository.dart
Order refunds order_refund_bloc.dart order_refund_repository.dart
Wishlist wishlist_bloc.dart wishlist_repository.dart
Compare compare_screen_bloc.dart compare_screen_repository.dart
Search search_bloc.dart search_repository.dart
Filter filter_bloc.dart filter_repository.dart
CMS cms_bloc.dart cms_repository.dart
Review review_bloc.dart (via review_repo.dart)
Add review add_review_bloc.dart add_review_repository.dart
Contact us contact_us_bloc.dart contact_us_repository.dart
GDPR gdpr_bloc.dart gdpr_repository.dart
Downloadables downloadable_products_bloc.dart dowbloadable_products_repository.dart
Location location_bloc.dart —
Checkout address checkout_address_bloc.dart checkout_address_repository.dart
Checkout guest address guest_address_bloc.dart guest_address_repository.dart
Checkout shipping checkout_shipping_bloc.dart checkout_shipping_repository.dart
Checkout payment checkout_payment_bloc.dart checkout_payment_repository.dart
Checkout review checkout_review_bloc.dart checkout_review_repository.dart
Save order save_order_bloc.dart save_order_repositroy.dart

The Bloc pattern is not “pure” — events/states do not extend Equatable (despite equatable being a dependency)

…[truncated]

8 internal reasoning block(s) omitted — raw thinking is not exported (see archive index).