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

Libraries

flutter_net_promoter_score
net_promoter_score_result
nps_feedback_widget
nps_select_score_widget
nps_survey_page
nps_survey_texts
nps_thank_you_widget
promoter_type