
我想實作與在 Play 商店中找到的類似的東西。哪些小部件/包可以幫助我實作這一目標?
uj5u.com熱心網友回復:
它正在使用TabBar,只需您可以使用DefaultTabController來處理它。
來自檔案的示例
Widget build(BuildContext context) {
return DefaultTabController(
initialIndex: 1,
length: 3,
child: Scaffold(
appBar: AppBar(
title: const Text('TabBar Widget'),
bottom: const TabBar(
tabs: <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
],
),
),
body: const TabBarView(
children: <Widget>[
Center(
child: Text("It's cloudy here"),
),
Center(
child: Text("It's rainy here"),
),
Center(
child: Text("It's sunny here"),
),
],
),
),
);
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/362194.html
