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

This plugin exposes the native iOS APIs to ask the user to rate the app.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter_ios_store_rate/flutter_ios_store_rate.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool ratingAvailable = false;

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

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    bool isAvailable = await FlutterIosStoreRate.isAvailable;
  
    if(isAvailable) {
      FlutterIosStoreRate.requestReview();
    }
    setState(() {
      ratingAvailable = isAvailable;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Is Rating available: ${ratingAvailable ? 'Yes' : 'No'}\n'),
        ),
      ),
    );
  }
}
0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

This plugin exposes the native iOS APIs to ask the user to rate the app.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_ios_store_rate