You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Version resolve conflict with `xxx` (e.g. `dartx`)](#version-resolve-conflict-with-xxx-eg-dartx)
57
57
*[How can I get path from the `AssetEntity` to integrate with `File` object, upload or edit?](#how-can-i-get-path-from-the-assetentity-to-integrate-with-file-object-upload-or-edit)
58
+
*[How can I change the name of "Recent" or other entities name/properties?](#how-can-i-change-the-name-of-recent-or-other-entities-nameproperties)
58
59
*[Create `AssetEntity` from `File` or `Uint8List` (rawData)](#create-assetentity-from-file-or-uint8list-rawdata)
59
60
*[Console warning 'Failed to find GeneratedAppGlideModule'](#glide-warning-failed-to-find-generatedappglidemodule)
60
61
@@ -315,6 +316,39 @@ You can always request the `File` object with `entity.originFile`, if `Uint8List
315
316
316
317
If you still needs path after requested the `File`, get it through `file.absolutePath`.
317
318
319
+
### How can I change the name of "Recent" or other entities name/properties?
320
+
321
+
The path entity called "Recent", brought by `photo_manager` in the path entities list, includes all `AssetEntity` on your device. "Recent" is a system named entity in most of platforms. While we provided ability to customize the text delegate, the name/properties can only be updated with `SortPathDelegate` . This is the only way that you have access to all path entities, or the only way that we exposed currently.
322
+
323
+
To change the name of the path entity, extend the `SortPathDelegate` with your own delegate, then write something like the code below:
324
+
325
+
```dart
326
+
/// Create your own sort path delegate.
327
+
class CustomSortPathDelegate extends SortPathDelegate {
328
+
const CustomSortPathDelegate();
329
+
330
+
@override
331
+
void sort(List<AssetPathEntity> list) {
332
+
///...///
333
+
334
+
// In here you can check every path entities if you want.
335
+
// The only property we recommend to change is [name],
336
+
// And we have no responsibility for issues caused by
337
+
// other properties update.
338
+
for (final AssetPathEntity entity in list) {
339
+
// If the entity `isAll`, that's the "Recent" entity you want.
340
+
if (entity.isAll) {
341
+
entity.name = 'Whatever you want';
342
+
}
343
+
}
344
+
345
+
///...///
346
+
}
347
+
}
348
+
```
349
+
350
+
Pass the delegate through the static call method, then you will get a self-named path entity.
351
+
318
352
### Create `AssetEntity` from `File` or `Uint8List` (rawData)
319
353
320
354
In order to combine this package with camera shooting or something related, there's a solution about how to create an `AssetEntity` with `File` or `Uint8List` object.
0 commit comments