You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
3.3 KiB
Dart
86 lines
3.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
import 'package:test_sa/new_views/pages/land_page/calender_fragments/daily_fragment.dart';
|
|
import 'package:test_sa/new_views/pages/land_page/calender_fragments/weekly_fragment.dart';
|
|
|
|
import 'calender_fragments/monthly_fragment.dart';
|
|
|
|
class CalendarPage extends StatefulWidget {
|
|
const CalendarPage({Key key}) : super(key: key);
|
|
|
|
@override
|
|
State<CalendarPage> createState() => _CalendarPageState();
|
|
}
|
|
|
|
class _CalendarPageState extends State<CalendarPage> with SingleTickerProviderStateMixin {
|
|
TabController _tabController;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_tabController = TabController(length: 3, vsync: this);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: SafeArea(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
// todo @sikander, hiding My shift view, later when they add data, then will us it.
|
|
// SizedBox(
|
|
// width: double.infinity,
|
|
// child: Column(
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
// children: [
|
|
// context.translation.myShift.heading5(context),
|
|
// 8.height,
|
|
// context.translation.sunToThurs.bodyText(context),
|
|
// "09:00 to 18:00".bodyText(context).custom(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50),
|
|
// ],
|
|
// ).toShadowContainer(context),
|
|
// ).paddingOnly(start: 16, end: 16),
|
|
16.height,
|
|
Container(
|
|
margin: const EdgeInsets.only(left: 16, right: 16),
|
|
decoration: BoxDecoration(color: context.isDark ? AppColor.neutral10 : AppColor.neutral30, borderRadius: BorderRadius.circular(16)),
|
|
child: TabBar(
|
|
controller: _tabController,
|
|
padding: EdgeInsets.zero,
|
|
labelColor: AppColor.neutral60,
|
|
unselectedLabelColor: AppColor.neutral20,
|
|
indicatorPadding: const EdgeInsets.all(4),
|
|
indicator: BoxDecoration(color: context.isDark ? AppColor.neutral20 : Theme.of(context).cardColor, borderRadius: BorderRadius.circular(13)),
|
|
onTap: (index) {
|
|
setState(() {});
|
|
},
|
|
tabs: [
|
|
Tab(text: context.translation.monthly, height: 57.toScreenHeight),
|
|
Tab(text: context.translation.weekly, height: 57.toScreenHeight),
|
|
Tab(text: context.translation.daily, height: 57.toScreenHeight),
|
|
],
|
|
),
|
|
),
|
|
8.height,
|
|
TabBarView(
|
|
//physics: const NeverScrollableScrollPhysics(),
|
|
controller: _tabController,
|
|
children: const [
|
|
MonthlyFragment(),
|
|
WeeklyFragment(),
|
|
DailyFragment(),
|
|
],
|
|
).expanded,
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|