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

46 lines
1.8 KiB
Dart
Raw Normal View History

2024-03-19 11:09:07 +08:00
import 'package:flutter/material.dart';
import 'package:get/get.dart';
2024-03-19 13:27:42 +08:00
import 'package:sk_base_mobile/app_theme.dart';
import 'package:sk_base_mobile/screens/inventory_inout/inventory_inout_controller.dart';
2024-03-19 13:27:42 +08:00
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
2024-03-19 11:09:07 +08:00
import 'dates.dart';
class DateContainer extends StatelessWidget {
final int index;
DateContainer({super.key, required this.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) {
2024-03-19 13:27:42 +08:00
final size = MediaQuery.sizeOf(context);
2024-03-19 11:09:07 +08:00
return Obx(() => AnimatedContainer(
duration: const Duration(milliseconds: 200),
2024-03-19 13:27:42 +08:00
height: ScreenAdaper.height(120),
width: ScreenAdaper.width(110),
2024-03-21 14:09:49 +08:00
margin: EdgeInsets.only(right: ScreenAdaper.width(size.width) * 0.05),
2024-03-19 11:09:07 +08:00
decoration: BoxDecoration(
color: Colors.white,
2024-03-19 13:27:42 +08:00
borderRadius: BorderRadius.circular(ScreenAdaper.sp(20)),
2024-03-19 11:09:07 +08:00
gradient: controller.currentIndex.value == index
? const LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
2024-03-19 13:27:42 +08:00
colors: [
AppTheme.secondPrimaryColor,
AppTheme.secondPrimaryColorDark
])
2024-03-19 11:09:07 +08:00
: null,
boxShadow: [
controller.currentIndex.value == index
2024-03-19 13:27:42 +08:00
? BoxShadow(
color: AppTheme.secondPrimaryColorLight,
offset: Offset(0, ScreenAdaper.width(10)),
blurRadius: ScreenAdaper.sp(20))
: BoxShadow(
2024-03-19 11:09:07 +08:00
color: Colors.black12,
2024-03-19 13:27:42 +08:00
offset: Offset(0, ScreenAdaper.width(10)),
blurRadius: ScreenAdaper.sp(20))
2024-03-19 11:09:07 +08:00
]),
child: Dates(index: index)));
}
}