Skip to content

Commit

Permalink
feat: added verticalLineOffset parameter on WeekView
Browse files Browse the repository at this point in the history
  • Loading branch information
prabinlamsal19 committed Oct 2, 2023
1 parent 9e3a23d commit 8201f12
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions lib/src/week_view/week_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,20 +178,23 @@ class WeekView<T extends Object?> extends StatefulWidget {
final MinuteSlotSize minuteSlotSize;

/// Style for WeekView header.
final HeaderStyle headerStyle;
final HeaderStyle headerStyle;

/// Option for SafeArea.
final SafeAreaOption safeAreaOption;

/// Display full day event builder.
final FullDayEventBuilder<T>? fullDayEventBuilder;

///Show half hour indicator
final bool showHalfHours;
///Show half hour indicator
final bool showHalfHours;

///Show quarter hour indicator
///Show quarter hour indicator
final bool showQuarterHours;

///Defines offset of vertical line from the hour line starts.
final double verticalLineOffset;

/// Main widget for week view.
const WeekView({
Key? key,
Expand Down Expand Up @@ -234,8 +237,9 @@ class WeekView<T extends Object?> extends StatefulWidget {
this.headerStyle = const HeaderStyle(),
this.safeAreaOption = const SafeAreaOption(),
this.fullDayEventBuilder,
this.showHalfHours = false,
this.showHalfHours = false,
this.showQuarterHours = false,
this.verticalLineOffset = 10.0,
}) : assert((timeLineOffset) >= 0,
"timeLineOffset must be greater than or equal to 0"),
assert(width == null || width > 0,
Expand Down Expand Up @@ -270,7 +274,7 @@ class WeekViewState<T extends Object?> extends State<WeekView<T>> {

late EventArranger<T> _eventArranger;

late HourIndicatorSettings _hourIndicatorSettings;
late HourIndicatorSettings _hourIndicatorSettings;
late HourIndicatorSettings _halfHourIndicatorSettings;
late HourIndicatorSettings _liveTimeIndicatorSettings;

Expand Down Expand Up @@ -431,13 +435,14 @@ class WeekViewState<T extends Object?> extends State<WeekView<T>> {
eventTileBuilder: _eventTileBuilder,
heightPerMinute: widget.heightPerMinute,
hourIndicatorSettings: _hourIndicatorSettings,
halfHourIndicatorSettings: _halfHourIndicatorSettings,
halfHourIndicatorSettings:
_halfHourIndicatorSettings,
dates: dates,
showLiveLine: widget.showLiveTimeLineInAllDays ||
_showLiveTimeIndicator(dates),
timeLineOffset: widget.timeLineOffset,
timeLineWidth: _timeLineWidth,
verticalLineOffset: 0,
verticalLineOffset: widget.verticalLineOffset,
showVerticalLine: true,
controller: controller,
hourHeight: _hourHeight,
Expand All @@ -447,7 +452,7 @@ class WeekViewState<T extends Object?> extends State<WeekView<T>> {
minuteSlotSize: widget.minuteSlotSize,
scrollConfiguration: _scrollConfiguration,
fullDayEventBuilder: _fullDayEventBuilder,
showHalfHours: widget.showHalfHours,
showHalfHours: widget.showHalfHours,
showQuarterHours: widget.showQuarterHours,
),
);
Expand Down Expand Up @@ -527,8 +532,8 @@ class WeekViewState<T extends Object?> extends State<WeekView<T>> {
(_width - _timeLineWidth - _hourIndicatorSettings.offset) /
_totalDaysInWeek;

_halfHourIndicatorSettings = widget.halfHourIndicatorSettings ??
HourIndicatorSettings(
_halfHourIndicatorSettings = widget.halfHourIndicatorSettings ??
HourIndicatorSettings(
height: widget.heightPerMinute,
color: Constants.defaultBorderColor,
offset: 5,
Expand Down

0 comments on commit 8201f12

Please sign in to comment.