Comments (9)
Hey, I was able to solve this by dispose/recreate
the wrapper widget of the swiper()
by giving a UniqueKey each time I was going to pass data to the swiper
.
the state is maintained in the parent widget, sample code:
MySwiperWrapper(key: UniqueKey(), images: images, ......)
class MySwiperWrapper extends StatefulWidget { ....... MySwiperWrapper ({ @required Key key, @required this.images, }) : super(key: key); ..... }
NOTE: it's not an efficient solution, but it works
@zeromaro, hope this helps you
from flutter_swiper.
Hey, was this issue fixed? As I face exactly same thing. I receive an error
ScrollController not attached to any scroll views. 'package:flutter/src/widgets/scroll_controller.dart': Failed assertion: line 110 pos 12: '_positions.isNotEmpty'
After I remove an item from Swiper.
Cheers
from flutter_swiper.
Same problem here ! You can avoid it by saving a reference to the SwiperController
and call its previous
method just before deleting the widget (Future.delayed()
may come handy...)
from flutter_swiper.
Actually, the problem occurs when deleting the first element as well, and I have no solution for that yet.
from flutter_swiper.
嵌套在CustomScrollView使用抛出异常,进行swiper count 判断,如果数量为空则不显示,数量不为空在显示 if (null == _swipers || _swipers.isEmpty) ? SizedBox() : _swiper() ;
from flutter_swiper.
Hey, I was able to solve this by
dispose/recreate
the wrapper widget of theswiper()
by giving a UniqueKey each time I was going to pass data to theswiper
.the state is maintained in the parent widget, sample code:
MySwiperWrapper(key: UniqueKey(), images: images, ......)
class MySwiperWrapper extends StatefulWidget { ....... MySwiperWrapper ({ @required Key key, @required this.images, }) : super(key: key); ..... }
NOTE: it's not an efficient solution, but it works
@zeromaro, hope this helps you
it's worked,but i don't know why
from flutter_swiper.
Hey, I was able to solve this by dispose/recreate the wrapper widget of the swiper() by giving a UniqueKey each time I was going to pass data to the swiper.
the state is maintained in the parent widget, sample code:
MySwiperWrapper(key: UniqueKey(), images: images, ......)
class MySwiperWrapper extends StatefulWidget { ....... MySwiperWrapper ({ @required Key key, @required this.images, }) : super(key: key); ..... }
NOTE: it's not an efficient solution, but it works
It works....thank you so much
from flutter_swiper.
Hey, I was able to solve this by
dispose/recreate
the wrapper widget of theswiper()
by giving a UniqueKey each time I was going to pass data to theswiper
.the state is maintained in the parent widget, sample code:
MySwiperWrapper(key: UniqueKey(), images: images, ......)
class MySwiperWrapper extends StatefulWidget { ....... MySwiperWrapper ({ @required Key key, @required this.images, }) : super(key: key); ..... }
NOTE: it's not an efficient solution, but it works
@zeromaro, hope this helps you
this fixed my issue, as well. thanks!
from flutter_swiper.
I am using the SwipperController with the Swiper object and calling the move function, which was causing the "ScrollController not attached to any scroll views" exception. Adding a unique key to my Swiper object did not resolve the exception. What finally fixed the problem for me was setting the animation field to false when move is called: swiperController.move(provider.getCurrentActiveIndex(), animation: false);
from flutter_swiper.
Related Issues (20)
- swiperController.next() is swiping multiple pages
- hide side image if have 1 item only?
- 有适配空安全的计划吗 HOT 5
- 可以设置取消整页滚动吗
- weird random swipe when itemCount is dynamic HOT 1
- SliverList中放 10个 swiper 会出现相互影响的问题
- ScrollController
- How to autoplay cards towards right? HOT 2
- Scale down the gap between pages if viewportFraction is much smaller than 0.8 HOT 1
- 发现有个印度小伙抄袭作者,还上架了pub仓库 HOT 3
- 使用的 flutter 库已弃坑,或者长时间不维护,该怎么办 HOT 3
- inner stop notification
- How to reverse the scroll decoration while using CustomLayoutOption
- swiper滚动的时候如何可点击
- 滚动时间越久越卡顿
- The lower bound of "sdk: '>=2.0.0-dev.68.0 <3.0.0'" must be 2.12.0 or higher to enable null safety. HOT 3
- I found that it would automatically scroll several times the first time
- 这个项目停止维护了吗? HOT 1
- Reverse the order of cards shown in custom layout
- 怎么使swiper禁止上下滚动,只能左右滑动
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 flutter_swiper.