当前位置:网站首页>Shutter tabbarview component
Shutter tabbarview component
2022-06-21 20:40:00 【xiangxiongfly915】
List of articles
Flutter TabBarView Components
sketch
TabBarView yes Material Component library provides Tab Layout components , Usually and TabBar In combination with .
TabBarView Encapsulates the PageView, It's very simple to use .
Basic attributes
TabBarView
controller:TabBarView controller .
children: Subelement .
TabBar
tabs A series of label controls
controller Tab select change controller
isScrollable Scrollable or not , Default false
indicatorColor Indicator color
indicatorWeight Indicator thickness
indicator Indicator , Customizable shapes and other styles
indicatorSize Indicator length ,tab: and tab As long as ,label: And labels label As long as
labelColor Label color
labelStyle Label style
labelPadding label padding
unselectedLabelColor Label color is not selected
unselectedLabelStyle Label style is not selected
Easy to use

class TabBarViewPage extends StatefulWidget {
const TabBarViewPage({Key? key}) : super(key: key);
@override
State<StatefulWidget> createState() {
return _TabBarViewPageState();
}
}
class _TabBarViewPageState extends State<TabBarViewPage> with SingleTickerProviderStateMixin {
final List tabs = ["One", "Two", "Three", "Four", "Five", "Six", "Seven"];
late TabController _controller;
@override
void initState() {
_controller = TabController(length: tabs.length, vsync: this);
super.initState();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("TabBarView & PageView"),
bottom: TabBar(
indicatorColor: Colors.red,
controller: _controller,
isScrollable: true,
tabs: tabs.map((e) {
return Tab(text: e);
}).toList(),
),
),
body: TabBarView(
dragStartBehavior: DragStartBehavior.down,
controller: _controller,
children: tabs.map((e) {
return Container(
alignment: Alignment.center,
child: Text(e, textScaleFactor: 3),
);
}).toList(),
),
);
}
}
边栏推荐
- 起飞,年薪40万+
- Analysis of ${} string splicing in JS
- Zabbix6.0+timescaledb+ enterprise wechat alarm
- Deep learning image data enhancement
- Software testing office tools recommendation - Desktop Calendar
- SQL教程之6种鲜为人知的 SQL 技术,可帮助您每月节省 100 小时
- 亿腾医药在港招股书第三次“失效”:上市实质延后,红杉等为股东
- TX9116同步升压ic
- How MySQL implements grouping sum
- Flink CDC MongoDB Connector 的实现原理和使用实践
猜你喜欢

高度可扩展,EMQX 5.0 达成 1 亿 MQTT 连接

粗读Targeted Supervised Contrastive Learning for Long-Tailed Recognition

贪吃蛇游戏项目完整版

Servlet使用

JVM memory structure

吴军给大学生的书单

【基于合泰HT32F52352的智慧垃圾桶总结】

Harbor high availability cluster design and deployment (practice + video), based on offline installation

Point cloud to depth map: conversion, saving, visualization

YB5212A充电IC充电芯片sop8
随机推荐
Sd6.20 summary of intensive training
SD6.20集训总结
机器学习之数据处理与可视化【鸢尾花数据分类|特征属性比较】
阿里云 ACK One、ACK 云原生 AI 套件新发布,解决算力时代下场景化需求
Oracle Flashback和RMAN示例
Flutter PageView组件
2022-06-20
点云转深度图:转化,保存,可视化
FM5012D小风扇集成ic方案
Problems caused by redis caching scenario
集成公告|Anima协议上线Moonbeam
How to debug reorganization in jetpack compose
【微信小程序】协同工作和发布 数据绑定
决策树(Decision Tree)学习笔记
JVM memory structure
散户买基金哪个平台最好最安全
Redis 做缓存场景引发的问题
Snake game project full version
营收利润“此消彼长”,水滴在阵痛中转身
How to implement chat robot in naturallanguageprocessing?