Linter warning fixes

This commit is contained in:
Neeraj Gupta 2023-12-11 18:27:17 +05:30 committed by Neeraj Gupta
parent eb1d468be2
commit e42ffb48c4
2 changed files with 24 additions and 19 deletions

View file

@ -130,11 +130,14 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
if (galleryType != GalleryType.ownedCollection && if (galleryType != GalleryType.ownedCollection &&
galleryType != GalleryType.hiddenOwnedCollection && galleryType != GalleryType.hiddenOwnedCollection &&
galleryType != GalleryType.quickLink) { galleryType != GalleryType.quickLink) {
showToast( unawaited(
context, showToast(
'Type of galler $galleryType is not supported for ' context,
'rename', 'Type of galler $galleryType is not supported for '
'rename',
),
); );
return; return;
} }
final result = await showTextInputDialog( final result = await showTextInputDialog(
@ -233,7 +236,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
await dialog.hide(); await dialog.hide();
if (status.localIDs.isEmpty) { if (status.localIDs.isEmpty) {
showErrorDialog( await showErrorDialog(
context, context,
S.of(context).allClear, S.of(context).allClear,
S.of(context).youveNoFilesInThisAlbumThatCanBeDeleted, S.of(context).youveNoFilesInThisAlbumThatCanBeDeleted,
@ -256,7 +259,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
body: S.of(context).youHaveSuccessfullyFreedUp(formatBytes(status.size)), body: S.of(context).youHaveSuccessfullyFreedUp(formatBytes(status.size)),
firstButtonLabel: S.of(context).rateUs, firstButtonLabel: S.of(context).rateUs,
firstButtonOnTap: () async { firstButtonOnTap: () async {
UpdateService.instance.launchReviewUrl(); await UpdateService.instance.launchReviewUrl();
}, },
firstButtonType: ButtonType.primary, firstButtonType: ButtonType.primary,
secondButtonLabel: S.of(context).ok, secondButtonLabel: S.of(context).ok,
@ -265,7 +268,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
showToast( showToast(
context, context,
S.of(context).remindToEmptyDeviceTrash, S.of(context).remindToEmptyDeviceTrash,
); ).ignore();
} }
}, },
); );
@ -586,7 +589,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
} else if (value == AlbumPopupAction.map) { } else if (value == AlbumPopupAction.map) {
await showOnMap(); await showOnMap();
} else { } else {
showToast(context, S.of(context).somethingWentWrong); unawaited(showToast(context, S.of(context).somethingWentWrong));
} }
}, },
), ),
@ -602,21 +605,23 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
widget.collection!, widget.collection!,
); );
if (coverPhotoID != null) { if (coverPhotoID != null) {
changeCoverPhoto(context, widget.collection!, coverPhotoID); unawaited(changeCoverPhoto(context, widget.collection!, coverPhotoID));
} }
} }
Future<void> showOnMap() async { Future<void> showOnMap() async {
final bool result = await requestForMapEnable(context); final bool result = await requestForMapEnable(context);
if (result) { if (result) {
Navigator.of(context).push( unawaited(
MaterialPageRoute( Navigator.of(context).push(
builder: (context) => MapScreen( MaterialPageRoute(
filesFutureFn: () async { builder: (context) => MapScreen(
return FilesDB.instance.getAllFilesCollection( filesFutureFn: () async {
widget.collection!.id, return FilesDB.instance.getAllFilesCollection(
); widget.collection!.id,
}, );
},
),
), ),
), ),
); );
@ -644,7 +649,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
], ],
); );
if (sortByAsc != null) { if (sortByAsc != null) {
changeSortOrder(bContext, widget.collection!, sortByAsc); unawaited(changeSortOrder(bContext, widget.collection!, sortByAsc));
} }
} }

View file

@ -116,7 +116,7 @@ Future<void> changeSortOrder(
); );
} catch (e, s) { } catch (e, s) {
_logger.severe("failed to update collection visibility", e, s); _logger.severe("failed to update collection visibility", e, s);
showShortToast(context, S.of(context).somethingWentWrong); unawaited(showShortToast(context, S.of(context).somethingWentWrong));
rethrow; rethrow;
} }
} }