app property

ServerApp? get app

Implementation

ServerApp? get app {
  if (apps.isEmpty) {
    throw Exception('No apps found');
  }

  final flavor = context.flavor;
  if ((flavor == null || flavor.isEmpty) && apps.length == 1) {
    return apps.first;
  }

  for (final app in apps) {
    if (app.appAnnotation.flavor == context.flavor) {
      return app;
    }
  }

  return null;
}