2024-03-19 11:09:07 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:get/get.dart';
|
2024-03-26 16:47:24 +08:00
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
2024-03-19 11:09:07 +08:00
|
|
|
import 'package:sk_base_mobile/constants/bg_color.dart';
|
2024-03-20 09:37:20 +08:00
|
|
|
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-26 16:47:24 +08:00
|
|
|
child: SmartRefresher(
|
|
|
|
enablePullDown: false,
|
|
|
|
enablePullUp: false,
|
2024-03-19 11:09:07 +08:00
|
|
|
scrollDirection: Axis.horizontal,
|
2024-03-26 16:47:24 +08:00
|
|
|
reverse: true,
|
|
|
|
controller: controller.refreshController,
|
|
|
|
child: ListView.builder(
|
|
|
|
key: PageStorageKey<String>('${controller.endTime.value}'),
|
|
|
|
controller: controller.scrollController,
|
|
|
|
itemCount: controller.daysNum,
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
bottom: ScreenAdaper.height(20), top: defaultPadding),
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return InkWell(
|
|
|
|
borderRadius: BorderRadius.circular(ScreenAdaper.sp(20)),
|
|
|
|
onTap: () => controller.setIndex(index),
|
|
|
|
child: DateContainer(index: index),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
2024-03-19 11:09:07 +08:00
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|