flutter_net_promoter_score 1.0.0

Flutter Android iOS web

Simple Flutter component that presents Net Promoter Score (NPS) survey.

Flutter Net Promoter Score #

A Flutter component that presents Net Promoter Score (NPS) survey.

Features #

  • Show Net Promoter Score survey
  • Get user interactions call backs (such as score changes and feedback input)
  • Get final survery result with Score, Promoter type and feedback text
  • Support flutter themes to customize look and feel
  • Customize all texts with your own textss

Table of contents #

How to use #

Installation #

Add flutter_net_promoter_score to your project dependencies

dependencies:
  flutter_net_promoter_score:

Show the survey #

Import flutter_net_promoter_score

import 'package:flutter_net_promoter_score/flutter_net_promoter_score.dart';

In order to show the survery call the function showNetPromoterScore and provide the required parameters.

Example:

  void _showNPS() {
    showNetPromoterScore(
      context: context,
      texts: NpsSurveyTexts(
        selectScorePageTexts: NpsSelectScorePageTexts(
          surveyQuestionText:
              "How likely are you to recommend flutter_net_promoter_score to a friend or colleague?",
        ),
      ),
      onSurveyCompleted: (result) {
        print("NPS Completed");
        print("Score: ${result.score}");
        print("Feedback: ${result.feedback}");
        print("Promoter Type: ${result.promoterType}");
      },
      onClosePressed: () {
        print("User closed the survery");
      },
      onScoreChanged: (newScore) {
        print("User changed the score to $newScore");
      },
      onFeedbackChanged: (newFeedback) {
        print("User change the feedback to $newFeedback");
      },
      thankYouIcon: Icon(
        Icons.thumb_up,
      ),
      theme: ThemeData.dark()
    );
  }

Customize texts #

You can customize the texts with your own texts by passing the text parameter. The text parameter contains the following members. Change this members to set you own texts.

  • selectScorePageTexts- Controls the first view texts: "Select Score" .
  • feedbackPageTexts - Controls the second view texts: "Feedback".
  • thankYouPageTexts - Controls the last view texts: "Thank You".

Theming #

flutter_net_promoter_score supports Flutter's themes and gets its look and feel by the app's default Theme style. To customize the look and feel with your favorite appearance you can use the theme parameter and change it according to the following parameters:

AttributesTypeDescription
cardColorColorChange Background Color
textTheme.captionTextStyleLabels style
textTheme.subtitle2TextStyleQuestions and titles style
bodyText1.bodyText1TextStyleScore numbers text style
textTheme.buttonTextStyleButtons text style
sliderTheme.thumbColorColorSelected score color
buttonColorColorButtons background color
focusColorColortext field background color
backgroundColorColorScore slider background color
sliderTheme.activeTickMarkColorColorScore slider unselected dots color
iconThemeIconThemeDataClose button icon and default thank you icon IconThemeData
hintColorColorFeedback field hint text color

Change Log #

See Change Log page.

Contribution #

Please file feature requests and bugs at the issue tracker.

Author #

Tomer Shalom

2
likes
85
pub points
66%
popularity

Publisher

applitom.com

Simple Flutter component that presents Net Promoter Score (NPS) survey.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, flutter_score_slider

More

Packages that depend on flutter_net_promoter_score