我正在尝试在PageView中使用ScrollView来实现这种效果:
但是,当我滚动到第二页时,我被卡住了,无法返回了。
示例代码:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(
title: Text("Demo"),
),
body: PageView(
scrollDirection: Axis.vertical,
children:[
Container(color: Colors.red),
ListView(
children:[
Container(color: Colors.yellow, height:300),
Container(color: Colors.green, height:300),
]
)
],
),
),
);
}
}
当ScrollView到达末尾时,如何将onDrag事件发送到PageView?
答案 0 :(得分:0)
listview不能与pageviewer一起使用,因此请使用wrap Widget而不是listview,
Group{
ForEach(circleArray) { wordArray in
Text("\(wordArray.words)")
.animation(Animation.easeInOut.delay(0.5))
}
Text("like")
.animation(Animation.easeInOut.delay(0.5))
Text("This")
.animation(Animation.easeInOut.delay(1))
}.frame(width: UIScreen.main.bounds.width)