Skip to content

Commit

Permalink
Playの修正
Browse files Browse the repository at this point in the history
  • Loading branch information
shiosyakeyakini-info committed Oct 15, 2023
1 parent bc82275 commit 66f43ae
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/view/common/misskey_notes/mfm_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ class MfmTextState extends ConsumerState<MfmText> {
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);
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion lib/view/explore_page/explore_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -29,7 +30,7 @@ class ExplorePageState extends ConsumerState<ExplorePage> {
return AccountScope(
account: widget.account,
child: DefaultTabController(
length: 6,
length: 7,
child: Scaffold(
appBar: AppBar(
title: const Text("みつける"),
Expand All @@ -40,6 +41,7 @@ class ExplorePageState extends ConsumerState<ExplorePage> {
Tab(text: "ユーザー"),
Tab(text: "ロール"),
Tab(text: "ページ"),
Tab(text: "Play"),
Tab(text: "ハッシュタグ"),
Tab(text: "よそのサーバー"),
],
Expand All @@ -51,6 +53,7 @@ class ExplorePageState extends ConsumerState<ExplorePage> {
ExploreUsers(),
ExploreRole(),
ExplorePages(),
ExplorePlay(),
ExploreHashtags(),
ExploreServer(),
],
Expand Down
41 changes: 41 additions & 0 deletions lib/view/explore_page/explore_plays.dart
Original file line number Diff line number Diff line change
@@ -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<ConsumerStatefulWidget> createState() => ExplorePagesState();
}

class ExplorePagesState extends ConsumerState<ExplorePlay> {
@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),
);
}),
);
}
}
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 66f43ae

Please sign in to comment.