mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-05-01 09:40:30 -05:00
31 lines
672 B
Dart
31 lines
672 B
Dart
import 'package:drift/drift.dart';
|
|
import 'package:offtheline/offtheline.dart';
|
|
import 'package:phylum/libphylum/db/db.dart';
|
|
|
|
class MoveResourceChange extends LocalChange<Resource> {
|
|
@override
|
|
final String objectId;
|
|
final String? parent;
|
|
final String? name;
|
|
final DateTime timestamp;
|
|
|
|
@override
|
|
String get description => 'Moving';
|
|
|
|
const MoveResourceChange({
|
|
required this.objectId,
|
|
required this.parent,
|
|
required this.name,
|
|
required this.timestamp,
|
|
});
|
|
|
|
@override
|
|
Resource? apply(Resource? data) {
|
|
return data?.copyWith(
|
|
parent: Value.absentIfNull(parent),
|
|
name: name,
|
|
modified: Value(timestamp),
|
|
);
|
|
}
|
|
}
|