diff --git a/lib/view/common/misskey_notes/mfm_text.dart b/lib/view/common/misskey_notes/mfm_text.dart index f1c5ec337..23b068c07 100644 --- a/lib/view/common/misskey_notes/mfm_text.dart +++ b/lib/view/common/misskey_notes/mfm_text.dart @@ -96,9 +96,8 @@ class MfmTextState extends ConsumerState { uri.pathSegments.first.startsWith("@")) { await onMentionTap(uri.pathSegments.first); } else { - // 自サーバーは内部ブラウザで起動する if (await canLaunchUrl(uri)) { - await launchUrl(uri, mode: LaunchMode.inAppWebView); + await launchUrl(uri, mode: LaunchMode.externalApplication); } } } diff --git a/lib/view/explore_page/explore_page.dart b/lib/view/explore_page/explore_page.dart index 5a72e42c7..e56c62bec 100644 --- a/lib/view/explore_page/explore_page.dart +++ b/lib/view/explore_page/explore_page.dart @@ -6,6 +6,7 @@ import 'package:miria/view/common/account_scope.dart'; import 'package:miria/view/explore_page/explore_hashtags.dart'; import 'package:miria/view/explore_page/explore_highlight.dart'; import 'package:miria/view/explore_page/explore_pages.dart'; +import 'package:miria/view/explore_page/explore_plays.dart'; import 'package:miria/view/explore_page/explore_role.dart'; import 'package:miria/view/explore_page/explore_server.dart'; import 'package:miria/view/explore_page/explore_users.dart'; @@ -29,7 +30,7 @@ class ExplorePageState extends ConsumerState { return AccountScope( account: widget.account, child: DefaultTabController( - length: 6, + length: 7, child: Scaffold( appBar: AppBar( title: const Text("みつける"), @@ -40,6 +41,7 @@ class ExplorePageState extends ConsumerState { Tab(text: "ユーザー"), Tab(text: "ロール"), Tab(text: "ページ"), + Tab(text: "Play"), Tab(text: "ハッシュタグ"), Tab(text: "よそのサーバー"), ], @@ -51,6 +53,7 @@ class ExplorePageState extends ConsumerState { ExploreUsers(), ExploreRole(), ExplorePages(), + ExplorePlay(), ExploreHashtags(), ExploreServer(), ], diff --git a/lib/view/explore_page/explore_plays.dart b/lib/view/explore_page/explore_plays.dart new file mode 100644 index 000000000..3442550ca --- /dev/null +++ b/lib/view/explore_page/explore_plays.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:miria/providers.dart'; +import 'package:miria/view/common/account_scope.dart'; +import 'package:miria/view/common/futable_list_builder.dart'; +import 'package:miria/view/common/misskey_notes/mfm_text.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class ExplorePlay extends ConsumerStatefulWidget { + const ExplorePlay({super.key}); + + @override + ConsumerState createState() => ExplorePagesState(); +} + +class ExplorePagesState extends ConsumerState { + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(left: 10, right: 10), + child: FutureListView(future: () async { + final result = await ref + .read(misskeyProvider(AccountScope.of(context))) + .flash + .featured(); + return result.toList(); + }(), builder: (context, item) { + return ListTile( + onTap: () async { + await launchUrl(Uri( + scheme: "https", + host: AccountScope.of(context).host, + pathSegments: ["play", item.id])); + }, + title: MfmText(mfmText: item.title), + subtitle: MfmText(mfmText: item.summary), + ); + }), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index ced151782..8f21be9cb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -822,7 +822,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: "2d22027e241bfbce200c15f5fcc6e9f580b27542" + resolved-ref: "5effde0213f41a2ea127423eca3f946f846658b0" url: "https://github.com/shiosyakeyakini-info/misskey_dart.git" source: git version: "1.0.0"