2024-03-19 11:09:07 +08:00
|
|
|
import 'dart:ui';
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:sk_base_mobile/screens/home/home_controller.dart';
|
|
|
|
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(HomeController());
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Obx(
|
|
|
|
() => Text(
|
|
|
|
DateUtil.getMonth(DateTime.now().add(Duration(days: index))),
|
|
|
|
style: TextStyle(
|
|
|
|
color: controller.currentIndex.value == index
|
|
|
|
? Colors.white
|
|
|
|
: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold,
|
2024-03-19 13:27:42 +08:00
|
|
|
fontSize: ScreenAdaper.sp(16),
|
2024-03-19 11:09:07 +08:00
|
|
|
height: 0),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Obx(
|
|
|
|
() => Text(
|
|
|
|
DateUtil.getDate(DateTime.now().add(Duration(days: index))),
|
|
|
|
style: TextStyle(
|
|
|
|
color: controller.currentIndex.value == index
|
|
|
|
? Colors.white
|
|
|
|
: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: 26,
|
|
|
|
height: 0),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Obx(
|
|
|
|
() => Text(
|
|
|
|
DateUtil.getDay(DateTime.now().add(Duration(days: index))),
|
|
|
|
style: TextStyle(
|
|
|
|
color: controller.currentIndex.value == index
|
|
|
|
? Colors.white
|
|
|
|
: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: 13),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|