getUnsupportedMessage static method

String getUnsupportedMessage(
  1. MediasfuFeature feature, {
  2. bool includeAlternatives = true,
})

Returns a user-friendly message for when a feature is not supported.

feature - The feature that is not supported. includeAlternatives - If true, includes information about alternative platforms.

Implementation

static String getUnsupportedMessage(
  MediasfuFeature feature, {
  bool includeAlternatives = true,
}) {
  final featureName = _getFeatureName(feature);
  final supportedPlatforms = getSupportedPlatforms(feature);

  if (includeAlternatives && supportedPlatforms.isNotEmpty) {
    final platformsString = supportedPlatforms.join(', ');
    return '$featureName is not available on $platformName. '
        'This feature is only supported on: $platformsString.';
  }

  return '$featureName is not available on $platformName.';
}