flutter_agenda/lib/src/models/agenda_event.dart

26 lines
640 B
Dart
Raw Normal View History

2022-09-01 10:30:08 +02:00
import 'package:flutter/material.dart';
class AgendaEvent {
2022-09-02 16:21:52 +02:00
/// The model used for a single event in the [AgendaWidget].
/// AgendaEvent can be multiple days long.
AgendaEvent({
2022-09-01 10:30:08 +02:00
required this.start,
required this.end,
this.id,
this.content,
2022-09-02 16:21:52 +02:00
}) : assert(start.isBefore(end), 'start must be before end');
2022-09-01 10:30:08 +02:00
/// The start time of the event.
final DateTime start;
/// The end time of the event.
final DateTime end;
2022-09-02 16:21:52 +02:00
///
2022-09-01 10:30:08 +02:00
final Widget? content;
/// The identifier of the event that is used to combine events
/// with the same id. Leave empty or 0 if you don't want to combine events.
final int? id;
}