File/directory metadata with a stable ID; a null parentId denotes the root directory.
Dart copyWith preserves omitted fields; root: true explicitly sets parentId to null. Passing parentId: null alone preserves the existing parent.
TxFileEntry
| Parameter | Type | Default | Meaning |
|---|---|---|---|
| id | String | required | Unique stable ID. |
| name | String | required | Input field name or file name. |
| parentId | String? | null | Parent directory ID; null denotes the root. |
| isDirectory | bool | false | Identifies a directory. |
| size | int | 0 | File size in bytes. |
| modified | DateTime? | null | Last modification time. |
| bytes | Uint8List? | null | File contents in memory. |
| Member / type / return | Meaning |
|---|---|
TxFileEntry copyWith({String? id, String? name, String? parentId, bool root = false}) | Creates a copy with the supplied changes; preserves other values. |
import 'package:tecexpress/tecexpress.dart';
Future<void> example() async {
const entry = TxFileEntry(id: '1', name: 'hello.txt');
print(entry.copyWith(name: 'renamed.txt').name);
}