Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

fix 2f218f8

ErBW_sabe15dd1b2a5
diff --git a/lib/bean/appbar/sys_app_bar.dart b/lib/bean/appbar/sys_app_bar.dart
index 496b1548..67907cca 100644
--- a/lib/bean/appbar/sys_app_bar.dart
+++ b/lib/bean/appbar/sys_app_bar.dart
@@ -68,7 +68,7 @@ class SysAppBar extends StatelessWidget implements PreferredSizeWidget {
if (Utils.isDesktop()) {
// acs.add(IconButton(onPressed: () => windowManager.minimize(), icon: const Icon(Icons.minimize)));
acs.add(Padding(
- padding: const EdgeInsets.only(right: 13),
+ padding: const EdgeInsets.only(right: 8),
child: CloseButton(onPressed: () => _handleCloseEvent())));
}
return GestureDetector(
diff --git a/lib/pages/menu/side_menu.dart b/lib/pages/menu/side_menu.dart
index daa9b911..f6274270 100644
--- a/lib/pages/menu/side_menu.dart
+++ b/lib/pages/menu/side_menu.dart
@@ -6,6 +6,7 @@ import 'package:provider/provider.dart';
class SideMenu extends StatefulWidget {
//const SideMenu({Key? key}) : super(key: key);
const SideMenu({super.key});
+
@override
State<SideMenu> createState() => _SideMenu();
}
@@ -15,6 +16,7 @@ class SideNavigationBarState extends ChangeNotifier {
bool _isRailVisible = true;
int get selectedIndex => _selectedIndex;
+
bool get isRailVisible => _isRailVisible;
void updateSelectedIndex(int pageIndex) {
@@ -37,87 +39,86 @@ class _SideMenu extends State<SideMenu> {
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider(
- create: (context) => SideNavigationBarState(),
- child: Scaffold(
- body: Padding(
- padding: const EdgeInsets.only(top: 8),
- child: Row(
- children: [
- Consumer<SideNavigationBarState>(
- builder: (context, state, child) {
- return SafeArea(
- child: Visibility(
- visible: state.isRailVisible,
- child: NavigationRail(
- groupAlignment: 1.0,
- labelType: NavigationRailLabelType.selected,
- leading: SizedBox(
- width: 50,
+ create: (context) => SideNavigationBarState(),
+ child: Scaffold(
+ body: Row(
+ children: [
+ Consumer<SideNavigationBarState>(builder: (context, state, child) {
+ return SafeArea(
+ child: Visibility(
+ visible: state.isRailVisible,
+ child: NavigationRail(
+ groupAlignment: 1.0,
+ labelType: NavigationRailLabelType.selected,
+ leading: SizedBox(
+ width: 50,
+ child: Padding(
+ padding: const EdgeInsets.only(top: 8),
child: ClipOval(
child: Image.asset(
'assets/images/logo/logo_android.png',
),
),
- ),
- destinations: const <NavigationRailDestination>[
- NavigationRailDestination(
- selectedIcon: Icon(Icons.home),
- icon: Icon(Icons.home_outlined),
- label: Text('推荐'),
- ),
- NavigationRailDestination(
- selectedIcon: Icon(Icons.timeline),
- icon: Icon(Icons.timeline_outlined),
- label: Text('时间表'),
- ),
- NavigationRailDestination(
- selectedIcon: Icon(Icons.favorite),
- icon: Icon(Icons.favorite_border),
- label: Text('追番'),
- ),
- NavigationRailDestination(
- selectedIcon: Icon(Icons.settings),
- icon: Icon(Icons.settings_outlined),
- label: Text('我的'),
- ),
- ],
- selectedIndex: state.selectedIndex,
- onDestinationSelected: (int index) {
- state.updateSelectedIndex(index);
- switch (index) {
- case 0:
- Modular.to.navigate('/tab/popular/');
- break;
- case 1:
- Modular.to.navigate('/tab/timeline/');
- break;
- case 2:
- Modular.to.navigate('/tab/favorite/');
- break;
- case 3:
- Modular.to.navigate('/tab/my/');
- break;
- }
- },
+ )),
+ destinations: const <NavigationRailDestination>[
+ NavigationRailDestination(
+ selectedIcon: Icon(Icons.home),
+ icon: Icon(Icons.home_outlined),
+ label: Text('推荐'),
+ ),
+ NavigationRailDestination(
+ selectedIcon: Icon(Icons.timeline),
+ icon: Icon(Icons.timeline_outlined),
+ label: Text('时间表'),
+ ),
+ NavigationRailDestination(
+ selectedIcon: Icon(Icons.favorite),
+ icon: Icon(Icons.favorite_border),
+ label: Text('追番'),
),
- ),
- );
- }),
- Expanded(
- child: Container(
- color: Theme.of(context).colorScheme.primaryContainer,
- child: PageView.builder(
- physics: const NeverScrollableScrollPhysics(),
- itemCount: menu.size,
- onPageChanged: (i) =>
- Modular.to.navigate("/tab${menu.getPath(i)}/"),
- itemBuilder: (_, __) => const RouterOutlet(),
- ),
+ NavigationRailDestination(
+ selectedIcon: Icon(Icons.settings),
+ icon: Icon(Icons.settings_outlined),
+ label: Text('我的'),
+ ),
+ ],
+ selectedIndex: state.selectedIndex,
+ onDestinationSelected: (int index) {
+ state.updateSelectedIndex(index);
+ switch (index) {
+ case 0:
+ Modular.to.navigate('/tab/popular/');
+ break;
+ case 1:
+ Modular.to.navigate('/tab/timeline/');
+ break;
+ case 2:
+ Modular.to.navigate('/tab/favorite/');
+ break;
+ case 3:
+ Modular.to.navigate('/tab/my/');
+ break;
+ }
+ },
),
),
- ],
+ );
+ }),
+ Expanded(
+ child: Container(
+ color: Theme.of(context).colorScheme.primaryContainer,
+ child: PageView.builder(
+ physics: const NeverScrollableScrollPhysics(),
+ itemCount: menu.size,
+ onPageChanged: (i) =>
+ Modular.to.navigate("/tab${menu.getPath(i)}/"),
+ itemBuilder: (_, __) => const RouterOutlet(),
+ ),
+ ),
),
- ),
- ));
+ ],
+ ),
+ ),
+ );
}
}
diff --git a/lib/pages/plugin_editor/plugin_shop_page.dart b/lib/pages/plugin_editor/plugin_shop_page.dart
index e1dffeed..0064b8d5 100644
--- a/lib/pages/plugin_editor/plugin_shop_page.dart
+++ b/lib/pages/plugin_editor/plugin_shop_page.dart
@@ -80,7 +80,7 @@ class _PluginShopPageState extends State<PluginShopPage> {
itemCount: pluginsController.pluginHTTPList.length,
itemBuilder: (context, index) {
return Card(
- margin: const EdgeInsets.fromLTRB(8, 8, 8, 0),
+ margin: const EdgeInsets.fromLTRB(8, 0, 8, 8),
child: ListTile(
title: Row(
children: [
diff --git a/lib/pages/plugin_editor/plugin_view_page.dart b/lib/pages/plugin_editor/plugin_view_page.dart
index ac7fe72a..ea449316 100644
--- a/lib/pages/plugin_editor/plugin_view_page.dart
+++ b/lib/pages/plugin_editor/plugin_view_page.dart
@@ -159,7 +159,7 @@ class _PluginViewPageState extends State<PluginViewPage> {
itemCount: pluginsController.pluginList.length,
itemBuilder: (context, index) {
return Card(
- margin: const EdgeInsets.fromLTRB(8, 8, 8, 0),
+ margin: const EdgeInsets.fromLTRB(8, 0, 8, 8),
child: ListTile(
title: Text(
pluginsController.pluginList[index].name,
diff --git a/lib/pages/popular/popular_page.dart b/lib/pages/popular/popular_page.dart
index f318c95a..8033328b 100644
--- a/lib/pages/popular/popular_page.dart
+++ b/lib/pages/popular/popular_page.dart
@@ -133,6 +133,38 @@ class _PopularPageState extends State<PopularPage>
)
: null,
backgroundColor: Colors.transparent,
+ actions: [
+ IconButton(
+ onPressed: () async {
+ if (!showSearchBar) {
+ setState(() {
+ showSearchBar = true;
+ });
+ _focusNode.requestFocus();
+ } else {
+ if (keywordController.text == '') {
+ _focusNode.unfocus();
+ setState(() {
+ showSearchBar = false;
+ searchLoading = true;
+ popularController.currentTag = '';
+ });
+ popularController.searchKeyword == '';
+ await popularController.queryBangumiListFeed();
+ setState(() {
+ searchLoading = false;
+ });
+ } else {
+ keywordController.text = '';
+ popularController.searchKeyword = '';
+ _focusNode.requestFocus();
+ }
+ }
+ },
+ icon: showSearchBar
+ ? const Icon(Icons.close)
+ : const Icon(Icons.search))
+ ],
title: Stack(
children: [
Positioned.fill(
@@ -142,103 +174,66 @@ class _PopularPageState extends State<PopularPage>
child: Container(),
),
),
- Row(
- children: [
- Expanded(
- child: Visibility(
- visible: showSearchBar,
- child: TextFormField(
- focusNode: _focusNode,
- cursorColor:
- Theme.of(context).colorScheme.primary,
- decoration: const InputDecoration(
- alignLabelWithHint: true,
- contentPadding: EdgeInsets.symmetric(
- vertical: 8, horizontal: 8),
- border: OutlineInputBorder(
- borderRadius:
- BorderRadius.all(Radius.circular(8)),
- ),
- ),
- style: TextStyle(
- color: isLight
- ? Colors.black87
- : Colors.white70),
- onChanged: (_) {
- scrollController.jumpTo(0.0);
- },
- controller: keywordController,
- onFieldSubmitted: (t) async {
- setState(() {
- timeout = false;
- searchLoading = true;
- popularController.currentTag = '';
- });
- if (t != '') {
- popularController.searchKeyword = t;
- await popularController
- .queryBangumi(
- popularController.searchKeyword)
- .then((_) {
- if (popularController.bangumiList.isEmpty &&
- mounted) {
- setState(() {
- timeout = true;
- });
- }
- });
- } else {
- popularController.searchKeyword = '';
- await popularController
- .queryBangumiListFeed()
- .then((_) {
- if (popularController.bangumiList.isEmpty &&
- mounted) {
- setState(() {
- timeout = true;
- });
- }
- });
- }
- setState(() {
- searchLoading = false;
- });
- },
+ Padding(
+ padding:
+ EdgeInsets.only(top: (Utils.isDesktop()) ? 8 : 0),
+ child: Visibility(
+ visible: showSearchBar,
+ child: TextFormField(
+ focusNode: _focusNode,
+ cursorColor: Theme.of(context).colorScheme.primary,
+ decoration: const InputDecoration(
+ alignLabelWithHint: true,
+ contentPadding: EdgeInsets.symmetric(
+ vertical: 8, horizontal: 8),
+ border: OutlineInputBorder(
+ borderRadius:
+ BorderRadius.all(Radius.circular(8)),
),
),
- ),
- IconButton(
- onPressed: () async {
- if (!showSearchBar) {
- setState(() {
- showSearchBar = true;
- });
- _focusNode.requestFocus();
- } else {
- if (keywordController.text == '') {
- _focusNode.unfocus();
+ style: TextStyle(
+ color: isLight ? Colors.black87 : Colors.white70),
+ onChanged: (_) {
+ scrollController.jumpTo(0.0);
+ },
+ controller: keywordController,
+ onFieldSubmitted: (t) async {
+ setState(() {
+ timeout = false;
+ searchLoading = true;
+ popularController.currentTag = '';
+ });
+ if (t != '') {
+ popularController.searchKeyword = t;
+ await popularController
+ .queryBangumi(popularController.searchKeyword)
+ .then((_) {
+ if (popularController.bangumiList.isEmpty &&
+ mounted) {
setState(() {
- showSearchBar = false;
- searchLoading = true;
- popularController.currentTag = '';
+ timeout = true;
});
- popularController.searchKeyword == '';
- await popularController
- .queryBangumiListFeed();
+ }
+ });
+ } else {
+ popularController.searchKeyword = '';
+ await popularController
+ .queryBangumiListFeed()
+ .then((_) {
+ if (popularController.bangumiList.isEmpty &&
+ mounted) {
setState(() {
- searchLoading = false;
+ timeout = true;
});
- } else {
- keywordController.text = '';
- popularController.searchKeyword = '';
- _focusNode.requestFocus();
}
- }
- },
- icon: showSearchBar
- ? const Icon(Icons.close)
- : const Icon(Icons.search))
- ],
+ });
+ }
+ setState(() {
+ searchLoading = false;
+ });
+ },
+ ),
+ ),
),
],
),