title: Bad State: Cannot add new events after calling close - Flutter Modular
body: <p>I'm facing the following Error <strong>&quot;Bad State: Cannot add new events after calling close&quot;</strong> when I back to HomePage and Visit ProductsPage for the second time.</p>
  <p>The first time the products load as well
  But when I try to load ProductsPage again this error is throwing.</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:flutter_bloc/flutter_bloc.dart';
  import 'package:flutter_modular/flutter_modular.dart';
  
  import '../../widgets/product_display.dart';
  import '../../widgets/title_section.dart';
  import '../home_page/components/button_menu.dart';
  import 'bloc/products_bloc.dart';
  import 'bloc/products_event.dart';
  import 'bloc/products_state.dart';
  
  class ProductsPage extends StatefulWidget {
    const ProductsPage({Key? key}) : super(key: key);
  
    @override
    State&lt;ProductsPage&gt; createState() =&gt; _ProductsPageState();
  }
  
  class _ProductsPageState extends State&lt;ProductsPage&gt; {
    final bloc = Modular.get&lt;ProductsBloc&gt;();
  
    @override
    void initState() {
      super.initState();
      bloc.add(LoadProductsEvent());
    }
  
    @override
    void dispose() {
      super.dispose();
      bloc.close();
      
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: const Text('Produtos'),
        ),
        body: SafeArea(
          child: SingleChildScrollView(
              child: Padding(
            padding: const EdgeInsets.all(10.0),
            child: Column(
              children: [
                const SizedBox(
                  height: 10,
                ),
                const TextField(),
                const TitleSection(title: 'Categorias'),
                Container(
                    margin: const EdgeInsets.all(10),
                    height: 120,
                    child: ListView(
                      scrollDirection: Axis.horizontal,
                      children: [
                        ButtonMenu(
                            action: () {},
                            buttonName: 'Vestuário',
                            icon: Icons.store_mall_directory_rounded),
                        ButtonMenu(
                            action: () {},
                            buttonName: 'Jogos',
                            icon: Icons.sports_esports_outlined),
                        ButtonMenu(
                            action: () {},
                            buttonName: 'Vouchers',
                            icon: Icons.feed_outlined),
                        ButtonMenu(
                            action: () {},
                            buttonName: 'Moskelines',
                            icon: Icons.menu_book_outlined),
                        ButtonMenu(
                            action: () {},
                            buttonName: 'Blusas',
                            icon: Icons.paid_outlined),
                      ],
                    )),
                Container(
                  margin: const EdgeInsets.all(10),
                  height: MediaQuery.of(context).size.height,
                  child: BlocBuilder&lt;ProductsBloc, ProductsState&gt;(
                    bloc: bloc,
                    builder: (context, state) {
                      final state = bloc.state;
  
                      if (state is ProductInicialState) {
                        return const Center(
                          child: CircularProgressIndicator(),
                        );
                      } else if (state is ProductSuccessState) {
                        final productsList = state.products;
                        return GridView.builder(
                          gridDelegate:
                              const SliverGridDelegateWithFixedCrossAxisCount(
                            childAspectRatio: 0.7,
                            crossAxisCount: 2,
                            crossAxisSpacing: 10,
                            mainAxisSpacing: 10,
                          ),
                          itemCount: productsList.length,
                          itemBuilder: (context, index) {
                            final item = productsList[index];
                            return ProductDisplay(
                                productEntity: productsList[index],
                                icon: Icons.store_mall_directory_rounded,
                                productName: item.productName,
                                action: () {});
                          },
                        );
                      } else {
                        return Container();
                      }
                    },
                  ),
                ),
                const TitleSection(title: 'Produtos'),
              ],
            ),
          )),
        ),
      );
    }
  }
  </code></pre>
  <p>My Bloc code is:</p>
  <pre><code>import 'package:bloc/bloc.dart';
  
  import 'package:ConfidentialName/domain/usecases/get_all_products_usecase.dart';
  
  import 'products_event.dart';
  import 'products_state.dart';
  
  class ProductsBloc extends Bloc&lt;ProductsEvent, ProductsState&gt; {
    final GetAllProductsUsecase usecase;
  
    ProductsBloc(
      this.usecase,
    ) : super(ProductInicialState()) {
      on&lt;LoadProductsEvent&gt;((event, emit) async {
        final result = await usecase.getAllProducts();
        result.fold((l) =&gt; emit.call(ProductErrorState(l)),
            (list) =&gt; emit.call(ProductSuccessState(list)));
      });
    }
  }
  </code></pre>
  <p>I'm not understanding why this error being occur</p>