Comments (5)
Hi,
the idea is that you open the 'SurveyKit' Widget via Navigation, e.g. by calling
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SurveyKit()),
);
After the Survey Navigator.pop(context) is called and you will go back to the Widget where you called Navigator.push.
Another way to control what happens after the Survey is finished is to override the onCloseSurvey
Method in the SurveyController.
from survey_kit.
Is it possible that the onCloseSurvey is called only when the survey is aborted? Finishing the survey seems to NOT call the onCloseSurvey Method. Is it possible to somehow change navigation behavior in this case?
My use case is to initiate the survey via a notification when the app is terminated. In this case, after finishing the survey
Navigator.pop() results in a black screen (since the stack is empty I guess). Hence, I would like to redirect to the home page instead of poping.
from survey_kit.
Hi sorry for the late response.
It is true onCloseSurvey is only called when the survey is aborted. One way to change the behaviour/navigation, when the survey is finished, is to override the 'onResult' Function in SurveyKit. There you can listen when and why the survey was finished (finished,discarded,...) and do the navigation.
from survey_kit.
Hi sorry for the late response.
It is true onCloseSurvey is only called when the survey is aborted. One way to change the behaviour/navigation, when the survey is finished, is to override the 'onResult' Function in SurveyKit. There you can listen when and why the survey was finished (finished,discarded,...) and do the navigation.
Hi, thanks for the contribution. How can the onResult callback be overridden?
from survey_kit.
You can just override this in the 'SurveyKit' widget:
SurveyKit(
onResult: (SurveyResult result) {
print(result.finishReason);
},
....
from survey_kit.
Related Issues (20)
- How to use Padding to show questions?
- Get ordered type from json file.
- I wish there was a function to reset the result value.
- Add support for navigating back when initial step is present
- How to have EDIT functionality in the form?
- added this dep and ran the project this error pops up ? HOT 1
- Years of the calendar are not showing with flutter version 3.10 (stable) HOT 1
- Example not working HOT 1
- Navigate to next question without using next button HOT 2
- BooleanAnswerView isOptional not functioning as expected. HOT 1
- Update survey default values with data from DB when filling survey HOT 4
- SurveyResult toJson HOT 3
- Web error "UnsupportedError: Unsupported operation: Platform._operatingSystem"
- Completion Step when loaded from json file HOT 1
- json schema validation
- Breaking Changes
- Controller's length property (19) does not match the number of children (37) present in TabBarView's children property. HOT 1
- Results not publishing on stepBack and stepForward HOT 5
- Instance of text choice
- Localization to next text doesn't work HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from survey_kit.