122 lines
3.4 KiB
Dart
122 lines
3.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:regroup/Common/CommonTabBar.dart';
|
|
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
|
|
|
class SelectTimeSlot extends StatefulWidget {
|
|
const SelectTimeSlot({super.key});
|
|
|
|
@override
|
|
State<SelectTimeSlot> createState() => _SelectTimeSlotState();
|
|
}
|
|
|
|
class _SelectTimeSlotState extends State<SelectTimeSlot> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
// key: _scaffoldKey1,
|
|
resizeToAvoidBottomInset: false,
|
|
backgroundColor: const Color(0xFF222935),
|
|
extendBody: true,
|
|
appBar: const CommonAppbar(
|
|
titleTxt: "Select time slot",
|
|
),
|
|
body: Stack(children: [
|
|
Container(
|
|
decoration: const BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
|
fit: BoxFit.fill)),
|
|
),
|
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
DefaultTabController(
|
|
length: 2,
|
|
// initialIndex: selectedIndex.value,
|
|
child: Column(
|
|
children: [
|
|
CalendarTabBar(tabs: const [
|
|
Tab(
|
|
text: 'Week',
|
|
),
|
|
Tab(
|
|
text: 'Day',
|
|
),
|
|
]),
|
|
SizedBox(
|
|
height: 600.h,
|
|
child: TabBarView(
|
|
children: [
|
|
groupTab(),
|
|
subgroupTab(),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
])
|
|
]));
|
|
}
|
|
|
|
Widget groupTab() {
|
|
return Column(
|
|
children: const [],
|
|
);
|
|
}
|
|
|
|
Widget subgroupTab() {
|
|
return Column(
|
|
children: const [],
|
|
);
|
|
}
|
|
}
|
|
|
|
class CalendarTabBar extends StatelessWidget {
|
|
// Set the desired height
|
|
|
|
final List<Tab> tabs;
|
|
CalendarTabBar({
|
|
super.key,
|
|
required this.tabs,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: 239.w,
|
|
height: 42.h,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(41.r), // Rounded corners
|
|
gradient: LinearGradient(
|
|
colors: [
|
|
const Color(0xFFFFFFFF)
|
|
.withOpacity(0.036), // Start color with opacity
|
|
const Color(0xFFFFFFFF)
|
|
.withOpacity(0.048), // End color with opacity
|
|
],
|
|
begin: Alignment.centerLeft,
|
|
end: Alignment.centerRight,
|
|
),
|
|
border: Border.all(
|
|
color: const Color(0xFF434A53), // Border color
|
|
width: 1.39, // Border width
|
|
),
|
|
),
|
|
child: TabBar(
|
|
dividerColor: const Color(0xFFFFFFFF).withOpacity(0.07),
|
|
labelStyle: TextStyle(
|
|
fontSize: 14.sp,
|
|
color: const Color(0xFFFCFCFC),
|
|
fontWeight: FontWeight.w400,
|
|
fontFamily: 'Helvetica'),
|
|
indicatorSize: TabBarIndicatorSize.tab,
|
|
indicatorColor: const Color(0xFFD90B2E),
|
|
indicatorWeight: 2.h,
|
|
unselectedLabelColor: const Color(0xFFFCFCFC),
|
|
overlayColor: MaterialStateProperty.all(const Color(0xFFD90B2E)),
|
|
tabs: tabs, // Your tabs list
|
|
),
|
|
);
|
|
}
|
|
}
|