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';
import 'package:sk_base_mobile/util/util.dart';

class UperBody extends StatelessWidget {
  UperBody({super.key});
  final controller = Get.put(InventoryInoutController());
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        const SizedBox(
          height: defaultPadding,
        ),
        CustomAppBar(),
        SizedBox(
          height: ScreenAdaper.height(150),
          child: ListView.builder(
            controller: controller.scrollController,
            shrinkWrap: true,
            reverse: true,
            itemCount: controller.daysNum,
            scrollDirection: Axis.horizontal,
            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),
              );
            },
          ),
        ),
      ],
    );
  }
}
