diff --git a/lib/pages/my_shift_page.dart b/lib/pages/my_shift_page.dart index b672f7b..4176079 100644 --- a/lib/pages/my_shift_page.dart +++ b/lib/pages/my_shift_page.dart @@ -2,7 +2,8 @@ import 'package:seeft_mobile/configs/importer.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:http/http.dart' as http; import 'package:seeft_mobile/pages/my_shift_page_preparation_day.dart'; -import 'package:seeft_mobile/pages/my_shift_page_current_day.dart'; +import 'package:seeft_mobile/pages/my_shift_page_current_first_day.dart'; +import 'package:seeft_mobile/pages/my_shift_page_current_second_day.dart'; import 'package:seeft_mobile/pages/pre_preparation_day_shift.dart'; import 'package:seeft_mobile/pages/cleanup_day_time_schedule.dart'; /* @@ -29,7 +30,8 @@ class _MyShiftPageState extends State final List _tabs = [ TabInfo("準々備日", PrePreparationDayShift()), TabInfo("準備日", MyShiftPagePreparationDay()), - TabInfo("当日", MyShiftPageCurrentDay()), + TabInfo("当日 1日目", MyShiftPageCurrentFirstDay()), + TabInfo("当日 2日目", MyShiftPageCurrentSecondDay()), TabInfo("片付け日", CleanUpDayTimeSchedule()), ]; late TabController _tabController; diff --git a/lib/pages/my_shift_page_current_day.dart b/lib/pages/my_shift_page_current_first_day.dart similarity index 91% rename from lib/pages/my_shift_page_current_day.dart rename to lib/pages/my_shift_page_current_first_day.dart index 2cc42ec..bf8f115 100644 --- a/lib/pages/my_shift_page_current_day.dart +++ b/lib/pages/my_shift_page_current_first_day.dart @@ -4,12 +4,12 @@ import 'package:seeft_mobile/configs/importer.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:http/http.dart' as http; -class MyShiftPageCurrentDay extends StatefulWidget { +class MyShiftPageCurrentFirstDay extends StatefulWidget { @override _MyShiftPageState createState() => _MyShiftPageState(); } -class _MyShiftPageState extends State { +class _MyShiftPageState extends State { // notification関連をinitStateに書き出さなきゃいけないので書いてたけどutilとかに書いてもいいかもね // FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; diff --git a/lib/pages/my_shift_page_current_day_rainy.dart b/lib/pages/my_shift_page_current_first_day_rainy.dart similarity index 90% rename from lib/pages/my_shift_page_current_day_rainy.dart rename to lib/pages/my_shift_page_current_first_day_rainy.dart index 4180817..256ea2d 100644 --- a/lib/pages/my_shift_page_current_day_rainy.dart +++ b/lib/pages/my_shift_page_current_first_day_rainy.dart @@ -4,12 +4,12 @@ import 'package:seeft_mobile/configs/importer.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:http/http.dart' as http; -class MyShiftPageCurrentDayRainy extends StatefulWidget { +class MyShiftPageCurrentFirstDayRainy extends StatefulWidget { @override _MyShiftPageState createState() => _MyShiftPageState(); } -class _MyShiftPageState extends State { +class _MyShiftPageState extends State { // notification関連をinitStateに書き出さなきゃいけないので書いてたけどutilとかに書いてもいいかもね // FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; diff --git a/lib/pages/my_shift_page_current_day_sunny.dart b/lib/pages/my_shift_page_current_first_day_sunny.dart similarity index 90% rename from lib/pages/my_shift_page_current_day_sunny.dart rename to lib/pages/my_shift_page_current_first_day_sunny.dart index 7f0a5d9..65c7940 100644 --- a/lib/pages/my_shift_page_current_day_sunny.dart +++ b/lib/pages/my_shift_page_current_first_day_sunny.dart @@ -4,12 +4,12 @@ import 'package:seeft_mobile/configs/importer.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:http/http.dart' as http; -class MyShiftPageCurrentDaySunny extends StatefulWidget { +class MyShiftPageCurrentFirstDaySunny extends StatefulWidget { @override _MyShiftPageState createState() => _MyShiftPageState(); } -class _MyShiftPageState extends State { +class _MyShiftPageState extends State { // notification関連をinitStateに書き出さなきゃいけないので書いてたけどutilとかに書いてもいいかもね // FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; diff --git a/lib/pages/my_shift_page_current_second_day.dart b/lib/pages/my_shift_page_current_second_day.dart new file mode 100644 index 0000000..d5099f1 --- /dev/null +++ b/lib/pages/my_shift_page_current_second_day.dart @@ -0,0 +1,65 @@ +import 'dart:developer'; + +import 'package:seeft_mobile/configs/importer.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +import 'package:http/http.dart' as http; + +class MyShiftPageCurrentSecondDay extends StatefulWidget { + @override + _MyShiftPageState createState() => _MyShiftPageState(); +} + +class _MyShiftPageState extends State { +// notification関連をinitStateに書き出さなきゃいけないので書いてたけどutilとかに書いてもいいかもね + +// FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; +// NotificationDetails platformChannelSpecifics; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.of(context).size; + return FutureBuilder( + future: getData(), + builder: (ctx, snapshot) { + if (snapshot.connectionState == AsyncSnapshot.waiting()) { + logger.w("message"); + } + if (!snapshot.hasData) { + return CircularProgressIndicator(); + } + return Container( + padding: const EdgeInsets.all(40.0), + child: SingleChildScrollView( + child: Column( + children: [ + Container( + // height: size.height - 200, + // width: size.width - 80, + // padding: const EdgeInsets.all(10.0), + // decoration: BoxDecoration( + // border: Border.all(color: Colors.black), + // ), + // child: _contents(size, snapshot.data)), + child: table.shiftTable(snapshot.data, context)), + ], + ), + )); + }, + ); + } +} + +Future getData() async { + try { + var userID = await store.getUserID(); + var res = await api.getMyShiftCurrentDay(userID.toString()); + return res; + } catch (err) { + logger.e('don`t response. error message: $err'); + } +} diff --git a/lib/pages/my_shift_page_current_second_day_rainy.dart b/lib/pages/my_shift_page_current_second_day_rainy.dart new file mode 100644 index 0000000..5138df3 --- /dev/null +++ b/lib/pages/my_shift_page_current_second_day_rainy.dart @@ -0,0 +1,65 @@ +import 'dart:developer'; + +import 'package:seeft_mobile/configs/importer.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +import 'package:http/http.dart' as http; + +class MyShiftPageCurrentSecondDayRainy extends StatefulWidget { + @override + _MyShiftPageState createState() => _MyShiftPageState(); +} + +class _MyShiftPageState extends State { +// notification関連をinitStateに書き出さなきゃいけないので書いてたけどutilとかに書いてもいいかもね + +// FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; +// NotificationDetails platformChannelSpecifics; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.of(context).size; + return FutureBuilder( + future: getData(), + builder: (ctx, snapshot) { + if (snapshot.connectionState == AsyncSnapshot.waiting()) { + logger.w("message"); + } + if (!snapshot.hasData) { + return CircularProgressIndicator(); + } + return Container( + padding: const EdgeInsets.all(40.0), + child: SingleChildScrollView( + child: Column( + children: [ + Container( + // height: size.height - 200, + // width: size.width - 80, + // padding: const EdgeInsets.all(10.0), + // decoration: BoxDecoration( + // border: Border.all(color: Colors.black), + // ), + // child: _contents(size, snapshot.data)), + child: table.shiftTable(snapshot.data, context)), + ], + ), + )); + }, + ); + } +} + +Future getData() async { + try { + var userID = await store.getUserID(); + var res = await api.getMyShiftCurrentDayRainy(userID.toString()); + return res; + } catch (err) { + logger.e('don`t response. error message: $err'); + } +} diff --git a/lib/pages/my_shift_page_current_second_day_sunny.dart b/lib/pages/my_shift_page_current_second_day_sunny.dart new file mode 100644 index 0000000..df4acdc --- /dev/null +++ b/lib/pages/my_shift_page_current_second_day_sunny.dart @@ -0,0 +1,65 @@ +import 'dart:developer'; + +import 'package:seeft_mobile/configs/importer.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +import 'package:http/http.dart' as http; + +class MyShiftPageCurrentSecondDaySunny extends StatefulWidget { + @override + _MyShiftPageState createState() => _MyShiftPageState(); +} + +class _MyShiftPageState extends State { +// notification関連をinitStateに書き出さなきゃいけないので書いてたけどutilとかに書いてもいいかもね + +// FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; +// NotificationDetails platformChannelSpecifics; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.of(context).size; + return FutureBuilder( + future: getData(), + builder: (ctx, snapshot) { + if (snapshot.connectionState == AsyncSnapshot.waiting()) { + logger.w("message"); + } + if (!snapshot.hasData) { + return CircularProgressIndicator(); + } + return Container( + padding: const EdgeInsets.all(40.0), + child: SingleChildScrollView( + child: Column( + children: [ + Container( + // height: size.height - 200, + // width: size.width - 80, + // padding: const EdgeInsets.all(10.0), + // decoration: BoxDecoration( + // border: Border.all(color: Colors.black), + // ), + // child: _contents(size, snapshot.data)), + child: table.shiftTable(snapshot.data, context)), + ], + ), + )); + }, + ); + } +} + +Future getData() async { + try { + var userID = await store.getUserID(); + var res = await api.getMyShiftCurrentDaySunny(userID.toString()); + return res; + } catch (err) { + logger.e('don`t response. error message: $err'); + } +}