71 lines
2.0 KiB
Dart
71 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:tm_app/core/utils/size_config.dart';
|
|
|
|
import '../../../core/theme/colors.dart';
|
|
|
|
class ProfileTabBar extends StatefulWidget {
|
|
const ProfileTabBar({
|
|
required this.controller,
|
|
required this.titles,
|
|
this.onTap,
|
|
super.key,
|
|
});
|
|
|
|
final TabController controller;
|
|
final List<String> titles;
|
|
final ValueChanged<int>? onTap;
|
|
|
|
@override
|
|
State<ProfileTabBar> createState() => _ProfileTabBarState();
|
|
}
|
|
|
|
class _ProfileTabBarState extends State<ProfileTabBar> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SingleChildScrollView(
|
|
child: Container(
|
|
width: double.infinity,
|
|
height: 51.0.h(),
|
|
padding: EdgeInsets.symmetric(horizontal: 8.0.w(), vertical: 8.0.h()),
|
|
decoration: BoxDecoration(
|
|
color: AppColors.grey10,
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
alignment: Alignment.center,
|
|
child: TabBar(
|
|
controller: widget.controller,
|
|
onTap: widget.onTap,
|
|
indicatorSize: TabBarIndicatorSize.tab,
|
|
dividerColor: Colors.transparent,
|
|
indicator: BoxDecoration(
|
|
color: AppColors.primary0,
|
|
borderRadius: BorderRadius.circular(10),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.black.withValues(alpha: 0.12),
|
|
blurRadius: 4,
|
|
offset: const Offset(0, 2),
|
|
),
|
|
],
|
|
),
|
|
labelColor: AppColors.mainBlue,
|
|
unselectedLabelColor: AppColors.grey60,
|
|
labelStyle: TextStyle(
|
|
fontSize: 16.0.sp(),
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
unselectedLabelStyle: TextStyle(
|
|
fontSize: 16.0.sp(),
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
tabs: [
|
|
Tab(text: widget.titles[0]),
|
|
Tab(text: widget.titles[1]),
|
|
Tab(text: widget.titles[2]),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|