handle drag n drop
This commit is contained in:
@@ -83,6 +83,7 @@ class _MainAppState extends State<MainApp> {
|
||||
start: start,
|
||||
end: end,
|
||||
lane: item.lane,
|
||||
hasEnd: item.end != null,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -118,16 +119,21 @@ class _MainAppState extends State<MainApp> {
|
||||
String newGroupId,
|
||||
int newLane,
|
||||
) {
|
||||
final duration = entry.end.difference(entry.start);
|
||||
final newEnd = newStart.add(duration);
|
||||
|
||||
emitEvent('entry_moved', {
|
||||
final payload = <String, Object?>{
|
||||
'entryId': entry.id,
|
||||
'newStart': newStart.toIso8601String(),
|
||||
'newEnd': newEnd.toIso8601String(),
|
||||
'newGroupId': newGroupId,
|
||||
'newLane': newLane,
|
||||
});
|
||||
};
|
||||
|
||||
if (entry.hasEnd) {
|
||||
final duration = entry.end.difference(entry.start);
|
||||
payload['newEnd'] = newStart.add(duration).toIso8601String();
|
||||
} else {
|
||||
payload['newEnd'] = null;
|
||||
}
|
||||
|
||||
emitEvent('entry_moved', payload);
|
||||
}
|
||||
|
||||
void _emitContentHeight() {
|
||||
|
||||
Reference in New Issue
Block a user