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

44 lines
1.5 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/constants/bg_color.dart';
import 'package:sk_base_mobile/screens/inventory_inout/components/custom_app_bar.dart';
import 'package:sk_base_mobile/screens/inventory_inout/components/date_container.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/util.dart';
2024-03-19 11:09:07 +08:00
class UperBody extends StatelessWidget {
UperBody({super.key});
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(
children: [
const SizedBox(
height: defaultPadding,
),
CustomAppBar(),
SizedBox(
2024-03-19 13:27:42 +08:00
height: ScreenAdaper.height(150),
2024-03-19 11:09:07 +08:00
child: ListView.builder(
2024-03-26 16:36:27 +08:00
key: PageStorageKey<String>('${controller.endTime.value}'),
2024-03-19 11:09:07 +08:00
controller: controller.scrollController,
shrinkWrap: true,
2024-03-21 14:09:49 +08:00
reverse: true,
2024-03-21 16:22:00 +08:00
itemCount: controller.daysNum,
2024-03-19 11:09:07 +08:00
scrollDirection: Axis.horizontal,
2024-03-19 13:27:42 +08:00
padding: EdgeInsets.only(
bottom: ScreenAdaper.height(20), top: defaultPadding),
2024-03-19 11:09:07 +08:00
itemBuilder: (context, index) {
return InkWell(
2024-03-19 13:27:42 +08:00
borderRadius: BorderRadius.circular(ScreenAdaper.sp(20)),
2024-03-19 11:09:07 +08:00
onTap: () => controller.setIndex(index),
child: DateContainer(index: index),
);
},
),
),
],
);
}
}