From d1d0a1076aad8cf2a880893c79f6ef6e97f92179 Mon Sep 17 00:00:00 2001 From: Predidit <34627277+Predidit@users.noreply.github.com> Date: Sun, 7 Apr 2024 11:12:10 +0800 Subject: [PATCH] version 1.1.5 --- lib/bean/anime/anime_panel.dart | 134 ++++++++++++++++++++++---------- lib/request/api.dart | 2 +- pubspec.yaml | 2 +- 3 files changed, 97 insertions(+), 41 deletions(-) diff --git a/lib/bean/anime/anime_panel.dart b/lib/bean/anime/anime_panel.dart index 397e53b..739d627 100644 --- a/lib/bean/anime/anime_panel.dart +++ b/lib/bean/anime/anime_panel.dart @@ -30,48 +30,104 @@ class _BangumiPanelState extends State { return Observer(builder: (context) { return Column( children: [ - Platform.isWindows ? Column( - children: [ - const SizedBox(height: 7), - SizedBox(height: 0, child: Text(' 正在播放:${videoController.title}')) - ], - ) : Padding( - padding: const EdgeInsets.only(top: 10, bottom: 6), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const Text('合集 '), - Expanded( - child: Text( - ' 正在播放:${videoController.title}', - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12, - color: Theme.of(context).colorScheme.outline, - ), - ), - ), - const SizedBox(width: 10), - SizedBox( - height: 34, - child: TextButton( - style: ButtonStyle( - padding: MaterialStateProperty.all(EdgeInsets.zero), - ), + Platform.isWindows + ? Column( + children: [ + const SizedBox(height: 7), + SizedBox( + height: 0, + child: Text(' 正在播放:${videoController.title}')) + ], + ) + : Padding( + padding: const EdgeInsets.only(top: 10, bottom: 6), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text('合集 '), + Expanded( + child: Text( + ' 正在播放:${videoController.title}', + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12, + color: Theme.of(context).colorScheme.outline, + ), + ), + ), + const SizedBox(width: 10), + SizedBox( + height: 34, + child: TextButton( + style: ButtonStyle( + padding: MaterialStateProperty.all(EdgeInsets.zero), + ), - // Todo 展示更多 - onPressed: () => {}, - child: Text( - '全${videoController.token.length}话', - style: const TextStyle(fontSize: 13), - ), + // Todo 展示更多 + onPressed: () { + if (MediaQuery.sizeOf(context).height < + MediaQuery.sizeOf(context).width) { + SmartDialog.show( + useAnimation: false, + builder: (context) { + return AlertDialog( + title: const Text('切换选集'), + content: StatefulBuilder(builder: + (BuildContext context, + StateSetter setState) { + return Wrap( + spacing: 8, + runSpacing: 2, + children: [ + for (int i = 1; + i <= + videoController + .token.length; + i++) ...[ + if (i == + videoController + .episode) ...[ + FilledButton( + onPressed: () async { + SmartDialog.dismiss(); + }, + child: + Text('第${i.toString()}话'), + ), + ] else ...[ + FilledButton.tonal( + onPressed: () async { + videoController + .changeEpisode(i); + SmartDialog.dismiss(); + }, + child: + Text('第${i.toString()}话'), + ), + ] + ] + ], + ); + }), + ); + }); + } + }, + child: Text( + '全${videoController.token.length}话', + style: const TextStyle(fontSize: 13), + ), + ), + ), + ], ), ), - ], - ), - ), SizedBox( - height: Platform.isWindows ? 72 : (MediaQuery.of(context).size.height - (MediaQuery.of(context).size.width * 9 /16 ) - 100), + height: Platform.isWindows + ? 72 + : (MediaQuery.of(context).size.height - + (MediaQuery.of(context).size.width * 9 / 16) - + 100), // width: Platform.isWindows ? 300: null, child: GridView.builder( controller: listViewScrollCtr, @@ -93,7 +149,7 @@ class _BangumiPanelState extends State { clipBehavior: Clip.hardEdge, child: InkWell( onTap: () { - changeFucCall(i + 1); + changeFucCall(i + 1); }, child: Padding( padding: const EdgeInsets.symmetric( diff --git a/lib/request/api.dart b/lib/request/api.dart index aa9bd86..b80c37c 100644 --- a/lib/request/api.dart +++ b/lib/request/api.dart @@ -4,7 +4,7 @@ class Api { static const String domain = HttpString.baseUrl + '/'; static const String animeList = 'https://d1zquzjgwo9yb.cloudfront.net/'; static const String videoAPI = 'https://v.anime1.me/api'; - static const String version = '1.1.4'; + static const String version = '1.1.5'; static const String sourceUrl = "https://github.com/Predidit/oneAnime"; static const String aniDanmakuAPI = "https://ani.gamer.com.tw/ajax/danmuGet.php"; static const String aniSearch = "https://ani.gamer.com.tw/search.php"; diff --git a/pubspec.yaml b/pubspec.yaml index 2696d06..c0b9f24 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.1.4+1 +version: 1.1.5+1 environment: sdk: '>=3.2.6 <4.0.0'