Skip to content

Commit

Permalink
Make cell decoration themeable
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBursch committed Apr 20, 2020
1 parent a18e939 commit 903c429
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/src/customization/calendar_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class CalendarStyle {
/// Padding of `TableCalendar`'s content.
final EdgeInsets contentPadding;

/// Margin of Cells' decoration.
final EdgeInsets cellMargin;

/// Specifies if event markers rendered for a day cell can overflow cell's boundaries.
/// * `true` - Event markers will be drawn over the cell boundaries
/// * `false` - Event markers will not be drawn over the cell boundaries and will be clipped if they are too big
Expand Down Expand Up @@ -112,6 +115,7 @@ class CalendarStyle {
this.renderSelectedFirst = true,
this.renderDaysOfWeek = true,
this.contentPadding = const EdgeInsets.only(bottom: 4.0, left: 8.0, right: 8.0),
this.cellMargin = const EdgeInsets.all(6.0),
this.canEventMarkersOverflow = false,
this.highlightSelected = true,
this.highlightToday = true,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/cell_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class _CellWidget extends StatelessWidget {
return AnimatedContainer(
duration: const Duration(milliseconds: 250),
decoration: _buildCellDecoration(),
margin: const EdgeInsets.all(6.0),
margin: calendarStyle.cellMargin,
alignment: Alignment.center,
child: Text(
text,
Expand Down

0 comments on commit 903c429

Please sign in to comment.