2024-03-19 11:09:07 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:get/get.dart';
|
2024-03-20 09:37:20 +08:00
|
|
|
import 'package:sk_base_mobile/screens/inventory_inout/inventory_inout_controller.dart';
|
2024-03-19 11:09:07 +08:00
|
|
|
import 'package:sk_base_mobile/util/util.dart';
|
|
|
|
|
|
|
|
class Dates extends StatelessWidget {
|
|
|
|
Dates({super.key, required this.index});
|
|
|
|
final int index;
|
2024-03-26 16:02:49 +08:00
|
|
|
final controller = Get.find<InventoryInoutController>();
|
2024-03-19 11:09:07 +08:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Obx(
|
|
|
|
() => Text(
|
2024-04-08 13:50:23 +08:00
|
|
|
SkDateUtil.getMonth(
|
2024-03-26 16:36:27 +08:00
|
|
|
controller.endTime.value.add(Duration(days: -index))),
|
2024-03-19 11:09:07 +08:00
|
|
|
style: TextStyle(
|
|
|
|
color: controller.currentIndex.value == index
|
|
|
|
? Colors.white
|
|
|
|
: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold,
|
2024-03-28 17:18:46 +08:00
|
|
|
fontSize: ScreenAdaper.height(18),
|
2024-03-19 11:09:07 +08:00
|
|
|
height: 0),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Obx(
|
|
|
|
() => Text(
|
2024-04-08 13:50:23 +08:00
|
|
|
SkDateUtil.getDate(
|
2024-03-26 16:36:27 +08:00
|
|
|
controller.endTime.value.add(Duration(days: -index))),
|
2024-03-19 11:09:07 +08:00
|
|
|
style: TextStyle(
|
|
|
|
color: controller.currentIndex.value == index
|
|
|
|
? Colors.white
|
|
|
|
: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold,
|
2024-03-28 17:18:46 +08:00
|
|
|
fontSize: ScreenAdaper.height(30),
|
2024-03-19 11:09:07 +08:00
|
|
|
height: 0),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Obx(
|
|
|
|
() => Text(
|
2024-04-08 13:50:23 +08:00
|
|
|
SkDateUtil.getDay(
|
2024-03-26 16:36:27 +08:00
|
|
|
controller.endTime.value.add(Duration(days: -index))),
|
2024-03-19 11:09:07 +08:00
|
|
|
style: TextStyle(
|
|
|
|
color: controller.currentIndex.value == index
|
|
|
|
? Colors.white
|
|
|
|
: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold,
|
2024-03-28 17:18:46 +08:00
|
|
|
fontSize: ScreenAdaper.height(16)),
|
2024-03-19 11:09:07 +08:00
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|