nyEvent<T>  function 
 
Event helper
Implementation
Future<void> nyEvent<T>(
    {Map? params,
    Map<Type, NyEvent> events = const {},
    bool? broadcast}) async {
  assert(T.toString() != 'dynamic',
      'You must provide an Event type for this method.\nE.g. event<LoginEvent>({"User": "#1 User"});');
  Map<Type, NyEvent> appEvents = events;
  Nylo? nylo;
  if (Backpack.instance.read('nylo') != null) {
    nylo = Backpack.instance.read('nylo');
  }
  if (events.isEmpty && nylo != null) {
    appEvents = nylo.getEvents();
  }
  broadcast ??= nylo?.shouldBroadcastEvents();
  assert(appEvents.containsKey(T),
      'Your config/events.dart is missing this class ${T.toString()}');
  NyEvent nyEvent = appEvents[T]!;
  // Use the extension method
  await nyEvent.fireAll(params, broadcast: broadcast ?? false);
}