how to clear state of bloc in flutter
  In Flutter, you can clear the state of a bloc by calling the `clear()` method on the bloc instance. Here are a few ways to clear the state of a bloc:

1. Using the `clear()` method:
```
class MyBloc {
  //...

  void clear() {
    _myState = initialState;
  }

  //...
}
```
Then, in your widget tree, you can call the `clear()` method when you want to reset the bloc to its initial state:
```
MyBloc().clear();
```
2. By setting the `_myState` field directly:
```
class MyBloc {
  //...

  _myState = initialState;

  //...
}
```
This approach is similar to the first one, but it allows you to set the state directly without calling the `clear()` method.

3. By using a `BlocSupervisor` and calling `reset()`:
```
class MyBloc extends Bloc<MyEvent, MyState> {
  //...

  @override
  void reset() {
    _myState = initialState;
  }

  //...
}

//...

BlocSupervisor().addBloc(MyBloc());
```
This approach is useful
To clear the state of a Bloc in Flutter, you can use the clear method. For example, to clear the state of a BlocUser, you can call the clear method with no arguments. This will reset the state of the Bloc and all of its children.