getDeviceId method

String getDeviceId()

Gets the device ID option formatted for command-line usage.

Returns:

  • '--device-id value' if the option is provided
  • Empty string if the option is not provided

Example:

final deviceIdFlag = argResults.getDeviceId();
// Returns '--device-id emulator-5554' or ''

Implementation

String getDeviceId() =>
    this?['device-id'] != null ? '--device-id ${this?['device-id']}' : '';