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.
		
		
		
		
		
			
		
			
				
	
	
		
			85 lines
		
	
	
		
			3.1 KiB
		
	
	
	
		
			Dart
		
	
			
		
		
	
	
			85 lines
		
	
	
		
			3.1 KiB
		
	
	
	
		
			Dart
		
	
import 'package:flutter/material.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: [
 | 
						|
                  "My Shift".heading5(context),
 | 
						|
                  8.height,
 | 
						|
                  "Sunday to Thursday".bodyText(context),
 | 
						|
                  "09:00 to 18:00".bodyText(context).custom(color: AppColor.neutral50),
 | 
						|
                ],
 | 
						|
              ).toShadowContainer(context),
 | 
						|
            ).paddingOnly(start: 16, end: 16),
 | 
						|
            16.height,
 | 
						|
            Container(
 | 
						|
              margin: const EdgeInsets.only(left: 16, right: 16),
 | 
						|
              decoration: BoxDecoration(color: 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: Theme.of(context).cardColor, borderRadius: BorderRadius.circular(13)),
 | 
						|
                onTap: (index) {
 | 
						|
                  setState(() {});
 | 
						|
                },
 | 
						|
                tabs: [
 | 
						|
                  Tab(text: "Monthly", height: 57.toScreenHeight),
 | 
						|
                  Tab(text: "Weekly", height: 57.toScreenHeight),
 | 
						|
                  Tab(text: "Daily", height: 57.toScreenHeight),
 | 
						|
                ],
 | 
						|
              ),
 | 
						|
            ),
 | 
						|
            8.height,
 | 
						|
            TabBarView(
 | 
						|
              //physics: const NeverScrollableScrollPhysics(),
 | 
						|
              controller: _tabController,
 | 
						|
              children: const [
 | 
						|
                MonthlyFragment(),
 | 
						|
                WeeklyFragment(),
 | 
						|
                DailyFragment(),
 | 
						|
              ],
 | 
						|
            ).expanded,
 | 
						|
          ],
 | 
						|
        ),
 | 
						|
      ),
 | 
						|
    );
 | 
						|
  }
 | 
						|
}
 |