-
Notifications
You must be signed in to change notification settings - Fork 310
Expand file tree
/
Copy pathmulti_day_view_widget.dart
More file actions
46 lines (42 loc) · 1.37 KB
/
multi_day_view_widget.dart
File metadata and controls
46 lines (42 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import 'package:calendar_view/calendar_view.dart';
import 'package:flutter/material.dart';
import '../pages/event_details_page.dart';
class MultiDayViewWidget extends StatelessWidget {
final GlobalKey<MultiDayViewState>? state;
final double? width;
const MultiDayViewWidget({super.key, this.state, this.width});
@override
Widget build(BuildContext context) {
return MultiDayView(
key: state,
daysInView: 3,
width: width,
showLiveTimeLineInAllDays: true,
eventArranger: SideEventArranger(),
backgroundColor: Colors.white,
timeLineWidth: 65,
scrollPhysics: const BouncingScrollPhysics(),
liveTimeIndicatorSettings: LiveTimeIndicatorSettings(
color: Colors.redAccent,
onlyShowToday: true,
),
onTimestampTap: (date) {
SnackBar snackBar = SnackBar(
content: Text("On tap: ${date.hour} Hr : ${date.minute} Min"),
);
ScaffoldMessenger.of(context).showSnackBar(snackBar);
},
onEventTap: (events, date) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => DetailsPage(event: events.first, date: date),
),
);
},
onEventLongTap: (events, date) {
SnackBar snackBar = SnackBar(content: Text("on LongTap"));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
},
);
}
}