'package:flutter/src/animation/animation_controller.dart':断言失败:第 246 行第 15 行:'vsync != null':不正确
'package:flutter/src/animation/animation_controller.dart': Failed assertion: line 246 pos 15: 'vsync != null': is not true
更新 Flutter Environment 后我遇到了这个问题。请帮我解决这个问题。
@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,
),
)),
);
}
请尽快帮助我。
在这个 github 问题之后:AnimationController has lost it's vsync,
您可以按照以下步骤解决问题:
1. Change minimum sdk to 2.8
2. Run flutter upgrade
3. Run flutter pub get
4. Run flutter clean
5. Restart IDE
更新 Flutter Environment 后我遇到了这个问题。请帮我解决这个问题。
@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,
),
)),
);
}
请尽快帮助我。
在这个 github 问题之后:AnimationController has lost it's vsync,
您可以按照以下步骤解决问题:
1. Change minimum sdk to 2.8
2. Run flutter upgrade
3. Run flutter pub get
4. Run flutter clean
5. Restart IDE