✨ Editable content rating
This commit is contained in:
@ -21,6 +21,7 @@ import 'package:surface/widgets/attachment/attachment_zoom.dart';
|
||||
import 'package:surface/widgets/attachment/pending_attachment_alt.dart';
|
||||
import 'package:surface/widgets/attachment/pending_attachment_boost.dart';
|
||||
import 'package:surface/widgets/attachment/pending_attachment_compress.dart';
|
||||
import 'package:surface/widgets/attachment/pending_attachment_rating.dart';
|
||||
import 'package:surface/widgets/dialog.dart';
|
||||
import 'package:surface/widgets/loading_indicator.dart';
|
||||
|
||||
@ -146,6 +147,17 @@ class _PendingAttachmentActionSheetState
|
||||
Navigator.pop(context, PostWriteMedia(result));
|
||||
}
|
||||
|
||||
Future<void> _setRating() async {
|
||||
final result = await showDialog<SnAttachment?>(
|
||||
context: context,
|
||||
builder: (context) => PendingAttachmentRateDialog(media: widget.media),
|
||||
);
|
||||
if (result == null) return;
|
||||
|
||||
if (!mounted) return;
|
||||
Navigator.pop(context, PostWriteMedia(result));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
@ -288,6 +300,13 @@ class _PendingAttachmentActionSheetState
|
||||
title: Text('attachmentSetAlt').tr(),
|
||||
onTap: () => _setAlt(),
|
||||
),
|
||||
ListTile(
|
||||
minTileHeight: 48,
|
||||
leading: const Icon(Symbols.star),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 24),
|
||||
title: Text('attachmentRating').tr(),
|
||||
onTap: () => _setRating(),
|
||||
),
|
||||
ListTile(
|
||||
minTileHeight: 48,
|
||||
leading: const Icon(Symbols.link_off),
|
||||
|
Reference in New Issue
Block a user