【发布时间】:2020-12-14 10:33:12
【问题描述】:
更新 Flutter 环境后,我遇到了这个问题。请帮我解决这个问题。
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 4,
child: Scaffold(
appBar: topBar(),
body: TabBarView( // problem indicates here
children: _kTabPages,
controller: _tabController,
),
// Button Navigation
bottomNavigationBar: Material(
color: Colors.redAccent,
child: TabBar(
tabs: _kTabs,
controller: _tabController,
),
)),
);
}
请尽快帮助我。
【问题讨论】:
-
看起来您在课堂上使用的是
AnimationController,而没有使用SingleTickerProviderStateMixin。 -
我已经用过了。但也有问题
class _DashboardPageState extends State<DashboardPage> with SingleTickerProviderStateMixin { AnimationController _controller; -
在创建
AnimationController的新实例时,您需要将this作为vsync传递。喜欢_controller = AnimationController(duration: Duration(seconds: 5), vsync: this); -
_controller = AnimationController(vsync: this);此垂直同步属性在更新后不起作用。 -
not work after updation是什么意思?
标签: flutter flutter-layout flutter-animation flutter-test