nps_survey 1.3.0 copy "nps_survey: ^1.3.0" to clipboard
nps_survey: ^1.3.0 copied to clipboard

A Flutter component designed to collect Net Promoter Scores (NPS) from users.

example/lib/main.dart

// ignore_for_file: avoid_print
import 'package:flutter/material.dart';
import 'package:nps_survey/nps_survey.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter nps_survey Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter nps_survey'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  void _displayPopup() {
    NPSSurvey().showNPSDialog(
        context: context,
        callback: (feedback, score) {
          print(feedback);
          print(score);
        });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: () {
            _displayPopup();
          },
          child: const Text("Display the nps_survey popup"),
        ),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
16
likes
150
points
41
downloads

Publisher

verified publishercobaltsign.com

Weekly Downloads

A Flutter component designed to collect Net Promoter Scores (NPS) from users.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on nps_survey