showAppReviewSheet static method

Future<void> showAppReviewSheet(
  1. BuildContext context,
  2. String defaultUrl
)

Implementation

static Future<void> showAppReviewSheet(
  BuildContext context,
  String defaultUrl,
) async {
  // await Future.delayed(Duration(seconds: 1));
  final ApLocalizations app = ApLocalizations.of(context);
  showModalBottomSheet(
    context: context,
    builder: (BuildContext context) => Column(
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        Padding(
          padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
          child: Align(
            child: Text(
              app.ratingDialogTitle,
              style:
                  TextStyle(color: ApTheme.of(context).blue, fontSize: 20.0),
            ),
          ),
        ),
        RichText(
          textAlign: TextAlign.center,
          text: TextSpan(
            style: TextStyle(
              color: ApTheme.of(context).grey,
              height: 1.3,
              fontSize: 18.0,
            ),
            children: <TextSpan>[
              TextSpan(text: app.ratingDialogContent),
            ],
          ),
        ),
        Row(
          mainAxisAlignment: MainAxisAlignment.end,
          children: <Widget>[
            TextButton(
              onPressed: () {
                Navigator.of(context).pop();
              },
              child: Text(
                app.later,
                style: TextStyle(
                  color: ApTheme.of(context).blue,
                  fontSize: 16.0,
                ),
              ),
            ),
            TextButton(
              onPressed: () => openAppReview(defaultUrl: defaultUrl),
              child: Text(
                app.rateNow,
                style: TextStyle(
                  color: ApTheme.of(context).blue,
                  fontSize: 16.0,
                ),
              ),
            ),
          ],
        ),
      ],
    ),
  );
}