How to install and use event_bus with Flutter 3.10.5

A popular Flutter package with 532 likes that support Flutter version 3.10.5 and above. Last version of the package was published on Jul 28, 2023.

Installing event_bus

You can either add the package directly using the flutter command line.

$ flutter pub add event_bus

Or add the dependency directly to your pubspec.yaml file.
dependencies:
  event_bus: ^2.0.0

In either case, make sure to refresh your packages by running the following command:

$ flutter pub get

Using event_bus

Once you have installed the package, you can use it in your Flutter application by importing it.
import 'package:event_bus/event_bus.dart';