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;
|
||||
},
|
||||
labelTextBuilder: (int index) {
|
||||
return getMonthAndYear(
|
||||
DateTime.fromMicrosecondsSinceEpoch(
|
||||
_collatedFiles[index][0].creationTime!,
|
||||
),
|
||||
);
|
||||
try {
|
||||
return getMonthAndYear(
|
||||
DateTime.fromMicrosecondsSinceEpoch(
|
||||
_collatedFiles[index][0].creationTime!,
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
_logger.severe("label text builder failed", e);
|
||||
return "";
|
||||
}
|
||||
},
|
||||
thumbBackgroundColor:
|
||||
Theme.of(context).colorScheme.galleryThumbBackgroundColor,
|
||||
|
|
Loading…
Reference in a new issue