feature_discovery
feature_discovery copied to clipboard
Feature background disapear randomly on addPostFrameCallback
when I have multiple features to show up at my ap startup the first one's background disappears randomly, even if I restart the app, it works perfectly when I activate it with a button.
As you can see the feature's background disappears, I put a dark background to show you that the description text is there.
This is the result when I trigger the sequence with a button, everything OK.
Here is my code.
//helper class
class FeatureManager {
static const keyMenuSearch = 'key_menu_search';
static const keyButtonSearch = 'key_button_Search';
static const featuresSearch = {keyMenuSearch, keyButtonSearch};
}
@override
void initState() {
SchedulerBinding.instance.addPostFrameCallback((Duration duration) {
showFeatures();
});
super.initState();
}
void showFeatures() {
FeatureDiscovery.clearPreferences(context, FeatureManager.featuresSearch).then((_) {
FeatureDiscovery.discoverFeatures(context, FeatureManager.featuresSearch);
});
}
After several attempts I found that this fixes the problem, I don't know why, I'm not an expert, but for now, it solves the problem.
One-second custom duration worked, less than that won't work.
@override
void initState() {
SchedulerBinding.instance.addPostFrameCallback((Duration duration) {
Future.delayed(Duration(seconds: 1)).then((_) {
FeatureManager.showFeatures(context);
});
});
super.initState();
}
Could you please tell if the problem also occurs if you use version 0.7.0
of this package?
Could you please tell if the problem also occurs if you use version
0.7.0
of this package?
Nope, with 0.7.0
it works fine, but, what is the way to clear the preferences? I use the clearPreferences()
functions to restart all the features, it doesn't exists in previous versions.
Same problem version: "0.13.0"
The latest version has the same problem v0.14.0