【appbar导航】大鹏一日同风起,扶摇直上九万里。这篇文章主要讲述appbar导航相关的知识,希望能为你提供帮助。
import ‘package:flutter/material.dart‘;
import ‘dart:ui‘;
void main()=> runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State< HomePage> with SingleTickerProviderStateMixin{
TabController _controller;
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
void initState() {
super.initState();
_controller = TabController(length: 3, vsync: this);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(‘Run for better future‘),
bottom:TabBar(
tabs: < Widget> [
Tab(icon: Icon(Icons.accessibility),),
Tab(icon: Icon(Icons.description),),
Tab(icon: Icon(Icons.accessibility_new),),
],
controller: _controller,
),
),
body: TabBarView(
controller: _controller,
children: < Widget> [
Center(
child: Text(
‘Realize your value with your life‘,
style: TextStyle(
color: Colors.green,
fontWeight: FontWeight.bold,
fontSize: 26,
),
),
),
Center(
child: Text(
‘Play hard work hard‘,
style: TextStyle(
color: Colors.green,
fontWeight: FontWeight.bold,
fontSize: 26,
),
),
),
Center(
child: Text(
‘Magic of everthing is hope‘,
style: TextStyle(
color: Colors.green,
fontWeight: FontWeight.bold,
fontSize: 26,
),
),
),
],
),
);
}
}
推荐阅读
- Android OpenCV集成摄像头图片动态识别车牌号
- 关于Android的app权限申请问题
- IDEA spirng boot @Autowired注解 mapper出现红色下划线解决方法
- Android Studio [RecyclerView/瀑布流显示]
- Android 8.1 修改默认通知声
- APP测试思路
- Android Studio [RecyclerView/列表视图]
- xamarin Android Timer
- SSM——[/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException