in_app_review_kmp 1.0.7 copy "in_app_review_kmp: ^1.0.7" to clipboard
in_app_review_kmp: ^1.0.7 copied to clipboard

Plugin that allows to launch in-app and in-market review flows. Build over KMP

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:in_app_review_kmp/in_app_review.dart';
import 'package:in_app_review_kmp/in_app_review_params.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';
  final _inAppReviewPlugin = InAppReview();

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  Future<void> initPlatformState() async {
    String platformVersion;
    try {
      platformVersion = await _inAppReviewPlugin
          .launchInMarketReview(
            InAppReviewParams(
              androidParams: AndroidParams(
                market: AndroidMarket.appGallery,
              ),
              iosParams: IOSParams(appStoreId: "12345"),
            ),
          )
          .then((value) => value.name);
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
    }

    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_platformVersion\n'),
        ),
      ),
    );
  }
}
3
likes
140
points
34
downloads

Publisher

unverified uploader

Weekly Downloads

Plugin that allows to launch in-app and in-market review flows. Build over KMP

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on in_app_review_kmp