layout - 如何将 pageView 添加到我的颤振 main.dart 代码中?
问题描述
我的应用程序在我的设备上完美运行,但是,在日志消息中,我收到一个错误,提示需要 pageView。 这是我刷卡时遇到的错误。所以我希望有人能帮我解决这些我每次在设备上滑动时都会遇到的错误
void main()
{
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
.then((_) {
runApp(new MyApp());
});
}
class MyApp extends StatelessWidget
{
@override
Widget build(BuildContext context)
{
final tabController = new DefaultTabController(
length: 4 ,
child: new Scaffold(
appBar: new AppBar(
backgroundColor: Colors.lightGreen,
title: new Text("Discover Zambia"),
bottom: new TabBar(
indicatorColor: Colors.red,
indicatorWeight: 4.0,
tabs: [
new Tab(icon: new Icon(Icons.home),text: "Home"),
new Tab(icon: new Icon(Icons.landscape),text: "Sights"),
new Tab(icon: new Icon(Icons.local_drink),text: "Nightlife"),
new Tab(icon: new Icon(Icons.restaurant),text: "Foods")
]),
),
body: new TabBarView(
children: [
new Home(),
new Sights(),
new Nightlife(),
new Foods()
]
),
));
return new MaterialApp(
debugShowCheckedModeBanner: false,
title: "",
home: tabController,
);
}
}
解决方案
推荐阅读
- javascript - 基于行中文本匹配的JQuery过滤器
- go - GO中的第二次scanf跳转扫描
- javascript - 如何将 kebab-case 转换为 PascalCase?
- java - 无法使用 Selenium(3.11)、GeckoDriver(0.24.0)、Firefox(57 版本)运行 selenium java 脚本
- sql - SQL server - 使用行窗口函数计算不同的函数或row_numer
- hadoop - Hive - 将叶节点的金额余额汇总到顶级父节点
- php - “无传输”错误将 html 联系表单提交到同一服务器上的 php 脚本
- angular - 使用指令查找元素
- java - TestFX clickOn() 在组合框/选择框上的特定文本上
- angular - Angular 测试中没有 $injector 的提供者