facility_booking_page.dart 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import 'package:cs_resources/theme/app_colors_theme.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:auto_route/auto_route.dart';
  4. import 'package:hooks_riverpod/hooks_riverpod.dart';
  5. import 'package:router/ext/auto_router_extensions.dart';
  6. import 'package:shared/utils/log_utils.dart';
  7. import 'package:widgets/my_appbar.dart';
  8. import 'package:widgets/my_text_view.dart';
  9. import 'package:widgets/widget_export.dart';
  10. import '../../router/page/facility_page_router.dart';
  11. import 'facility_booking_view_model.dart';
  12. @RoutePage()
  13. class FacilityBookingPage extends HookConsumerWidget {
  14. const FacilityBookingPage({Key? key}) : super(key: key);
  15. //启动当前页面
  16. static void startInstance({BuildContext? context}) {
  17. if (context != null) {
  18. context.router.push(const FacilityBookingPageRoute());
  19. } else {
  20. appRouter.push(const FacilityBookingPageRoute());
  21. }
  22. }
  23. @override
  24. Widget build(BuildContext context, WidgetRef ref) {
  25. final viewModel = ref.watch(facilityBookingViewModelProvider.notifier);
  26. final state = ref.watch(facilityBookingViewModelProvider);
  27. return Scaffold(
  28. appBar: MyAppBar.appBar(context, "Kids party room", backgroundColor: context.appColors.whiteBG),
  29. backgroundColor: context.appColors.backgroundDark,
  30. body: SingleChildScrollView(
  31. scrollDirection: Axis.vertical,
  32. physics: const BouncingScrollPhysics(),
  33. child: Column(
  34. mainAxisSize: MainAxisSize.max,
  35. crossAxisAlignment: CrossAxisAlignment.center,
  36. children: [
  37. MyTextView(
  38. "Friday,11 October 2024",
  39. textColor: context.appColors.textBlack,
  40. fontSize: 17,
  41. marginTop: 18,
  42. marginBottom: 16,
  43. marginLeft: 15,
  44. isFontMedium: true,
  45. ),
  46. WeeklyCalendar(
  47. isAutoSelect: false,
  48. selectedDate: DateTime.now().add(Duration(days: 1)),
  49. onChangedSelectedDate: (dateTime) {
  50. Log.d("onChangedSelectedDate选中 - ${dateTime}}");
  51. },
  52. onChangedPage: (dateTime, state) {
  53. Log.d("onChangedPage - ${dateTime} state:${state}");
  54. },
  55. ),
  56. ],
  57. ),
  58. ),
  59. );
  60. }
  61. }