mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt switch style
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -44,14 +44,6 @@ List<SettingsModel> get videoSettings => [
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.isNotEmpty && states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.lock_outline_rounded);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
value: true,
|
||||
onChanged: (_) {},
|
||||
),
|
||||
|
||||
@@ -143,14 +143,6 @@ class _SetSwitchItemState extends State<SetSwitchItem> {
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.isNotEmpty && states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
value: val,
|
||||
onChanged: (value) => switchChange(theme, value),
|
||||
),
|
||||
|
||||
@@ -123,14 +123,6 @@ class _SpaceSettingPageState extends State<SpaceSettingPage> {
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.isNotEmpty && states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
value: item.boolVal,
|
||||
onChanged: onChanged,
|
||||
),
|
||||
|
||||
@@ -227,12 +227,6 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((states) {
|
||||
if (states.isNotEmpty && states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
value: _blockToast,
|
||||
onChanged: (val) => update(),
|
||||
),
|
||||
@@ -268,12 +262,6 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((states) {
|
||||
if (states.isNotEmpty && states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
value: _blockTrack,
|
||||
onChanged: (val) => update(),
|
||||
),
|
||||
|
||||
@@ -52,13 +52,6 @@ class _ViewPointsPageState extends State<ViewPointsPage>
|
||||
alignment: Alignment.centerLeft,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((states) {
|
||||
if (states.isNotEmpty &&
|
||||
states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
value: videoDetailController.showVP.value,
|
||||
onChanged: (value) =>
|
||||
videoDetailController.showVP.value = value,
|
||||
|
||||
@@ -92,14 +92,6 @@ class _WhisperLinkSettingPageState extends State<WhisperLinkSettingPage> {
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.isNotEmpty && states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
value: isBlocked,
|
||||
onChanged: (value) => _controller.setBlock(isBlocked),
|
||||
),
|
||||
@@ -202,15 +194,6 @@ class _WhisperLinkSettingPageState extends State<WhisperLinkSettingPage> {
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.isNotEmpty &&
|
||||
states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
value: response.pushSetting == 0,
|
||||
onChanged: (value) =>
|
||||
_controller.setPush(response.pushSetting == 0),
|
||||
@@ -227,15 +210,6 @@ class _WhisperLinkSettingPageState extends State<WhisperLinkSettingPage> {
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.isNotEmpty &&
|
||||
states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
value: _controller.isPinned.value,
|
||||
onChanged: (value) => _controller.setPin(),
|
||||
),
|
||||
@@ -266,15 +240,6 @@ class _WhisperLinkSettingPageState extends State<WhisperLinkSettingPage> {
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.isNotEmpty &&
|
||||
states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
value: response!.first.setting == 1,
|
||||
onChanged: (value) =>
|
||||
_controller.setMute(response.first.setting == 1),
|
||||
|
||||
@@ -53,12 +53,6 @@ class ImSettingsItem extends StatelessWidget {
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((states) {
|
||||
if (states.isNotEmpty && states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
value: item.switch_1.switchOn,
|
||||
onChanged: (value) => onChanged(),
|
||||
),
|
||||
|
||||
@@ -227,17 +227,6 @@ abstract class PageUtils {
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon:
|
||||
WidgetStateProperty.resolveWith<Icon?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.isNotEmpty &&
|
||||
states.first ==
|
||||
WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
value: shutdownTimerService
|
||||
.waitForPlayingCompleted,
|
||||
onChanged: (value) {
|
||||
|
||||
@@ -115,6 +115,14 @@ abstract class ThemeUtils {
|
||||
cupertinoOverrideTheme: CupertinoThemeData(
|
||||
selectionHandleColor: colorScheme.primary,
|
||||
),
|
||||
switchTheme: const SwitchThemeData(
|
||||
thumbIcon: WidgetStateProperty<Icon?>.fromMap(
|
||||
<WidgetStatesConstraint, Icon?>{
|
||||
WidgetState.selected: Icon(Icons.done),
|
||||
WidgetState.any: null,
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
if (isDark) {
|
||||
if (Pref.isPureBlackTheme) {
|
||||
|
||||
Reference in New Issue
Block a user