INNER CODE UNIT · Dart

MethodChannelInAppReview

britannio/in_app_review · in_app_review_platform_interface/lib/method_channel_in_app_review.dart:11

class MethodChannelInAppReview extends InAppReviewPlatform {
  MethodChannel _channel = MethodChannel('dev.britannio.in_app_review');
  Platform _platform = const LocalPlatform();

  @visibleForTesting
  set channel(MethodChannel channel) => _channel = channel;

  @visibleForTesting
  set platform(Platform platform) => _platform = platform;

  @override
  Future<bool> isAvailable() async {
    if (kIsWeb) return false;
    return _channel
        .invokeMethod<bool>('isAvailable')
        .then((available) => available ?? false, onError: (_) => false);
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…