flutter_store_listing 0.1.1+2

  • Readme
  • Changelog
  • Example
  • Installing
  • 85

flutter_store_listing #

Flutter plugin to open store listings for iOS App Store and Google Play store and handle reviews, and on iOS ask for reviews using SKStoreReviewController

Usage #

see API Documentation for details: https://pub.dev/documentation/flutter_store_listing/latest/flutter_store_listing/FlutterStoreListing-class.html

void main() {
  // If available, display the review request dialog.
  // Does nothing when not on iOS.
  FlutterStoreListing().launchRequestReview(onlyNative: true);

  // Use URL Launcher to open play store / itunes store listing for review.
  FlutterStoreListing().launchStoreListing();
}

Notes #

Heavily based on https://github.com/AppleEducate/plugins/tree/master/packages/app_review

0.1.1+2 #

  • More documentation, updated links.
  • No longer a singleton, override app store id and android package name.
  • Add isSupported() methods.
  • Made API more consistent.
  • Added simple example.

0.1.0 #

  • First release

0.0.1 #

  • Initial version

example/lib/main.dart

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_store_listing/flutter_store_listing.dart';
import 'package:logging_appenders/logging_appenders.dart';

void main() {
  PrintAppender.setupLogging();
  runApp(MyApp());
}

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

class _MyAppState extends State<MyApp> {
  String _appId = 'unknown';
  bool _requestReviewSupported = false;
  final _fsl = FlutterStoreListing();

  @override
  void initState() {
    super.initState();
    (() async {
      if (Platform.isIOS) {
        _appId = await _fsl.getIosAppId() ?? 'app id not found';
      } else if (Platform.isAndroid) {
        _appId = await _fsl.getAndroidPackageName();
      }
      _requestReviewSupported = await _fsl.isSupportedNativeRequestReview();
      if (mounted) {
        setState(() {});
      }
    })();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Align(
          alignment: const Alignment(0, -0.3),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Text(_appId),
              RaisedButton(
                  child: const Text('Open Store Listing'),
                  onPressed: () async {
                    await _fsl.launchStoreListing();
                  }),
              if (_requestReviewSupported)
                RaisedButton(
                    child: const Text('Request Review'),
                    onPressed: () async {
                      await _fsl.launchRequestReview(onlyNative: true);
                    }),
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_store_listing: ^0.1.1+2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_store_listing/flutter_store_listing.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
70
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
85
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:flutter_store_listing/flutter_store_listing.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:flutter_store_listing/flutter_store_listing.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:flutter_store_listing/flutter_store_listing.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:flutter_store_listing/flutter_store_listing.dart that declares support for platforms: android, ios

Package not compatible with SDK dart

Because:

  • flutter_store_listing that is a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
http >=0.12.0+2 <1.0.0 0.12.1
logging >=0.11.3+2 <1.0.0 0.11.4
package_info >=0.4.0+4 <2.0.0 0.4.1
pedantic >=1.7.0 <2.0.0 1.9.0 1.9.2
url_launcher >=5.0.3 <6.0.0 5.5.0
Transitive dependencies
charcode 1.1.3
collection 1.14.12 1.14.13
flutter_web_plugins 0.0.0
http_parser 3.1.4
meta 1.1.8 1.2.2
path 1.7.0
platform_detect 1.4.0
plugin_platform_interface 1.0.2
pub_semver 1.4.4
sky_engine 0.0.99
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6 1.2.0
url_launcher_linux 0.0.1+1
url_launcher_macos 0.0.1+7
url_launcher_platform_interface 1.0.7
url_launcher_web 0.1.2
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test