Giter VIP home page Giter VIP logo

Comments (6)

Bader-Al avatar Bader-Al commented on June 26, 2024

I had the same issue and found two solutions.. however, the second one destroyed the drag of a DraggableBottomSheet I have in my app.. So i stuck to the first one

1 - just wrap the onChanged function with WidgetsBinding as such :

WidgetsBinding.instance.addPostFrameCallback((_){

  // Add Your Code here.

});

2- the other method is to use SchedulerBinding :

SchedulerBinding.instance.addPostFrameCallback((_) {

  // add your code here.
});

from lite_rolling_switch.

Bader-Al avatar Bader-Al commented on June 26, 2024

Incase you'd like to see where i found those solutions :
https://stackoverflow.com/questions/47592301/setstate-or-markneedsbuild-called-during-build

from lite_rolling_switch.

MasterNeuromancer avatar MasterNeuromancer commented on June 26, 2024

Thanks @Bader-Al , I will look into that!

from lite_rolling_switch.

rodrigobastosv avatar rodrigobastosv commented on June 26, 2024

I just made a PR to solve this issue.

#6

from lite_rolling_switch.

Huzaifa2019 avatar Huzaifa2019 commented on June 26, 2024

Thank you so much

from lite_rolling_switch.

0ne0rZer0 avatar 0ne0rZer0 commented on June 26, 2024

I was having the same problem what i did was add an if condition inside the _determine() function (as it is called during initState)
if (changeState) widget.onChanged(turnState);

from lite_rolling_switch.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.