【发布时间】:2019-02-24 17:49:26
【问题描述】:
我的目标是在默认情况下限制过度滚动的页面上实现滚动。这是由flutter 上的AlwaysScrollableScrollPhysics 类实现的,但我无法找到有关其实现的适当资源。
以下是我想要实现此功能的其中一个页面的代码 - 但请注意,我在滚动功能方面遇到了复杂问题。我试过Scrollable 和SingleChildScrollView,两者都给出错误“位置参数太多”)。据我所知,问题在于我正在使用列来实现这一点,这不是正确的方式。
任何关于整个问题的帮助或指示将不胜感激。
body: Container(
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Header(),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 10),
child: Text(
'Some Exam',
style: TextStyle(
fontSize: 15,
fontFamily: 'GoogleMedium',
color: Colors.black54),
),
),
Subject(
iconData: OMIcons.supervisorAccount,
title: 'English',
msg: 'Difficulty Level: Easy',
count: '145',
colors: Color(0xff1a73e8),
),
Subject(
iconData: OMIcons.forum,
title: 'Chinese',
msg: 'Score 25 more to become an expert!',
count: '475',
colors: Color(0xff8024cd),
),
Subject(
iconData: OMIcons.forum,
title: 'Analytical',
msg: 'Good improvement!',
count: '123 in 4 days',
colors: Color(0xff8024cd),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 10),
child: Text(
'ACTIVE FRIENDS',
style: TextStyle(
fontSize: 15,
fontFamily: 'GoogleMedium',
color: Colors.black54),
),
),
activeFriend(
sender: "Another Name",
title: "Just an Exam",
time: "3 seconds ago",
studied: "Bangla",
),
activeFriend(
sender: "Difficult Guy",
title: "An Exam",
time: "18 minutes ago",
studied: "Analytical",
)
],
),
),
【问题讨论】: