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

42 lines
1.4 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/home/components/custom_app_bar.dart';
import 'package:sk_base_mobile/screens/home/components/date_container.dart';
import 'package:sk_base_mobile/screens/home/home_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});
final controller = Get.put(HomeController());
@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(
controller: controller.scrollController,
itemCount: 7,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
2024-03-19 13:27:42 +08:00
padding: EdgeInsets.only(
bottom: ScreenAdaper.height(30), 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),
);
},
),
),
],
);
}
}