【发布时间】:2019-12-13 20:01:14
【问题描述】:
我正在尝试在 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 到达末尾时,如何向 PageView 发送 onDrag 事件?
【问题讨论】: