Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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] panel

Supported 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
## Melos

Install
```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`