Handle error in label text builder
This commit is contained in:
parent
6bcadeda0e
commit
44c348256d
|
@ -258,11 +258,16 @@ class _GalleryState extends State<Gallery> {
|
||||||
return gallery;
|
return gallery;
|
||||||
},
|
},
|
||||||
labelTextBuilder: (int index) {
|
labelTextBuilder: (int index) {
|
||||||
return getMonthAndYear(
|
try {
|
||||||
DateTime.fromMicrosecondsSinceEpoch(
|
return getMonthAndYear(
|
||||||
_collatedFiles[index][0].creationTime!,
|
DateTime.fromMicrosecondsSinceEpoch(
|
||||||
),
|
_collatedFiles[index][0].creationTime!,
|
||||||
);
|
),
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
_logger.severe("label text builder failed", e);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
},
|
},
|
||||||
thumbBackgroundColor:
|
thumbBackgroundColor:
|
||||||
Theme.of(context).colorScheme.galleryThumbBackgroundColor,
|
Theme.of(context).colorScheme.galleryThumbBackgroundColor,
|
||||||
|
|
Loading…
Reference in a new issue