zeba_academy_feedback_survey 1.0.0 copy "zeba_academy_feedback_survey: ^1.0.0" to clipboard
zeba_academy_feedback_survey: ^1.0.0 copied to clipboard

Offline multi-question feedback survey package for Flutter

zeba_academy_feedback_survey #

A production-ready offline multi-question feedback survey package for Flutter. Collect, store, and export survey data efficiently in JSON or CSV formats, complete with ratings, sliders, and multiple-choice questions.


Features #

  • Offline-first surveys: Collect feedback even without an internet connection.
  • Multi-question support: Text, multiple-choice, rating, and slider questions.
  • Export-ready data: Export survey responses in JSON and CSV formats.
  • Hive-powered storage: Persistent local storage with Hive.
  • Customizable UI: Fully compatible with your app theme.
  • Easy integration: Simple API for submitting and retrieving surveys.

Installation #

Add the package to your pubspec.yaml:

dependencies:
  zeba_academy_feedback_survey:
    git:
      url: https://github.com/sufyanism/zeba_academy_feedback_survey.git

Then run:

flutter pub get

Usage #

Import package #

import 'package:zeba_academy_feedback_survey/zeba_academy_feedback_survey.dart';

Initialize Hive (usually in main.dart) #

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await HiveService.init();
  runApp(const MyApp());
}

Create a survey #

final survey = Survey(
  id: 'survey_001',
  title: 'User Feedback',
  questions: [
    Question(id: 'q1', questionText: 'Your Name?', type: QuestionType.text),
    Question(id: 'q2', questionText: 'Rate our app', type: QuestionType.rating),
    Question(id: 'q3', questionText: 'Choose your favorite feature', type: QuestionType.multipleChoice, options: ['UI', 'Performance', 'Support']),
    Question(id: 'q4', questionText: 'How satisfied are you?', type: QuestionType.slider),
  ],
);

Display survey form #

SurveyForm(
  questions: survey.questions,
  onSubmit: (answers) {
    // Save survey
    HiveService.saveSurvey(survey);

    // Export data
    final jsonData = SurveyExporter.toJson(survey);
    final csvData = SurveyExporter.toCsv(survey);

    print(jsonData);
    print(csvData);
  },
)

Retrieve saved surveys #

final allSurveys = HiveService.getAllSurveys();

Supported Question Types #

Type Description
text Single-line or multi-line text input
multipleChoice Select one option from multiple choices
rating Star rating (1-5)
slider Slider input for numeric range

Export Formats #

  • JSON: Suitable for API or local storage.
  • CSV: Easy to open in Excel or Google Sheets.
final json = SurveyExporter.toJson(survey);
final csv = SurveyExporter.toCsv(survey);

About Me #

✨ I’m Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects. You can learn more about me and my work at sufyanism.com or connect with me on Linkedin

Your all-in-one no-bloat hub! #

šŸš€ Explore cutting-edge resources in coding, tech, and development at zeba.academy and code.zeba.academy. Empower yourself with practical skills through curated directives, real-world projects, and hands-on experience. Level up your tech game today! šŸ’»āœØ

Zeba Academy is a learning platform dedicated to coding, technology, and development. āž” Visit our main site: zeba.academy
āž” Explore hands-on courses and resources at: code.zeba.academy
āž” Check out our YouTube for more tutorials: zeba.academy
āž” Follow us on Instagram: zeba.academy

Thank you for visiting!

0
likes
130
points
90
downloads

Documentation

API reference

Publisher

verified publisherzeba.academy

Weekly Downloads

Offline multi-question feedback survey package for Flutter

Homepage

License

GPL-3.0 (license)

Dependencies

csv, flutter, flutter_rating_bar, hive, hive_flutter, json_annotation, path_provider, provider

More

Packages that depend on zeba_academy_feedback_survey