mobile_skt/lib/screens/inventory_inout/components/dates.dart

54 lines
1.7 KiB
Dart
Raw Normal View History

2024-03-19 11:09:07 +08:00
import 'package:flutter/material.dart';
import 'package:get/get.dart';
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;
final controller = Get.put(InventoryInoutController());
2024-03-19 11:09:07 +08:00
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Obx(
() => Text(
2024-03-21 14:09:49 +08:00
DateUtil.getMonth(DateTime.now().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-21 14:09:49 +08:00
fontSize: ScreenAdaper.sp(18),
2024-03-19 11:09:07 +08:00
height: 0),
),
),
Obx(
() => Text(
2024-03-21 14:09:49 +08:00
DateUtil.getDate(DateTime.now().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-21 14:09:49 +08:00
fontSize: ScreenAdaper.sp(30),
2024-03-19 11:09:07 +08:00
height: 0),
),
),
Obx(
() => Text(
2024-03-21 14:09:49 +08:00
DateUtil.getDay(DateTime.now().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-21 14:09:49 +08:00
fontSize: ScreenAdaper.sp(16)),
2024-03-19 11:09:07 +08:00
),
)
],
);
}
}