Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-30 14:50:54 +08:00
parent 80fa0240e9
commit 8d94c0405f
115 changed files with 3150 additions and 1438 deletions

View File

@@ -68,11 +68,13 @@ class _BarSetPageState extends State<BarSetPage> {
),
body: ReorderableListView(
onReorder: onReorder,
footer: SizedBox(
height: MediaQuery.viewPaddingOf(context).bottom + 30,
footer: Padding(
padding:
MediaQuery.viewPaddingOf(context).copyWith(top: 0, left: 0) +
const EdgeInsets.only(right: 34, top: 10),
child: const Align(
alignment: Alignment.centerRight,
child: Text('*长按拖动排序 '),
child: Text('*长按拖动排序'),
),
),
children: defaultBars

View File

@@ -53,142 +53,145 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
TextStyle subTitleStyle = theme.textTheme.labelMedium!.copyWith(
color: theme.colorScheme.outline,
);
final size = Get.size;
final size = MediaQuery.sizeOf(context);
final padding = MediaQuery.viewPaddingOf(
context,
).copyWith(top: 0, bottom: 0);
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(title: const Text('选择应用主题')),
body: SafeArea(
bottom: false,
child: ListView(
children: [
ListTile(
onTap: () async {
ThemeType? result = await showDialog(
context: context,
builder: (context) {
return SelectDialog<ThemeType>(
title: '主题模式',
value: ctr.themeType.value,
values: ThemeType.values.map((e) => (e, e.desc)).toList(),
);
},
);
if (result != null) {
try {
Get.find<MineController>().themeType.value = result;
} catch (_) {}
ctr.themeType.value = result;
GStorage.setting.put(SettingBoxKey.themeMode, result.index);
Get.changeThemeMode(result.toThemeMode);
}
},
leading: Container(
width: 40,
alignment: Alignment.center,
child: const Icon(Icons.flashlight_on_outlined),
),
title: Text('主题模式', style: titleStyle),
subtitle: Obx(
() => Text(
'当前模式:${ctr.themeType.value.desc}',
style: subTitleStyle,
),
body: ListView(
children: [
ListTile(
onTap: () async {
ThemeType? result = await showDialog(
context: context,
builder: (context) {
return SelectDialog<ThemeType>(
title: '主题模式',
value: ctr.themeType.value,
values: ThemeType.values.map((e) => (e, e.desc)).toList(),
);
},
);
if (result != null) {
try {
Get.find<MineController>().themeType.value = result;
} catch (_) {}
ctr.themeType.value = result;
GStorage.setting.put(SettingBoxKey.themeMode, result.index);
Get.changeThemeMode(result.toThemeMode);
}
},
leading: Container(
width: 40,
alignment: Alignment.center,
child: const Icon(Icons.flashlight_on_outlined),
),
title: Text('主题模式', style: titleStyle),
subtitle: Obx(
() => Text(
'当前模式:${ctr.themeType.value.desc}',
style: subTitleStyle,
),
),
Obx(
() => ListTile(
enabled: ctr.type.value != 0,
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text('调色板风格'),
PopupMenuButton(
enabled: ctr.type.value != 0,
initialValue: _dynamicSchemeVariant,
onSelected: (item) {
_dynamicSchemeVariant = item;
GStorage.setting.put(
SettingBoxKey.schemeVariant,
item.index,
);
Get.forceAppUpdate();
},
itemBuilder: (context) => FlexSchemeVariant.values
.map(
(item) => PopupMenuItem<FlexSchemeVariant>(
value: item,
child: Text(item.variantName),
),
)
.toList(),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
_dynamicSchemeVariant.variantName,
style: TextStyle(
height: 1,
fontSize: 13,
color: ctr.type.value == 0
? theme.colorScheme.outline.withValues(
alpha: 0.8,
)
: theme.colorScheme.secondary,
),
strutStyle: const StrutStyle(leading: 0, height: 1),
),
Obx(
() => ListTile(
enabled: ctr.type.value != 0,
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text('调色板风格'),
PopupMenuButton(
enabled: ctr.type.value != 0,
initialValue: _dynamicSchemeVariant,
onSelected: (item) {
_dynamicSchemeVariant = item;
GStorage.setting.put(
SettingBoxKey.schemeVariant,
item.index,
);
Get.forceAppUpdate();
},
itemBuilder: (context) => FlexSchemeVariant.values
.map(
(item) => PopupMenuItem<FlexSchemeVariant>(
value: item,
child: Text(item.variantName),
),
Icon(
size: 20,
Icons.keyboard_arrow_right,
)
.toList(),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
_dynamicSchemeVariant.variantName,
style: TextStyle(
height: 1,
fontSize: 13,
color: ctr.type.value == 0
? theme.colorScheme.outline.withValues(
alpha: 0.8,
)
: theme.colorScheme.secondary,
),
],
),
strutStyle: const StrutStyle(leading: 0, height: 1),
),
Icon(
size: 20,
Icons.keyboard_arrow_right,
color: ctr.type.value == 0
? theme.colorScheme.outline.withValues(
alpha: 0.8,
)
: theme.colorScheme.secondary,
),
],
),
],
),
leading: Container(
width: 40,
alignment: Alignment.center,
child: const Icon(Icons.palette_outlined),
),
subtitle: Text(
_dynamicSchemeVariant.description,
style: const TextStyle(fontSize: 12),
),
),
],
),
leading: Container(
width: 40,
alignment: Alignment.center,
child: const Icon(Icons.palette_outlined),
),
subtitle: Text(
_dynamicSchemeVariant.description,
style: const TextStyle(fontSize: 12),
),
),
Obx(
() => RadioListTile(
value: 0,
title: const Text('动态取色'),
groupValue: ctr.type.value,
onChanged: (dynamic val) {
ctr
..type.value = 0
..setting.put(SettingBoxKey.dynamicColor, true);
Get.forceAppUpdate();
},
),
),
Obx(
() => RadioListTile(
value: 0,
title: const Text('动态取色'),
groupValue: ctr.type.value,
onChanged: (dynamic val) {
ctr
..type.value = 0
..setting.put(SettingBoxKey.dynamicColor, true);
Get.forceAppUpdate();
},
),
Obx(
() => RadioListTile(
value: 1,
title: const Text('指定颜色'),
groupValue: ctr.type.value,
onChanged: (dynamic val) {
ctr
..type.value = 1
..setting.put(SettingBoxKey.dynamicColor, false);
Get.forceAppUpdate();
},
),
),
Obx(
() => RadioListTile(
value: 1,
title: const Text('指定颜色'),
groupValue: ctr.type.value,
onChanged: (dynamic val) {
ctr
..type.value = 1
..setting.put(SettingBoxKey.dynamicColor, false);
Get.forceAppUpdate();
},
),
AnimatedSize(
),
Padding(
padding: padding,
child: AnimatedSize(
curve: Curves.easeInOut,
alignment: Alignment.topCenter,
duration: const Duration(milliseconds: 200),
@@ -239,8 +242,11 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
),
),
),
...[
IgnorePointer(
),
...[
Padding(
padding: padding,
child: IgnorePointer(
child: Container(
height: size.height / 2,
width: size.width,
@@ -248,21 +254,21 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
child: const HomePage(),
),
),
IgnorePointer(
child: NavigationBar(
destinations: NavigationBarType.values
.map(
(item) => NavigationDestination(
icon: item.icon,
label: item.label,
),
)
.toList(),
),
),
IgnorePointer(
child: NavigationBar(
destinations: NavigationBarType.values
.map(
(item) => NavigationDestination(
icon: item.icon,
label: item.label,
),
)
.toList(),
),
],
),
],
),
],
),
);
}

View File

@@ -62,45 +62,44 @@ class _SetDisplayModeState extends State<SetDisplayMode> {
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(title: const Text('屏幕帧率设置')),
body: SafeArea(
bottom: false,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 25, top: 10, bottom: 5),
child: Text(
'没有生效重启app试试',
style: TextStyle(color: Theme.of(context).colorScheme.outline),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding:
MediaQuery.viewPaddingOf(context).copyWith(top: 0, bottom: 0) +
const EdgeInsets.only(left: 25, top: 10, bottom: 5),
child: Text(
'没有生效重启app试试',
style: TextStyle(color: Theme.of(context).colorScheme.outline),
),
Expanded(
child: ListView.builder(
itemCount: modes.length,
itemBuilder: (context, index) {
final DisplayMode mode = modes[index];
return RadioListTile<DisplayMode>(
value: mode,
title: mode == DisplayMode.auto
? const Text('自动')
: Text('$mode${mode == active ? ' [系统]' : ''}'),
groupValue: preferred,
onChanged: (DisplayMode? newMode) {
FlutterDisplayMode.setPreferredMode(
newMode!,
).whenComplete(
() => Future.delayed(
const Duration(milliseconds: 100),
fetchAll,
),
);
},
);
},
),
),
Expanded(
child: ListView.builder(
itemCount: modes.length,
itemBuilder: (context, index) {
final DisplayMode mode = modes[index];
return RadioListTile<DisplayMode>(
value: mode,
title: mode == DisplayMode.auto
? const Text('自动')
: Text('$mode${mode == active ? ' [系统]' : ''}'),
groupValue: preferred,
onChanged: (DisplayMode? newMode) {
FlutterDisplayMode.setPreferredMode(
newMode!,
).whenComplete(
() => Future.delayed(
const Duration(milliseconds: 100),
fetchAll,
),
);
},
);
},
),
],
),
),
],
),
);
}

View File

@@ -55,7 +55,6 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
),
),
Container(
width: double.infinity,
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
border: Border(

View File

@@ -181,7 +181,7 @@ class _LogsPageState extends State<LogsPage> {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
spacing: 5,
children: [
@@ -222,8 +222,7 @@ class _LogsPageState extends State<LogsPage> {
],
),
Card(
child: Container(
width: double.infinity,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: SelectableText(log.body),
),

View File

@@ -1,12 +1,13 @@
import 'dart:math';
import 'package:PiliPlus/common/widgets/list_tile.dart';
import 'package:PiliPlus/common/widgets/view_safe_area.dart';
import 'package:PiliPlus/pages/setting/widgets/switch_item.dart';
import 'package:PiliPlus/utils/context_ext.dart';
import 'package:PiliPlus/utils/storage.dart';
import 'package:PiliPlus/utils/storage_key.dart';
import 'package:PiliPlus/utils/storage_pref.dart';
import 'package:flutter/material.dart';
import 'package:flutter/material.dart' hide ListTile;
import 'package:flutter/services.dart' show FilteringTextInputFormatter;
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart' hide ContextExtensionss;