diff --git a/assets/tr.json b/assets/tr.json index f6e357d..65729a3 100644 --- a/assets/tr.json +++ b/assets/tr.json @@ -160,7 +160,8 @@ "Manga": "漫画", "Actions": "操作", "Current quantity": "当前数量", - "Display the original image on the details page": "在详情页显示原图" + "Display the original image on the details page": "在详情页显示原图", + "Open link": "打开链接" }, "zh_TW": { "Search": "搜索", @@ -323,6 +324,7 @@ "Manga": "漫畫", "Actions": "操作", "Current quantity": "當前數量", - "Display the original image on the details page": "在詳情頁顯示原圖" + "Display the original image on the details page": "在詳情頁顯示原圖", + "Open link": "打開鏈接" } } \ No newline at end of file diff --git a/lib/pages/search_page.dart b/lib/pages/search_page.dart index 0d6b4a7..ed87aa5 100644 --- a/lib/pages/search_page.dart +++ b/lib/pages/search_page.dart @@ -10,7 +10,9 @@ import 'package:pixes/network/network.dart'; import 'package:pixes/pages/illust_page.dart'; import 'package:pixes/pages/novel_page.dart'; import 'package:pixes/pages/user_info_page.dart'; +import 'package:pixes/utils/app_links.dart'; import 'package:pixes/utils/block.dart'; +import 'package:pixes/utils/ext.dart'; import 'package:pixes/utils/translation.dart'; import '../components/animated_image.dart'; @@ -41,6 +43,12 @@ class _SearchPageState extends State { ]; void search() { + if (text.isURL && handleLink(Uri.parse(text))) { + return; + } else if ("https://$text".isURL && + handleLink(Uri.parse("https://$text"))) { + return; + } switch (searchType) { case 0: context.to(() => SearchResultPage(text)); @@ -92,7 +100,8 @@ class _SearchPageState extends State { children: [ Expanded( child: TextBox( - placeholder: searchTypes[searchType].tl, + placeholder: + searchTypes[searchType].tl + ' / ' "Open link".tl, onChanged: (s) => text = s, onSubmitted: (s) => search(), foregroundDecoration: BoxDecoration( @@ -127,9 +136,9 @@ class _SearchPageState extends State { ), onPressed: () { optionController.showFlyout( - placementMode: FlyoutPlacementMode.bottomCenter, - builder: buildSearchOption, - ); + placementMode: FlyoutPlacementMode.bottomCenter, + builder: buildSearchOption, + barrierColor: Colors.transparent); }, ), ), diff --git a/pubspec.yaml b/pubspec.yaml index 414e3d6..f59a5f0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -56,7 +56,7 @@ dependencies: flutter_file_dialog: 3.0.1 archive: ^3.5.1 webview_flutter: ^4.7.0 - flutter_acrylic: ^1.0.0+2 + flutter_acrylic: 1.0.0+2 device_info_plus: ^10.1.0 dev_dependencies: flutter_test: