parent
bc387b5352
commit
61bc7c22bf
@ -0,0 +1,54 @@
|
||||
import 'package:aku_community_manager/ui/manage_pages/clock_in_out/clock_in_out_main_page.dart';
|
||||
import 'package:aku_community_manager/ui/manage_pages/clock_in_out/clock_in_out_view.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
class ClockInOutPage extends StatefulWidget {
|
||||
ClockInOutPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ClockInOutPageState createState() => _ClockInOutPageState();
|
||||
}
|
||||
|
||||
class _ClockInOutPageState extends State<ClockInOutPage>
|
||||
with TickerProviderStateMixin {
|
||||
TabController _tabController;
|
||||
List<String> _tabs = ['考勤打卡', '打卡记录', '申请情况'];
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: _tabs.length, vsync: this);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_tabController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '考勤管理',
|
||||
appBarBottom: PreferredSize(
|
||||
child: AkuTabBar(controller: _tabController, tabs: _tabs),
|
||||
preferredSize: Size.fromHeight(88.w),
|
||||
),
|
||||
body: TabBarView(
|
||||
controller: _tabController,
|
||||
children: List.generate(_tabs.length, (index) {
|
||||
|
||||
if (index == 0) {
|
||||
return ClockInOutMainPage();
|
||||
} else {
|
||||
return ClockInOutView(
|
||||
index: index,
|
||||
);
|
||||
}
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ClockInOutView extends StatefulWidget {
|
||||
final int index;
|
||||
ClockInOutView({Key key, this.index}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ClockInOutViewState createState() => _ClockInOutViewState();
|
||||
}
|
||||
|
||||
class _ClockInOutViewState extends State<ClockInOutView> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView();
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
class WeekDaysToChinese {
|
||||
static String fromString(String weekday) {
|
||||
switch (weekday) {
|
||||
case 'Monday':
|
||||
return '周一';
|
||||
case 'Tuesday':
|
||||
return '周二';
|
||||
case 'Wednesday':
|
||||
return '周三';
|
||||
case 'Thursday':
|
||||
return '周四';
|
||||
case 'Friday':
|
||||
return '周五';
|
||||
case 'Saturday':
|
||||
return '周六';
|
||||
case 'Sunday':
|
||||
return '周日';
|
||||
default:
|
||||
return '未知';
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue