openGooglePlay static method Null safety

Future<String> openGooglePlay(
  1. {String? fallbackUrl}
)

Open in GooglePlay

Implementation

static Future<String> openGooglePlay({String? fallbackUrl}) async {
  final bundle = await getBundleName() ?? '';
  final markerUrl = 'market://details?id=$bundle';

  if (await canLaunch(markerUrl)) {
    debugPrint('launching store page');
    launch(markerUrl);
    return 'Launched Google Play Directly: $bundle';
  }

  if (fallbackUrl != null) {
    launch(fallbackUrl);
    return 'Launched Google Play via $fallbackUrl';
  }

  launch('https://play.google.com/store/apps/details?id=$bundle');
  return 'Launched Google Play: $bundle';
}