app feedback
a flutter package for getting app feedback from users. it provides the utility to display feedback form depending upon the requirement. feedback form can be displayed instantly at any time or after certain period of time.
download demo app
how to use this package
1. add library to pubspec.yml
dependencies:
app_feedback: ^0.0.2
2. import library in dart file.
import 'package:app_feedback/app_feedback.dart';
3. create a instance of appfeedback
appfeedback feedbackform = appfeedback.instance;
4. initialize the app feedback (ony if you want to ask user for his feedback periodically)
@override
void initstate() {
/// `duration` is set to 10 seconds for testing purpose.
/// change this duration on the basis of how often you want to ask user for his feedback.
/// for example duration can be 15 days, 1 or 2 month etc.
feedbackform.init(feedbackconfig(duration: duration(seconds: 10)));
super.initstate();
}
5. create a method which will launch the feedback form
void trydisplay() {
feedbackform.trydisplay(context, onsubmit: (userfeedback feedback) {
print(feedback);
});
}
6. create a button to call trydisplay
method.
textbutton(
onpressed: trydisplay,
child: text("try display form")
),
note
feedbackform
will only be displayed once provided duration in step 3 has passed.- once
feedbackform
is displayed then it won’t be displayed until the next cycle of the duration is completed.- the
config
data provided in first time initialization offeedbackform
is stored in local cache and other initialization data will be ignored.
7. clear old configuration
invoke clearconfig
method only if there is a need to clear the old config
values otherwise ignore this.
void clearconfig() async {
await feedbackform.clearconfig();
}
note
- after clearing the configuration it won’t be display the feedback form ever until new initialization.
- clear configuration form doesn’t mean reset the duration cycle. it just removes the all configuration from the cache.
- to reset duration and other configuration do call the
feedbackform.init()
method with newconfig
values.
display instant feedbackform
if there is a need to display feedbackform
instantly on any time then invoke feedbackform.display
method.
by calling this method won’t reset the duration cycle provided in above step 3.
to invoke below method there is no need to initialize the feedbackform
.
void launchappfeedback() {
feedbackform.display(context,
option: option(
maxrating: 10,
ratingbuttontheme: ratingbuttonthemedata.defaulttheme,
), onsubmit: (feedback) {
print(feedback);
});
}
feedback form | customised rating button | customised rating button |
---|---|---|
hidden feedback field | customised feedback form | customised feedback form |
---|---|---|
other flutter packages
name | stars | pub |
---|---|---|
filter list | ||
empty widget | ||
add thumbnail | ||
country provider |
Comments are closed.