question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature background disapear randomly on addPostFrameCallback

See original GitHub issue

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.

Imgur

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);
    });
}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
kashlocommented, Dec 23, 2020

Same problem version: “0.13.0”

1reaction
EliuTimanacommented, Apr 1, 2020

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();
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Background image keeps disappearing - Stack Overflow
My background images keep disappearing. They disappear at random times. I can temporarily fix it by rewriting the code (not just ...
Read more >
Flutter dialog position - Caritas Castellaneta
It creates a Positioned object with a default value set to 0. In there, add a Flutter app that demonstrates how to use...
Read more >
Desktop background randomly disappears when refresh the ...
Original Title: [Windows 8.1] My background keeps disappearing and coming back So I have Windows 8.1 and I don't know what's causing it, ......
Read more >
Flutter dialog position - cittafamiglia.it
Before adding Dialog you must call showDialog function to change current screen state ... a dialog's position, size and background? flutter flutter-layout.
Read more >
How to Prevent Disappearing Wallpaper
If you find that your Windows wallpaper periodically disappears, there are two likely explanations. The first is that the "Shuffle" feature for the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found