|
| 1 | +import 'package:flutter/material.dart'; |
| 2 | + |
| 3 | +import '../extension.dart'; |
| 4 | +import '../widgets/resizable_month_view_widget.dart'; |
| 5 | +import '../widgets/responsive_widget.dart'; |
| 6 | +import 'create_event_page.dart'; |
| 7 | +import 'web/web_home_page.dart'; |
| 8 | +import '../enumerations.dart'; |
| 9 | + |
| 10 | +/// Full-screen demo page for [ResizableMonthViewWidget]. |
| 11 | +/// |
| 12 | +/// On mobile it renders a [Scaffold] with an AppBar and a FAB to create |
| 13 | +/// events. On web/desktop it delegates to [WebHomePage] with the |
| 14 | +/// [CalendarView.resizableMonth] view pre-selected. |
| 15 | +class ResizableMonthViewPageDemo extends StatefulWidget { |
| 16 | + const ResizableMonthViewPageDemo({super.key}); |
| 17 | + |
| 18 | + @override |
| 19 | + State<ResizableMonthViewPageDemo> createState() => |
| 20 | + _ResizableMonthViewPageDemoState(); |
| 21 | +} |
| 22 | + |
| 23 | +class _ResizableMonthViewPageDemoState |
| 24 | + extends State<ResizableMonthViewPageDemo> { |
| 25 | + @override |
| 26 | + Widget build(BuildContext context) { |
| 27 | + final appColors = context.appColors; |
| 28 | + |
| 29 | + return ResponsiveWidget( |
| 30 | + webWidget: WebHomePage(selectedView: CalendarView.resizableMonth), |
| 31 | + mobileWidget: Scaffold( |
| 32 | + primary: false, |
| 33 | + appBar: AppBar(leading: const SizedBox.shrink()), |
| 34 | + floatingActionButton: FloatingActionButton( |
| 35 | + heroTag: 'add_event_resizable_month_view', |
| 36 | + child: Icon(Icons.add, color: appColors.onPrimary), |
| 37 | + elevation: 8, |
| 38 | + onPressed: () => context.pushRoute(CreateEventPage()), |
| 39 | + ), |
| 40 | + body: ResizableMonthViewWidget(), |
| 41 | + ), |
| 42 | + ); |
| 43 | + } |
| 44 | +} |
0 commit comments