Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/goxiaoy/flutter_survey_js
Flutter client library for parsing and display surveyjs.io survey
https://github.com/goxiaoy/flutter_survey_js
Last synced: 3 months ago
JSON representation
Flutter client library for parsing and display surveyjs.io survey
- Host: GitHub
- URL: https://github.com/goxiaoy/flutter_survey_js
- Owner: goxiaoy
- License: mit
- Created: 2021-05-21T08:38:49.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-16T13:44:43.000Z (8 months ago)
- Last Synced: 2024-10-15T00:27:29.281Z (4 months ago)
- Language: Dart
- Homepage: https://goxiaoy.github.io/flutter_survey_js/
- Size: 52.8 MB
- Stars: 16
- Watchers: 3
- Forks: 17
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# flutter_survey_js
Flutter package for parsing and display [surveyjs](https://surveyjs.io/) widgets
All these widgets and highly depend on [reactive_forms](https://pub.dev/packages/reactive_forms)
Live preview [https://goxiaoy.github.io/flutter_survey_js/](https://goxiaoy.github.io/flutter_survey_js/)
# IMPORTANT_NOTE
# This package has not fully tested, use at your own risk
Supported widgets:
- [x] checkbox
- [ ] tagbox
- [x] ranking
- [x] radiogroup
- [x] imagepicker
- [ ] buttongroup
- [x] dropdown
- [x] matrixdropdown
- [x] matrixdynamic
- [x] matrix
- [x] expression
- [x] text
- [x] comment
- [x] multipletext
- [x] html
- [x] image
- [x] empty
- [ ] file
- [x] rating
- [x] boolean
- [x] signaturepad
- [x] paneldynamic
- [x] panelSupported validator:
- [x] numericvalidator
- [x] textvalidator
- [ ] answercountvalidator
- [x] regexvalidator
- [x] emailvalidator
- [ ] expressionvalidator## Getting Started
```
flutter pub add flutter_survey_js
```Modify your main function
```dart
import 'package:flutter_survey_js/flutter_survey_js.dart' as s;
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await s.initSurvey();
runApp(
...
);
}
```**Web**:
add following script into `web/index.html`
```html...
```
**usage**:
```dart
import 'package:flutter_survey_js/flutter_survey_js.dart' as s;
...
const survey = {
"questions": [
{
"type": "rating",
"name": "satisfaction",
"title": "How satisfied are you with the Product?",
"mininumRateDescription": "Not Satisfied",
"maximumRateDescription": "Completely satisfied"
}
]
};
...
s.SurveyWidget(
survey: s.surveyFromJson(survey),
onChange: (v) {
print(v);
},
onSubmit: (v) {
print(v);
},
)```
## Customize
```dart
s.SurveyConfiguration(
unsupportedBuilder: ...,
...
child: s.SurveyWidget(
survey: s.surveyFromJson(survey),
onChange: (v) {
print(v);
},
onSubmit: (v) {
print(v);
},
)
)```
# Development
## MelosInstall
```shell
dart pub global activate melos
```
Bootstrap
```shell
dart pub global run melos bs
```## Test
### Before you run test
- Windows: `dart pub global run melos run build_windows`
- Linux: `dart pub global run melos run build_linux`
###
`dart pub global run melos run test`