https://api.flutter.dev/flutter/material/TabBar-class.html?_gl=1*11ylmqa*_ga*MTAzODg4NTk4OS4xNzIyMjExNzI2*_ga_04YGWK0175*MTcyMjMwMjMwNC40LjEuMTcyMjMwMjMyMC4wLjAuMA..
import 'package:flutter/material.dart';
/// Flutter code sample for [TabBar].
void main() => runApp(const TabBarApp());
class TabBarApp extends StatelessWidget {
const TabBarApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("앱바자리")),
body: Column(
children: [
Container(
height: 300,
color: Colors.yellow,
),
Expanded(
child: DefaultTabController(
length: 2,
child: Column(
children: [
TabBar(
tabs: [
Tab(icon: Icon(Icons.car_crash)),
Tab(icon: Icon(Icons.car_repair)),
],
),
Expanded(
child: TabBarView(
children: [
Container(color: Colors.red),
Container(color: Colors.blue),
],
),
),
],
),
),
),
],
),
);
}
}