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

46 lines
1.6 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/constants/constants.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 TodayButton extends StatelessWidget {
const TodayButton({super.key});
@override
Widget build(BuildContext context) {
final controller = Get.put(InventoryInoutController());
2024-03-19 11:09:07 +08:00
return InkWell(
2024-03-19 13:27:42 +08:00
borderRadius: BorderRadius.circular(ScreenAdaper.sp(30)),
2024-03-19 11:09:07 +08:00
onTap: () => controller.pageController.animateToPage(0,
2024-03-19 13:27:42 +08:00
duration: const Duration(milliseconds: 300), curve: Curves.easeIn),
2024-03-19 11:09:07 +08:00
child: Container(
2024-03-19 13:27:42 +08:00
height: ScreenAdaper.height(70),
width: ScreenAdaper.width(200),
2024-03-19 11:09:07 +08:00
alignment: Alignment.center,
decoration: BoxDecoration(
2024-03-19 13:27:42 +08:00
borderRadius: BorderRadius.circular(ScreenAdaper.sp(30)),
boxShadow: [
2024-03-19 11:09:07 +08:00
BoxShadow(
2024-03-19 13:27:42 +08:00
color: AppTheme.primaryColorLight,
2024-03-21 16:22:00 +08:00
offset: Offset(0, ScreenAdaper.height(5)),
blurRadius: ScreenAdaper.sp(20))
2024-03-19 11:09:07 +08:00
],
gradient: const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
2024-03-19 13:27:42 +08:00
colors: [AppTheme.primaryColorLight, AppTheme.primaryColor])),
child: Text(
TextEnum.backToTodayButtonText,
2024-03-19 11:09:07 +08:00
style: TextStyle(
color: Colors.white,
2024-03-19 13:27:42 +08:00
fontSize: ScreenAdaper.sp(25),
2024-03-19 11:09:07 +08:00
fontWeight: FontWeight.bold,
),
),
),
);
}
}