adr_in_app_review 0.0.1 copy "adr_in_app_review: ^0.0.1" to clipboard
adr_in_app_review: ^0.0.1 copied to clipboard

A Flutter plugin for allowing users to submit review to playstore using google in app review api.

example/lib/main.dart

import 'package:adr_in_app_review/adr_in_app_review.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'In App Review Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'In App Review Demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  void testInAppReview() {
    Future.microtask(() async {
      AdrInAppReview.startInAppReview().then((value) => print('result $value')).catchError((e) {
        print(e.toString());
        // only to avoid crash when error happened and not being handled
      });
    });
  }


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from e it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
          // note: this is only used for testing purpose, don't trigger the in app review flow by active user action
          // it can exhaust your quota, for more info and best practice,
          // check here: https://developer.android.com/guide/playcore/in-app-review#when-to-request
          child: MaterialButton(
        onPressed: testInAppReview,
        child: Text(
          'Test In app review',
          style: TextStyle(color: Colors.white),
        ),
        color: Colors.blue,
      )),
    );
  }
}
2
likes
40
pub points
0%
popularity

Publisher

verified publishermuhrahmatullah.me

A Flutter plugin for allowing users to submit review to playstore using google in app review api.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on adr_in_app_review