diff --git a/lib/src/month_view/month_view.dart b/lib/src/month_view/month_view.dart index 11a794bd..b19f7851 100644 --- a/lib/src/month_view/month_view.dart +++ b/lib/src/month_view/month_view.dart @@ -138,6 +138,12 @@ class MonthView extends StatefulWidget { /// Option for SafeArea. final SafeAreaOption safeAreaOption; + /// Defines scroll physics for a page of a month view. + /// + /// This can be used to disable the vertical scroll of a page. + /// Default value is [ClampingScrollPhysics]. + final ScrollPhysics pagePhysics; + /// Main [Widget] to display month view. const MonthView({ Key? key, @@ -166,6 +172,7 @@ class MonthView extends StatefulWidget { this.weekDayStringBuilder, this.headerStyle = const HeaderStyle(), this.safeAreaOption = const SafeAreaOption(), + this.pagePhysics = const ClampingScrollPhysics(), }) : super(key: key); @override @@ -343,6 +350,7 @@ class MonthViewState extends State> { date: date, showBorder: widget.showBorder, startDay: widget.startDay, + physics: widget.pagePhysics, ), ); }), @@ -588,6 +596,7 @@ class _MonthPageBuilder extends StatelessWidget { final CellTapCallback? onCellTap; final DatePressCallback? onDateLongPress; final WeekDays startDay; + final ScrollPhysics physics; const _MonthPageBuilder({ Key? key, @@ -603,6 +612,7 @@ class _MonthPageBuilder extends StatelessWidget { required this.onCellTap, required this.onDateLongPress, required this.startDay, + required this.physics, }) : super(key: key); @override @@ -613,7 +623,7 @@ class _MonthPageBuilder extends StatelessWidget { height: height, child: GridView.builder( padding: EdgeInsets.zero, - physics: ClampingScrollPhysics(), + physics: physics, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 7, childAspectRatio: cellRatio,