mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: pure black theme
Closes #254 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -275,9 +275,10 @@ class _ListSheetContentState extends State<ListSheetContent>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Material(
|
||||||
height: Utils.getSheetHeight(context),
|
|
||||||
color: Theme.of(context).colorScheme.surface,
|
color: Theme.of(context).colorScheme.surface,
|
||||||
|
child: SizedBox(
|
||||||
|
height: Utils.getSheetHeight(context),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@@ -392,7 +393,8 @@ class _ListSheetContentState extends State<ListSheetContent>
|
|||||||
: MdiIcons.sortNumericDescending,
|
: MdiIcons.sortNumericDescending,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
reverse[_ctr?.index ?? 0] = !reverse[_ctr?.index ?? 0];
|
reverse[_ctr?.index ?? 0] =
|
||||||
|
!reverse[_ctr?.index ?? 0];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -411,8 +413,7 @@ class _ListSheetContentState extends State<ListSheetContent>
|
|||||||
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
||||||
),
|
),
|
||||||
if (_isList)
|
if (_isList)
|
||||||
Material(
|
TabBar(
|
||||||
child: TabBar(
|
|
||||||
controller: _ctr,
|
controller: _ctr,
|
||||||
padding: const EdgeInsets.only(right: 60),
|
padding: const EdgeInsets.only(right: 60),
|
||||||
isScrollable: true,
|
isScrollable: true,
|
||||||
@@ -422,7 +423,6 @@ class _ListSheetContentState extends State<ListSheetContent>
|
|||||||
dividerHeight: 1,
|
dividerHeight: 1,
|
||||||
dividerColor: Theme.of(context).dividerColor.withOpacity(0.1),
|
dividerColor: Theme.of(context).dividerColor.withOpacity(0.1),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: _isList
|
child: _isList
|
||||||
? TabBarView(
|
? TabBarView(
|
||||||
@@ -437,6 +437,7 @@ class _ListSheetContentState extends State<ListSheetContent>
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,8 +465,7 @@ class _ListSheetContentState extends State<ListSheetContent>
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildBody(i, episodes) => Material(
|
Widget _buildBody(i, episodes) => ScrollablePositionedList.separated(
|
||||||
child: ScrollablePositionedList.separated(
|
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
bottom: MediaQuery.of(context).padding.bottom + 80,
|
bottom: MediaQuery.of(context).padding.bottom + 80,
|
||||||
),
|
),
|
||||||
@@ -488,6 +488,5 @@ class _ListSheetContentState extends State<ListSheetContent>
|
|||||||
height: 1,
|
height: 1,
|
||||||
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,14 @@ Widget statDanMu({
|
|||||||
String? theme,
|
String? theme,
|
||||||
dynamic danmu,
|
dynamic danmu,
|
||||||
String? size,
|
String? size,
|
||||||
|
Color? textColor,
|
||||||
}) {
|
}) {
|
||||||
Map<String, Color> colorObject = {
|
Map<String, Color> colorObject = {
|
||||||
'white': Colors.white,
|
'white': Colors.white,
|
||||||
'gray': Theme.of(context).colorScheme.outline.withOpacity(0.8),
|
'gray': Theme.of(context).colorScheme.outline.withOpacity(0.8),
|
||||||
'black': Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
|
'black': Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
|
||||||
};
|
};
|
||||||
Color color = colorObject[theme]!;
|
Color color = textColor ?? colorObject[theme]!;
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
|
|||||||
@@ -7,13 +7,14 @@ Widget statView({
|
|||||||
dynamic view,
|
dynamic view,
|
||||||
String? size,
|
String? size,
|
||||||
String? goto,
|
String? goto,
|
||||||
|
Color? textColor,
|
||||||
}) {
|
}) {
|
||||||
Map<String, Color> colorObject = {
|
Map<String, Color> colorObject = {
|
||||||
'white': Colors.white,
|
'white': Colors.white,
|
||||||
'gray': Theme.of(context).colorScheme.outline.withOpacity(0.8),
|
'gray': Theme.of(context).colorScheme.outline.withOpacity(0.8),
|
||||||
'black': Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
|
'black': Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
|
||||||
};
|
};
|
||||||
Color color = colorObject[theme]!;
|
Color color = textColor ?? colorObject[theme]!;
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:PiliPlus/build_config.dart';
|
import 'package:PiliPlus/build_config.dart';
|
||||||
import 'package:PiliPlus/utils/cache_manage.dart';
|
import 'package:PiliPlus/utils/cache_manage.dart';
|
||||||
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flex_seed_scheme/flex_seed_scheme.dart';
|
import 'package:flex_seed_scheme/flex_seed_scheme.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_displaymode/flutter_displaymode.dart';
|
import 'package:flutter_displaymode/flutter_displaymode.dart';
|
||||||
@@ -177,6 +178,7 @@ class MyApp extends StatelessWidget {
|
|||||||
// tones: FlexTones.soft(Brightness.dark),
|
// tones: FlexTones.soft(Brightness.dark),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 图片缓存
|
// 图片缓存
|
||||||
// PaintingBinding.instance.imageCache.maximumSizeBytes = 1000 << 20;
|
// PaintingBinding.instance.imageCache.maximumSizeBytes = 1000 << 20;
|
||||||
return GetMaterialApp(
|
return GetMaterialApp(
|
||||||
@@ -229,7 +231,7 @@ class MyApp extends StatelessWidget {
|
|||||||
bool isDark = false,
|
bool isDark = false,
|
||||||
required FlexSchemeVariant variant,
|
required FlexSchemeVariant variant,
|
||||||
}) {
|
}) {
|
||||||
return ThemeData(
|
ThemeData themeData = ThemeData(
|
||||||
colorScheme: colorScheme,
|
colorScheme: colorScheme,
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
appBarTheme: AppBarTheme(
|
appBarTheme: AppBarTheme(
|
||||||
@@ -282,6 +284,10 @@ class MyApp extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
if (isDark && GStorage.isPureBlackTheme) {
|
||||||
|
themeData = Utils.darkenTheme(themeData);
|
||||||
|
}
|
||||||
|
return themeData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -450,6 +450,7 @@ class _BangumiInfoState extends State<BangumiInfo>
|
|||||||
return LayoutBuilder(
|
return LayoutBuilder(
|
||||||
builder: (BuildContext context, BoxConstraints constraints) {
|
builder: (BuildContext context, BoxConstraints constraints) {
|
||||||
return Material(
|
return Material(
|
||||||
|
color: Theme.of(context).colorScheme.surface,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(top: 1),
|
padding: const EdgeInsets.only(top: 1),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
|
|||||||
@@ -136,7 +136,6 @@ class _DynamicsPageState extends State<DynamicsPage>
|
|||||||
super.build(context);
|
super.build(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: upPanelPosition == UpPanelPosition.rightDrawer
|
leading: upPanelPosition == UpPanelPosition.rightDrawer
|
||||||
? _createDynamicBtn(false)
|
? _createDynamicBtn(false)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class DynamicPanel extends StatelessWidget {
|
|||||||
child: Material(
|
child: Material(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
color: Theme.of(context).cardColor.withOpacity(0.5),
|
color: Colors.transparent,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class _HomePageState extends State<HomePage>
|
|||||||
if (_homeController.tabs.length > 1) ...[
|
if (_homeController.tabs.length > 1) ...[
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Material(
|
Material(
|
||||||
|
color: Theme.of(context).colorScheme.surface,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 42,
|
height: 42,
|
||||||
child: TabBar(
|
child: TabBar(
|
||||||
|
|||||||
@@ -134,7 +134,9 @@ class _MemberPageNewState extends State<MemberPageNew>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget get _buildTab => TabBar(
|
Widget get _buildTab => Material(
|
||||||
|
color: Theme.of(context).colorScheme.surface,
|
||||||
|
child: TabBar(
|
||||||
controller: _userController.tabController,
|
controller: _userController.tabController,
|
||||||
tabs: _userController.tabs,
|
tabs: _userController.tabs,
|
||||||
onTap: (value) {
|
onTap: (value) {
|
||||||
@@ -142,6 +144,7 @@ class _MemberPageNewState extends State<MemberPageNew>
|
|||||||
_key.currentState?.outerController.animToTop();
|
_key.currentState?.outerController.animToTop();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget get _buildBody => SafeArea(
|
Widget get _buildBody => SafeArea(
|
||||||
@@ -198,9 +201,7 @@ class _MemberPageNewState extends State<MemberPageNew>
|
|||||||
bottom: needTab && (_userController.tab2?.length ?? -1) > 1
|
bottom: needTab && (_userController.tab2?.length ?? -1) > 1
|
||||||
? PreferredSize(
|
? PreferredSize(
|
||||||
preferredSize: Size.fromHeight(48),
|
preferredSize: Size.fromHeight(48),
|
||||||
child: Material(
|
|
||||||
child: _buildTab,
|
child: _buildTab,
|
||||||
),
|
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
actions: [
|
actions: [
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class HotKeyword extends StatelessWidget {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: width! / 2 - 4,
|
width: width! / 2 - 4,
|
||||||
child: Material(
|
child: Material(
|
||||||
|
color: Colors.transparent,
|
||||||
borderRadius: BorderRadius.circular(3),
|
borderRadius: BorderRadius.circular(3),
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
|
|||||||
@@ -31,9 +31,11 @@ class SearchText extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
onTap?.call(text);
|
onTap?.call(text);
|
||||||
},
|
},
|
||||||
onLongPress: () {
|
onLongPress: onLongPress != null
|
||||||
onLongPress?.call(text);
|
? () {
|
||||||
},
|
onLongPress!(text);
|
||||||
|
}
|
||||||
|
: null,
|
||||||
borderRadius: BorderRadius.circular(6),
|
borderRadius: BorderRadius.circular(6),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: padding ??
|
padding: padding ??
|
||||||
|
|||||||
@@ -294,7 +294,6 @@ class ArticlePanelController extends GetxController {
|
|||||||
await ctr.onRefresh();
|
await ctr.onRefresh();
|
||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
},
|
},
|
||||||
onLongPress: (_) {},
|
|
||||||
bgColor: item['value'] == currentOrderFilterval.value
|
bgColor: item['value'] == currentOrderFilterval.value
|
||||||
? Theme.of(context).colorScheme.secondaryContainer
|
? Theme.of(context).colorScheme.secondaryContainer
|
||||||
: null,
|
: null,
|
||||||
@@ -328,7 +327,6 @@ class ArticlePanelController extends GetxController {
|
|||||||
await ctr.onRefresh();
|
await ctr.onRefresh();
|
||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
},
|
},
|
||||||
onLongPress: (_) {},
|
|
||||||
bgColor: item['value'] == currentZoneFilterval.value
|
bgColor: item['value'] == currentZoneFilterval.value
|
||||||
? Theme.of(context).colorScheme.secondaryContainer
|
? Theme.of(context).colorScheme.secondaryContainer
|
||||||
: null,
|
: null,
|
||||||
|
|||||||
@@ -222,7 +222,6 @@ class UserPanelController extends GetxController {
|
|||||||
await ctr.onRefresh();
|
await ctr.onRefresh();
|
||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
},
|
},
|
||||||
onLongPress: (_) {},
|
|
||||||
bgColor: item['value'] == currentOrderFilterval.value
|
bgColor: item['value'] == currentOrderFilterval.value
|
||||||
? Theme.of(context).colorScheme.secondaryContainer
|
? Theme.of(context).colorScheme.secondaryContainer
|
||||||
: null,
|
: null,
|
||||||
@@ -256,7 +255,6 @@ class UserPanelController extends GetxController {
|
|||||||
await ctr.onRefresh();
|
await ctr.onRefresh();
|
||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
},
|
},
|
||||||
onLongPress: (_) {},
|
|
||||||
bgColor: item['value'] == currentUserTypeFilterval.value
|
bgColor: item['value'] == currentUserTypeFilterval.value
|
||||||
? Theme.of(context).colorScheme.secondaryContainer
|
? Theme.of(context).colorScheme.secondaryContainer
|
||||||
: null,
|
: null,
|
||||||
|
|||||||
@@ -38,12 +38,15 @@ Widget searchVideoPanel(context, ctr, LoadingState loadingState) {
|
|||||||
// spacing: ,
|
// spacing: ,
|
||||||
children: [
|
children: [
|
||||||
for (var i in controller.filterList) ...[
|
for (var i in controller.filterList) ...[
|
||||||
CustomFilterChip(
|
SearchText(
|
||||||
label: i['label'],
|
fontSize: 13,
|
||||||
type: i['type'],
|
text: i['label'],
|
||||||
selectedType: controller.selectedType.value,
|
bgColor: Colors.transparent,
|
||||||
callFn: (bool selected) async {
|
textColor:
|
||||||
debugPrint('selected: $selected');
|
controller.selectedType.value == i['type']
|
||||||
|
? Theme.of(context).colorScheme.primary
|
||||||
|
: Theme.of(context).colorScheme.outline,
|
||||||
|
onTap: (value) async {
|
||||||
controller.selectedType.value = i['type'];
|
controller.selectedType.value = i['type'];
|
||||||
ctr.order.value =
|
ctr.order.value =
|
||||||
i['type'].toString().split('.').last;
|
i['type'].toString().split('.').last;
|
||||||
@@ -122,51 +125,6 @@ Widget searchVideoPanel(context, ctr, LoadingState loadingState) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class CustomFilterChip extends StatelessWidget {
|
|
||||||
const CustomFilterChip({
|
|
||||||
this.label,
|
|
||||||
this.type,
|
|
||||||
this.selectedType,
|
|
||||||
this.callFn,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
final String? label;
|
|
||||||
final ArchiveFilterType? type;
|
|
||||||
final ArchiveFilterType? selectedType;
|
|
||||||
final Function? callFn;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return SizedBox(
|
|
||||||
height: 34,
|
|
||||||
child: FilterChip(
|
|
||||||
padding: const EdgeInsets.only(left: 8, right: 8),
|
|
||||||
labelPadding: EdgeInsets.zero,
|
|
||||||
label: Text(
|
|
||||||
label!,
|
|
||||||
style: const TextStyle(fontSize: 13),
|
|
||||||
),
|
|
||||||
labelStyle: TextStyle(
|
|
||||||
color: type == selectedType
|
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: Theme.of(context).colorScheme.outline),
|
|
||||||
selected: type == selectedType,
|
|
||||||
showCheckmark: false,
|
|
||||||
shape: ContinuousRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
),
|
|
||||||
selectedColor: Colors.transparent,
|
|
||||||
// backgroundColor:
|
|
||||||
// Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.5),
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
side: BorderSide.none,
|
|
||||||
onSelected: (bool selected) => callFn?.call(selected),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class VideoPanelController extends GetxController {
|
class VideoPanelController extends GetxController {
|
||||||
RxList<Map> filterList = [{}].obs;
|
RxList<Map> filterList = [{}].obs;
|
||||||
Rx<ArchiveFilterType> selectedType = ArchiveFilterType.values.first.obs;
|
Rx<ArchiveFilterType> selectedType = ArchiveFilterType.values.first.obs;
|
||||||
@@ -304,7 +262,6 @@ class VideoPanelController extends GetxController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onLongPress: (_) {},
|
|
||||||
bgColor: currentPubTimeFilterval == -1 &&
|
bgColor: currentPubTimeFilterval == -1 &&
|
||||||
(isFirst ? customPubBegin : customPubEnd)
|
(isFirst ? customPubBegin : customPubEnd)
|
||||||
? Theme.of(context).colorScheme.secondaryContainer
|
? Theme.of(context).colorScheme.secondaryContainer
|
||||||
@@ -380,7 +337,6 @@ class VideoPanelController extends GetxController {
|
|||||||
await ctr.onRefresh();
|
await ctr.onRefresh();
|
||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
},
|
},
|
||||||
onLongPress: (_) {},
|
|
||||||
bgColor: item['value'] == currentPubTimeFilterval
|
bgColor: item['value'] == currentPubTimeFilterval
|
||||||
? Theme.of(context)
|
? Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
@@ -431,7 +387,6 @@ class VideoPanelController extends GetxController {
|
|||||||
await ctr.onRefresh();
|
await ctr.onRefresh();
|
||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
},
|
},
|
||||||
onLongPress: (_) {},
|
|
||||||
bgColor: item['value'] == currentTimeFilterval
|
bgColor: item['value'] == currentTimeFilterval
|
||||||
? Theme.of(context)
|
? Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
@@ -469,7 +424,6 @@ class VideoPanelController extends GetxController {
|
|||||||
await ctr.onRefresh();
|
await ctr.onRefresh();
|
||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
},
|
},
|
||||||
onLongPress: (_) {},
|
|
||||||
bgColor: item['value'] == currentZoneFilterval
|
bgColor: item['value'] == currentZoneFilterval
|
||||||
? Theme.of(context)
|
? Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
|
|||||||
@@ -480,6 +480,18 @@ List<SettingsModel> get styleSettings => [
|
|||||||
title: '主题模式',
|
title: '主题模式',
|
||||||
getSubtitle: () => '当前模式:${GStorage.themeType.description}',
|
getSubtitle: () => '当前模式:${GStorage.themeType.description}',
|
||||||
),
|
),
|
||||||
|
SettingsModel(
|
||||||
|
settingsType: SettingsType.sw1tch,
|
||||||
|
leading: const Icon(Icons.invert_colors),
|
||||||
|
title: '纯黑主题',
|
||||||
|
setKey: SettingBoxKey.isPureBlackTheme,
|
||||||
|
defaultVal: false,
|
||||||
|
onChanged: (value) {
|
||||||
|
if (Theme.of(Get.context!).brightness == Brightness.dark) {
|
||||||
|
Get.forceAppUpdate();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
SettingsModel(
|
SettingsModel(
|
||||||
settingsType: SettingsType.normal,
|
settingsType: SettingsType.normal,
|
||||||
onTap: (setState) => Get.toNamed('/colorSetting'),
|
onTap: (setState) => Get.toNamed('/colorSetting'),
|
||||||
|
|||||||
@@ -557,6 +557,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
? videoDetail.stat?.view ?? '-'
|
? videoDetail.stat?.view ?? '-'
|
||||||
: videoItem['stat']?.view ?? '-',
|
: videoItem['stat']?.view ?? '-',
|
||||||
size: 'medium',
|
size: 'medium',
|
||||||
|
textColor: t.colorScheme.outline,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
statDanMu(
|
statDanMu(
|
||||||
@@ -566,6 +567,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
? videoDetail.stat?.danmu ?? '-'
|
? videoDetail.stat?.danmu ?? '-'
|
||||||
: videoItem['stat']?.danmu ?? '-',
|
: videoItem['stat']?.danmu ?? '-',
|
||||||
size: 'medium',
|
size: 'medium',
|
||||||
|
textColor: t.colorScheme.outline,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ class _FavPanelState extends State<FavPanel> {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Material(
|
child: Material(
|
||||||
|
color: Theme.of(context).colorScheme.surface,
|
||||||
child: FutureBuilder(
|
child: FutureBuilder(
|
||||||
future: _futureBuilderFuture,
|
future: _futureBuilderFuture,
|
||||||
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ class _GroupPanelState extends State<GroupPanel> {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Material(
|
child: Material(
|
||||||
|
color: Theme.of(context).colorScheme.surface,
|
||||||
child: FutureBuilder(
|
child: FutureBuilder(
|
||||||
future: _futureBuilderFuture,
|
future: _futureBuilderFuture,
|
||||||
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
||||||
|
|||||||
@@ -60,11 +60,9 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
|
|||||||
height: MediaQuery.of(context).padding.bottom,
|
height: MediaQuery.of(context).padding.bottom,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Material(
|
return VideoCardH(
|
||||||
child: VideoCardH(
|
|
||||||
videoItem: loadingState.response[index],
|
videoItem: loadingState.response[index],
|
||||||
showPubdate: true,
|
showPubdate: true,
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, childCount: loadingState.response.length + 1),
|
}, childCount: loadingState.response.length + 1),
|
||||||
|
|||||||
@@ -134,10 +134,7 @@ class ReplyItem extends StatelessWidget {
|
|||||||
indent: 55,
|
indent: 55,
|
||||||
endIndent: 15,
|
endIndent: 15,
|
||||||
height: 0.3,
|
height: 0.3,
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).colorScheme.outline.withOpacity(0.08),
|
||||||
.colorScheme
|
|
||||||
.onInverseSurface
|
|
||||||
.withOpacity(0.5),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -160,8 +160,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
indent: 55,
|
indent: 55,
|
||||||
endIndent: 15,
|
endIndent: 15,
|
||||||
height: 0.3,
|
height: 0.3,
|
||||||
color:
|
color: Theme.of(context).colorScheme.outline.withOpacity(0.08),
|
||||||
Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.5),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1280,7 +1280,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Material(
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (tabs.isEmpty)
|
if (tabs.isEmpty)
|
||||||
@@ -1307,8 +1306,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
'发弹幕',
|
'发弹幕',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color:
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
Theme.of(context).colorScheme.onSurfaceVariant,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1349,7 +1347,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1521,7 +1518,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
height: 1,
|
height: 1,
|
||||||
indent: 12,
|
indent: 12,
|
||||||
endIndent: 12,
|
endIndent: 12,
|
||||||
color: Theme.of(context).dividerColor.withOpacity(0.06),
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.outline
|
||||||
|
.withOpacity(0.08),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -97,3 +97,21 @@ extension Unique<E, Id> on List<E> {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension ColorExtension on Color {
|
||||||
|
Color darken([double amount = .5]) {
|
||||||
|
assert(amount >= 0 && amount <= 1, 'Amount must be between 0 and 1');
|
||||||
|
return Color.lerp(this, Colors.black, amount)!;
|
||||||
|
}
|
||||||
|
|
||||||
|
Color blend(Color color, [double fraction = 0.5]) {
|
||||||
|
assert(fraction >= 0 && fraction <= 1, 'Fraction must be between 0 and 1');
|
||||||
|
final blendedRed = (red * (1 - fraction) + color.red * fraction).toInt();
|
||||||
|
final blendedGreen =
|
||||||
|
(green * (1 - fraction) + color.green * fraction).toInt();
|
||||||
|
final blendedBlue = (blue * (1 - fraction) + color.blue * fraction).toInt();
|
||||||
|
final blendedAlpha =
|
||||||
|
(alpha * (1 - fraction) + color.alpha * fraction).toInt();
|
||||||
|
return Color.fromARGB(blendedAlpha, blendedRed, blendedGreen, blendedBlue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -367,6 +367,9 @@ class GStorage {
|
|||||||
static bool get coinWithLike =>
|
static bool get coinWithLike =>
|
||||||
GStorage.setting.get(SettingBoxKey.coinWithLike, defaultValue: false);
|
GStorage.setting.get(SettingBoxKey.coinWithLike, defaultValue: false);
|
||||||
|
|
||||||
|
static bool get isPureBlackTheme =>
|
||||||
|
GStorage.setting.get(SettingBoxKey.isPureBlackTheme, defaultValue: false);
|
||||||
|
|
||||||
static List<double> get dynamicDetailRatio => List<double>.from(setting
|
static List<double> get dynamicDetailRatio => List<double>.from(setting
|
||||||
.get(SettingBoxKey.dynamicDetailRatio, defaultValue: [60.0, 40.0]));
|
.get(SettingBoxKey.dynamicDetailRatio, defaultValue: [60.0, 40.0]));
|
||||||
|
|
||||||
@@ -599,6 +602,7 @@ class SettingBoxKey {
|
|||||||
showDmChart = 'showDmChart',
|
showDmChart = 'showDmChart',
|
||||||
enableCommAntifraud = 'enableCommAntifraud',
|
enableCommAntifraud = 'enableCommAntifraud',
|
||||||
coinWithLike = 'coinWithLike',
|
coinWithLike = 'coinWithLike',
|
||||||
|
isPureBlackTheme = 'isPureBlackTheme',
|
||||||
|
|
||||||
// Sponsor Block
|
// Sponsor Block
|
||||||
enableSponsorBlock = 'enableSponsorBlock',
|
enableSponsorBlock = 'enableSponsorBlock',
|
||||||
|
|||||||
@@ -44,6 +44,56 @@ class Utils {
|
|||||||
|
|
||||||
static const channel = MethodChannel("PiliPlus");
|
static const channel = MethodChannel("PiliPlus");
|
||||||
|
|
||||||
|
static darkenTheme(ThemeData themeData) {
|
||||||
|
// return themeData;
|
||||||
|
Color color = themeData.colorScheme.surfaceContainerHighest.darken(0.7);
|
||||||
|
return themeData.copyWith(
|
||||||
|
scaffoldBackgroundColor: Colors.black,
|
||||||
|
appBarTheme: themeData.appBarTheme.copyWith(
|
||||||
|
backgroundColor: Colors.black,
|
||||||
|
),
|
||||||
|
cardTheme: themeData.cardTheme.copyWith(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
dialogTheme: themeData.dialogTheme.copyWith(
|
||||||
|
backgroundColor: color,
|
||||||
|
),
|
||||||
|
bottomSheetTheme:
|
||||||
|
themeData.bottomSheetTheme.copyWith(backgroundColor: color),
|
||||||
|
bottomNavigationBarTheme:
|
||||||
|
themeData.bottomNavigationBarTheme.copyWith(backgroundColor: color),
|
||||||
|
navigationBarTheme:
|
||||||
|
themeData.navigationBarTheme.copyWith(backgroundColor: color),
|
||||||
|
navigationRailTheme:
|
||||||
|
themeData.navigationRailTheme.copyWith(backgroundColor: Colors.black),
|
||||||
|
colorScheme: themeData.colorScheme.copyWith(
|
||||||
|
primary: themeData.colorScheme.primary.darken(0.1),
|
||||||
|
onPrimary: themeData.colorScheme.onPrimary.darken(0.1),
|
||||||
|
primaryContainer: themeData.colorScheme.primaryContainer.darken(0.1),
|
||||||
|
onPrimaryContainer:
|
||||||
|
themeData.colorScheme.onPrimaryContainer.darken(0.1),
|
||||||
|
inversePrimary: themeData.colorScheme.inversePrimary.darken(0.1),
|
||||||
|
secondary: themeData.colorScheme.secondary.darken(0.1),
|
||||||
|
onSecondary: themeData.colorScheme.onSecondary.darken(0.1),
|
||||||
|
secondaryContainer:
|
||||||
|
themeData.colorScheme.secondaryContainer.darken(0.1),
|
||||||
|
onSecondaryContainer:
|
||||||
|
themeData.colorScheme.onSecondaryContainer.darken(0.1),
|
||||||
|
error: themeData.colorScheme.error.darken(0.1),
|
||||||
|
surface: Colors.black,
|
||||||
|
onSurface: themeData.colorScheme.onSurface.darken(0.15),
|
||||||
|
surfaceTint: themeData.colorScheme.surfaceTint.darken(),
|
||||||
|
inverseSurface: themeData.colorScheme.inverseSurface.darken(),
|
||||||
|
onInverseSurface: themeData.colorScheme.onInverseSurface.darken(),
|
||||||
|
surfaceContainer: themeData.colorScheme.surfaceContainer.darken(),
|
||||||
|
surfaceContainerHigh:
|
||||||
|
themeData.colorScheme.surfaceContainerHigh.darken(),
|
||||||
|
surfaceContainerHighest:
|
||||||
|
themeData.colorScheme.surfaceContainerHighest.darken(0.4),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
static void onCopyOrMove({
|
static void onCopyOrMove({
|
||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
required bool isCopy,
|
required bool isCopy,
|
||||||
|
|||||||
Reference in New Issue
Block a user