We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android, iOS
我看例子也没有对WaterfallFlow的使用,调用了jumpTo方法,但是界面上面一点响应都没有
ScrollController scrollController = ScrollController(); SliverObserverController gridObserverController = SliverObserverController(controller: scrollController);
ScrollController scrollController = ScrollController();
SliverObserverController gridObserverController = SliverObserverController(controller: scrollController);
Widget createList() { return SliverViewObserver( controller: gridObserverController, child: WaterfallFlow.builder( controller: scrollController, itemCount: state.length, padding: EdgeInsets.symmetric(horizontal: 10.w), gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount( crossAxisCount: 2, mainAxisSpacing: 2.w, crossAxisSpacing: 2.w, ), itemBuilder: (BuildContext context, int index) { return GestureDetector( behavior: HitTestBehavior.deferToChild, onTap: () => _cardClick(context, index), child: Hero( tag: "$squareId:card:$index", child: SquareCard(state.squareId, state.getItem(index), index, _devicesClick, _heartLikeClick)), ); }, ), ); }
Widget createList() {
return SliverViewObserver(
controller: gridObserverController,
child: WaterfallFlow.builder(
controller: scrollController,
itemCount: state.length,
padding: EdgeInsets.symmetric(horizontal: 10.w),
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 2.w,
crossAxisSpacing: 2.w,
),
itemBuilder: (BuildContext context, int index) {
return GestureDetector(
behavior: HitTestBehavior.deferToChild,
onTap: () => _cardClick(context, index),
child: Hero(
tag: "$squareId:card:$index",
child: SquareCard(state.squareId, state.getItem(index), index,
_devicesClick, _heartLikeClick)),
);
},
}
`gridObserverController.jumpTo(index: state.currentIndex, renderSliverType: ObserverRenderSliverType.grid,);`
No response
The text was updated successfully, but these errors were encountered:
针对第三方滚动视图,需要告诉 scrollview_observer 如何处理观察
scrollview_observer
flutter_scrollview_observer/example/lib/features/scene/waterfall_flow_demo/waterfall_flow_page.dart
Lines 45 to 66 in a4794ef
Sorry, something went wrong.
LinXunFeng
No branches or pull requests
Platforms
Android, iOS
Description
我看例子也没有对WaterfallFlow的使用,调用了jumpTo方法,但是界面上面一点响应都没有
My code
ScrollController scrollController = ScrollController();
SliverObserverController gridObserverController = SliverObserverController(controller: scrollController);
Widget createList() {
return SliverViewObserver(
controller: gridObserverController,
child: WaterfallFlow.builder(
controller: scrollController,
itemCount: state.length,
padding: EdgeInsets.symmetric(horizontal: 10.w),
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 2.w,
crossAxisSpacing: 2.w,
),
itemBuilder: (BuildContext context, int index) {
return GestureDetector(
behavior: HitTestBehavior.deferToChild,
onTap: () => _cardClick(context, index),
child: Hero(
tag: "$squareId:card:$index",
child: SquareCard(state.squareId, state.getItem(index), index,
_devicesClick, _heartLikeClick)),
);
},
),
);
}
Try do it
No response
The text was updated successfully, but these errors were encountered: