mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
chore: code clean up
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -10,9 +10,7 @@ import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:PiliPalaX/http/dynamics.dart';
|
||||
import 'package:PiliPalaX/http/search.dart';
|
||||
import 'package:PiliPalaX/models/bangumi/info.dart';
|
||||
import 'package:PiliPalaX/models/common/dynamics_type.dart';
|
||||
import 'package:PiliPalaX/models/common/search_type.dart';
|
||||
import 'package:PiliPalaX/models/dynamics/result.dart';
|
||||
import 'package:PiliPalaX/models/dynamics/up.dart';
|
||||
import 'package:PiliPalaX/models/live/item.dart';
|
||||
@@ -133,13 +131,13 @@ class DynamicsController extends GetxController
|
||||
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_PGC':
|
||||
print('番剧');
|
||||
debugPrint('番剧');
|
||||
SmartDialog.showToast('暂未支持的类型,请联系开发者');
|
||||
break;
|
||||
|
||||
/// 纯文字动态查看
|
||||
case 'DYNAMIC_TYPE_WORD':
|
||||
print('纯文本');
|
||||
debugPrint('纯文本');
|
||||
Utils.toDupNamed('/dynamicDetail',
|
||||
arguments: {'item': item, 'floor': floor});
|
||||
break;
|
||||
@@ -175,7 +173,7 @@ class DynamicsController extends GetxController
|
||||
|
||||
/// 番剧查看
|
||||
case 'DYNAMIC_TYPE_PGC_UNION':
|
||||
print('DYNAMIC_TYPE_PGC_UNION 番剧');
|
||||
debugPrint('DYNAMIC_TYPE_PGC_UNION 番剧');
|
||||
DynamicArchiveModel pgc = item.modules.moduleDynamic.major.pgc;
|
||||
if (pgc.epid != null) {
|
||||
Utils.viewBangumi(epId: pgc.epid);
|
||||
|
||||
@@ -14,7 +14,6 @@ import 'package:PiliPalaX/models/common/reply_type.dart';
|
||||
import 'package:PiliPalaX/models/dynamics/result.dart';
|
||||
import 'package:PiliPalaX/pages/dynamics/detail/index.dart';
|
||||
import 'package:PiliPalaX/pages/dynamics/widgets/author_panel.dart';
|
||||
import 'package:PiliPalaX/pages/video/detail/reply/widgets/reply_item.dart';
|
||||
import 'package:PiliPalaX/pages/video/detail/reply_reply/index.dart';
|
||||
import 'package:PiliPalaX/utils/feed_back.dart';
|
||||
import 'package:PiliPalaX/utils/id_utils.dart';
|
||||
@@ -24,7 +23,7 @@ import '../widgets/dynamic_panel.dart';
|
||||
|
||||
class DynamicDetailPage extends StatefulWidget {
|
||||
// const DynamicDetailPage({super.key});
|
||||
const DynamicDetailPage({Key? key}) : super(key: key);
|
||||
const DynamicDetailPage({super.key});
|
||||
|
||||
@override
|
||||
State<DynamicDetailPage> createState() => _DynamicDetailPageState();
|
||||
|
||||
@@ -21,8 +21,7 @@ import '../widgets/dynamic_panel.dart';
|
||||
import 'controller.dart';
|
||||
|
||||
class DynamicsTabPage extends StatefulWidget {
|
||||
const DynamicsTabPage({Key? key, required this.dynamicsType})
|
||||
: super(key: key);
|
||||
const DynamicsTabPage({super.key, required this.dynamicsType});
|
||||
|
||||
final String dynamicsType;
|
||||
|
||||
@@ -70,7 +69,7 @@ class _DynamicsTabPageState extends State<DynamicsTabPage>
|
||||
}
|
||||
});
|
||||
dynamicsController.mid.listen((mid) {
|
||||
print('midListen: $mid');
|
||||
// debugPrint('midListen: $mid');
|
||||
_dynamicsTabController.mid = mid;
|
||||
_dynamicsTabController.scrollController.jumpTo(0);
|
||||
_dynamicsTabController.onReload();
|
||||
@@ -89,7 +88,7 @@ class _DynamicsTabPageState extends State<DynamicsTabPage>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
// print(widget.dynamicsType + widget.mid.value.toString());
|
||||
// debugPrint(widget.dynamicsType + widget.mid.value.toString());
|
||||
return refreshIndicator(
|
||||
// key:
|
||||
// ValueKey<String>(widget.dynamicsType + widget.mid.value.toString()),
|
||||
|
||||
@@ -84,7 +84,7 @@ class _DynamicsPageState extends State<DynamicsPage>
|
||||
// ..addListener(() {
|
||||
// if (!_dynamicsController.tabController.indexIsChanging) {
|
||||
// // if (!mounted) return;
|
||||
// // print('indexChanging: ${_dynamicsController.tabController.index}');
|
||||
// // debugPrint('indexChanging: ${_dynamicsController.tabController.index}');
|
||||
// _dynamicsController
|
||||
// .onSelectType(_dynamicsController.tabController.index);
|
||||
// }
|
||||
@@ -99,7 +99,7 @@ class _DynamicsPageState extends State<DynamicsPage>
|
||||
upPanelPosition = UpPanelPosition.values[setting.get(
|
||||
SettingBoxKey.upPanelPosition,
|
||||
defaultValue: UpPanelPosition.leftFixed.code)];
|
||||
print('upPanelPosition: $upPanelPosition');
|
||||
debugPrint('upPanelPosition: $upPanelPosition');
|
||||
if (GStorage.setting
|
||||
.get(SettingBoxKey.dynamicsShowAllFollowedUp, defaultValue: false)) {
|
||||
_dynamicsController.scrollController.addListener(() {
|
||||
|
||||
@@ -17,8 +17,7 @@ class ActionPanel extends StatefulWidget {
|
||||
super.key,
|
||||
this.item,
|
||||
});
|
||||
// ignore: prefer_typing_uninitialized_variables
|
||||
final item;
|
||||
final dynamic item;
|
||||
|
||||
@override
|
||||
State<ActionPanel> createState() => _ActionPanelState();
|
||||
|
||||
@@ -19,7 +19,7 @@ Widget addWidget(item, context, type, {floor = 1}) {
|
||||
};
|
||||
Color bgColor = floor == 1
|
||||
? Theme.of(context).dividerColor.withOpacity(0.08)
|
||||
: Theme.of(context).colorScheme.background;
|
||||
: Theme.of(context).colorScheme.surface;
|
||||
switch (type) {
|
||||
case 'ADDITIONAL_TYPE_UGC':
|
||||
// 转发的投稿
|
||||
@@ -40,7 +40,7 @@ Widget addWidget(item, context, type, {floor = 1}) {
|
||||
SmartDialog.showToast(err.toString());
|
||||
}
|
||||
} else {
|
||||
print("No match found.");
|
||||
debugPrint("No match found.");
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
|
||||
@@ -15,8 +15,8 @@ class DynamicPanel extends StatelessWidget {
|
||||
required this.item,
|
||||
this.source,
|
||||
this.onRemove,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
super.key,
|
||||
});
|
||||
|
||||
final DynamicsController _dynamicsController = Get.put(DynamicsController());
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ InlineSpan richNode(item, context) {
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
print('❌rich_node_panel err: $err');
|
||||
debugPrint('❌rich_node_panel err: $err');
|
||||
return spacer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,7 @@ import 'package:PiliPalaX/utils/utils.dart';
|
||||
class UpPanel extends StatefulWidget {
|
||||
final FollowUpModel? upData;
|
||||
final ScrollController scrollController;
|
||||
const UpPanel(this.upData, this.scrollController, {Key? key})
|
||||
: super(key: key);
|
||||
const UpPanel(this.upData, this.scrollController, {super.key});
|
||||
|
||||
@override
|
||||
State<UpPanel> createState() => _UpPanelState();
|
||||
@@ -49,7 +48,7 @@ class _UpPanelState extends State<UpPanel> {
|
||||
height: 45,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(const EdgeInsets.only()),
|
||||
padding: WidgetStateProperty.all(const EdgeInsets.only()),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user