FLUTTER ECOSYSTEM

oliverbytes/rating_dialog

Flutter के लिए एक सुंदर और कस्टमाइज़ करने योग्य स्टार रेटिंग डायलॉग पैकेज

rating_dialog प्रोजेक्ट कवर
Stars
40
Forks
31
अंतिम पुश (UTC)
27 अप्रैल 2023
प्रोजेक्ट स्थिति
सक्रिय
Oliver Martinez GitHub avatar
GITHUB User

Oliver Martinez ↗

Indie Hacker

@stackwares Internet
भाषाएँDartRubyHTMLSwiftShellKotlinObjective-C

इस रिपॉज़िटरी के पैकेज

उपयोग की गई निर्भरताएँ

निर्भरता सूची 3 आइटम
  • flutter{"sdk":"flutter"}
  • flutter_rating_bar^4.0.0
  • flutter_testडेवलपमेंट{"sdk":"flutter"}

मूल README

यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।

README खोलें / बंद करें

rating_dialog

A beautiful and customizable Rating Dialog package for Flutter! Supports all platforms that flutter supports!

https://github.com/nemoryoliver/rating_dialog/blob/master/demo.gif

Import the rating_dialog package

To use the rating_dialog plugin, follow the plugin installation instructions.

Use the package

Add the following import to your Dart code:

import 'package:rating_dialog/rating_dialog.dart';

We use the flutter's showDialog function to show our Rating Dialog

    final _dialog = RatingDialog(
      initialRating: 1.0,
      // your app's name?
      title: Text(
        'Rating Dialog',
        textAlign: TextAlign.center,
        style: const TextStyle(
          fontSize: 25,
          fontWeight: FontWeight.bold,
        ),
      ),
      // encourage your user to leave a high rating?
      message: Text(
        'Tap a star to set your rating. Add more description here if you want.',
        textAlign: TextAlign.center,
        style: const TextStyle(fontSize: 15),
      ),
      // your app's logo?
      image: const FlutterLogo(size: 100),
      submitButtonText: 'Submit',
      commentHint: 'Set your custom comment hint',
      onCancelled: () => print('cancelled'),
      onSubmitted: (response) {
        print('rating: ${response.rating}, comment: ${response.comment}');

        // TODO: add your own logic
        if (response.rating < 3.0) {
          // send their comments to your email or anywhere you wish
          // ask the user to contact you instead of leaving a bad review
        } else {
          _rateAndReviewApp();
        }
      },
    );

    // show the dialog
    showDialog(
      context: context,
      barrierDismissible: true, // set to false if you want to force a rating
      builder: (context) => _dialog,
    );

Example

See the example application source for a complete sample app using the rating_dialog package.

Issues and feedback

Please file issues to send feedback or report a bug. Thank you!