- Added navigation to the dashboard after applying the theme in ThemeController. - Introduced a new PillTabBar widget for a modern tab design across multiple screens. - Updated dashboard screen to improve button actions and UI consistency. - Refactored contact detail screen to streamline layout and enhance gradient effects. - Implemented PillTabBar in directory main screen, expense screen, and payment request screen for consistent tab navigation. - Improved layout structure in user document screen and employee profile screen for better user experience. - Enhanced service project details screen with a modern tab bar implementation.
62 lines
1.8 KiB
Dart
62 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class PillTabBar extends StatelessWidget {
|
|
final TabController controller;
|
|
final List<String> tabs;
|
|
final Color selectedColor;
|
|
final Color unselectedColor;
|
|
final Color indicatorColor;
|
|
final double height;
|
|
|
|
const PillTabBar({
|
|
Key? key,
|
|
required this.controller,
|
|
required this.tabs,
|
|
this.selectedColor = Colors.blue,
|
|
this.unselectedColor = Colors.grey,
|
|
this.indicatorColor = Colors.blueAccent,
|
|
this.height = 48,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
child: Container(
|
|
height: height,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(height / 2),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.grey.withOpacity(0.15),
|
|
blurRadius: 4,
|
|
offset: const Offset(0, 2),
|
|
),
|
|
],
|
|
),
|
|
child: TabBar(
|
|
controller: controller,
|
|
indicator: BoxDecoration(
|
|
color: indicatorColor.withOpacity(0.2),
|
|
borderRadius: BorderRadius.circular(height / 2),
|
|
),
|
|
indicatorSize: TabBarIndicatorSize.tab,
|
|
indicatorPadding: const EdgeInsets.symmetric(horizontal: 4, vertical: 4),
|
|
labelColor: selectedColor,
|
|
unselectedLabelColor: unselectedColor,
|
|
labelStyle: const TextStyle(
|
|
fontWeight: FontWeight.bold,
|
|
fontSize: 15,
|
|
),
|
|
unselectedLabelStyle: const TextStyle(
|
|
fontWeight: FontWeight.w500,
|
|
fontSize: 15,
|
|
),
|
|
tabs: tabs.map((text) => Tab(text: text)).toList(),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|