Comments (6)
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.
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.
Thanks @Bader-Al , I will look into that!
from lite_rolling_switch.
I just made a PR to solve this issue.
from lite_rolling_switch.
Thank you so much
from lite_rolling_switch.
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)
- resizing of widget. HOT 5
- Intento redibujar el widget y no me lo permite HOT 1
- null-safety HOT 3
- Active icon is different size than inactive icon HOT 1
- Too big HOT 1
- How to update the value programatically HOT 4
- abandoned package? HOT 1
- Intl 0.18.0 HOT 3
- Disable animation without change
- How to update the value with Realtime Firebase HOT 4
- Icon not rotating!
- un required parameters is required
- License HOT 2
- Size of Icon can't be changed HOT 5
- [Request] Turn off rolling animation HOT 6
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 lite_rolling_switch.