Skip to content

Commit

Permalink
Add multiDateEventHeaderStyle.maxEventCount
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasWanke committed Aug 16, 2022
1 parent bee93d7 commit 0ea6549
Show file tree
Hide file tree
Showing 6 changed files with 276 additions and 115 deletions.
30 changes: 30 additions & 0 deletions lib/src/components/all_day_overflow.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'package:black_hole_flutter/black_hole_flutter.dart';
import 'package:flutter/material.dart';

import '../event/all_day.dart';
import '../event/basic.dart';
import '../localization.dart';
import '../utils.dart';

class AllDayOverflow extends StatelessWidget {
AllDayOverflow(this.date, {super.key, required this.overflowCount})
: assert(date.debugCheckIsValidTimetableDate()),
assert(overflowCount >= 1);

final DateTime date;
final int overflowCount;

@override
Widget build(BuildContext context) {
return BasicAllDayEventWidget(
BasicEvent(
id: date,
title: TimetableLocalizations.of(context).allDayOverflow(overflowCount),
backgroundColor: context.theme.backgroundColor.withOpacity(0),
start: date,
end: date.atEndOfDay,
),
info: AllDayEventLayoutInfo(hiddenStartDays: 0, hiddenEndDays: 0),
);
}
}
Loading

0 comments on commit 0ea6549

Please sign in to comment.