setVersion static method

Future<void> setVersion(
  1. String? version
)

Manually stores the version of your application to be transmitted with each message, for version filtering. This is normally read from your pubspec.yaml or passed in on init(); this is only provided as a convenience.

version The version of your application, format x.x.x.x, where x is a positive integer.

Implementation

static Future<void> setVersion(
  String? version,
) async {
  if (version != null) {
    Settings.version = version;
  } else {
    final info = await PackageInfo.fromPlatform();
    Settings.version = info.version;
  }
}