zeba_academy_feedback_survey 1.0.0
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!