create method

  1. @override
Probe? create(
  1. String type
)
override

Creates a new Probe of the specified type. Note that type should be one of the dataTypes that this package supports. Returns null if a probe cannot be created for the type.

Implementation

@override
Probe? create(String type) => switch (type) {
  DEVICE_INFORMATION => DeviceProbe(),
  APPLICATION_INFORMATION => ApplicationProbe(),
  FREE_MEMORY => MemoryProbe(),
  BATTERY_STATE => BatteryProbe(),
  TIMEZONE => TimezoneProbe(),
  APP_LIFECYCLE_EVENT => AppLifecycleProbe(),
  SCREEN_EVENT => (Platform.isAndroid) ? ScreenProbe() : null,
  HEARTBEAT => HeartbeatProbe(),
  _ => null,
};