49 lines
1.4 KiB
Dart
49 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:superport/screens/common/theme_tailwind.dart';
|
|
|
|
/// 메트로닉 스타일 탭 컨테이너 위젯 (SRP 분리)
|
|
class MetronicTabContainer extends StatelessWidget {
|
|
final List<String> tabs;
|
|
final List<Widget> tabViews;
|
|
final int initialIndex;
|
|
|
|
const MetronicTabContainer({
|
|
Key? key,
|
|
required this.tabs,
|
|
required this.tabViews,
|
|
this.initialIndex = 0,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return DefaultTabController(
|
|
length: tabs.length,
|
|
initialIndex: initialIndex,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Container(
|
|
decoration: const BoxDecoration(
|
|
border: Border(
|
|
bottom: BorderSide(color: Color(0xFFE5E7EB), width: 1),
|
|
),
|
|
),
|
|
child: TabBar(
|
|
tabs: tabs.map((tab) => Tab(text: tab)).toList(),
|
|
labelColor: AppThemeTailwind.primary,
|
|
unselectedLabelColor: AppThemeTailwind.muted,
|
|
labelStyle: const TextStyle(
|
|
fontWeight: FontWeight.w600,
|
|
fontSize: 14,
|
|
),
|
|
indicatorColor: AppThemeTailwind.primary,
|
|
indicatorWeight: 2,
|
|
),
|
|
),
|
|
Expanded(child: TabBarView(children: tabViews)),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|