From 6ae6b132de645a2bcd7e32145b14b9e49425a491 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Mon, 4 Aug 2025 22:37:20 +0800 Subject: [PATCH] :wheelchair: Use Solar Network drive hint --- assets/i18n/en-US.json | 1 + lib/widgets/post/compose_link_attachments.dart | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/assets/i18n/en-US.json b/assets/i18n/en-US.json index 1be0d34..003b12c 100644 --- a/assets/i18n/en-US.json +++ b/assets/i18n/en-US.json @@ -151,6 +151,7 @@ "recordAudio": "Record Audio", "linkAttachment": "Link Attachment", "fileIdCannotBeEmpty": "File ID cannot be empty", + "fileIdLinkHint": "Haven't upload to the Solar Network? Tap here to open Solar Network Drive to customize your uploads.", "failedToFetchFile": "Failed to fetch file: {}", "createDirectMessage": "Send new DM", "gotoDirectMessage": "Go to DM", diff --git a/lib/widgets/post/compose_link_attachments.dart b/lib/widgets/post/compose_link_attachments.dart index 71e4d21..f481574 100644 --- a/lib/widgets/post/compose_link_attachments.dart +++ b/lib/widgets/post/compose_link_attachments.dart @@ -11,6 +11,7 @@ import 'package:material_symbols_icons/symbols.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:riverpod_paging_utils/riverpod_paging_utils.dart'; import 'package:styled_widget/styled_widget.dart'; +import 'package:url_launcher/url_launcher_string.dart'; part 'compose_link_attachments.g.dart'; @@ -82,7 +83,7 @@ class ComposeLinkAttachment extends HookConsumerWidget { notifierRefreshable: cloudFileListNotifierProvider.notifier, contentBuilder: (data, widgetCount, endItemView) => ListView.builder( - padding: EdgeInsets.zero, + padding: EdgeInsets.only(top: 8), itemCount: widgetCount, itemBuilder: (context, index) { if (index == widgetCount - 1) { @@ -133,6 +134,7 @@ class ComposeLinkAttachment extends HookConsumerWidget { ), SingleChildScrollView( child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ TextField( controller: idController, @@ -148,6 +150,15 @@ class ComposeLinkAttachment extends HookConsumerWidget { FocusManager.instance.primaryFocus?.unfocus(), ), const Gap(16), + InkWell( + child: Text( + 'fileIdLinkHint', + ).tr().fontSize(13).opacity(0.85), + onTap: () { + launchUrlString('https://fs.solian.app'); + }, + ).padding(horizontal: 14), + const Gap(16), Align( alignment: Alignment.centerRight, child: TextButton.icon(