mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +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,
|
alignment: Alignment.centerRight,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
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,
|
value: true,
|
||||||
onChanged: (_) {},
|
onChanged: (_) {},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -143,14 +143,6 @@ class _SetSwitchItemState extends State<SetSwitchItem> {
|
|||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
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,
|
value: val,
|
||||||
onChanged: (value) => switchChange(theme, value),
|
onChanged: (value) => switchChange(theme, value),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -123,14 +123,6 @@ class _SpaceSettingPageState extends State<SpaceSettingPage> {
|
|||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
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,
|
value: item.boolVal,
|
||||||
onChanged: onChanged,
|
onChanged: onChanged,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -227,12 +227,6 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
child: Switch(
|
||||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((states) {
|
|
||||||
if (states.isNotEmpty && states.first == WidgetState.selected) {
|
|
||||||
return const Icon(Icons.done);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}),
|
|
||||||
value: _blockToast,
|
value: _blockToast,
|
||||||
onChanged: (val) => update(),
|
onChanged: (val) => update(),
|
||||||
),
|
),
|
||||||
@@ -268,12 +262,6 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
child: Switch(
|
||||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((states) {
|
|
||||||
if (states.isNotEmpty && states.first == WidgetState.selected) {
|
|
||||||
return const Icon(Icons.done);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}),
|
|
||||||
value: _blockTrack,
|
value: _blockTrack,
|
||||||
onChanged: (val) => update(),
|
onChanged: (val) => update(),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -52,13 +52,6 @@ class _ViewPointsPageState extends State<ViewPointsPage>
|
|||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
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,
|
value: videoDetailController.showVP.value,
|
||||||
onChanged: (value) =>
|
onChanged: (value) =>
|
||||||
videoDetailController.showVP.value = value,
|
videoDetailController.showVP.value = value,
|
||||||
|
|||||||
@@ -92,14 +92,6 @@ class _WhisperLinkSettingPageState extends State<WhisperLinkSettingPage> {
|
|||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
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,
|
value: isBlocked,
|
||||||
onChanged: (value) => _controller.setBlock(isBlocked),
|
onChanged: (value) => _controller.setBlock(isBlocked),
|
||||||
),
|
),
|
||||||
@@ -202,15 +194,6 @@ class _WhisperLinkSettingPageState extends State<WhisperLinkSettingPage> {
|
|||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
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,
|
value: response.pushSetting == 0,
|
||||||
onChanged: (value) =>
|
onChanged: (value) =>
|
||||||
_controller.setPush(response.pushSetting == 0),
|
_controller.setPush(response.pushSetting == 0),
|
||||||
@@ -227,15 +210,6 @@ class _WhisperLinkSettingPageState extends State<WhisperLinkSettingPage> {
|
|||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
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,
|
value: _controller.isPinned.value,
|
||||||
onChanged: (value) => _controller.setPin(),
|
onChanged: (value) => _controller.setPin(),
|
||||||
),
|
),
|
||||||
@@ -266,15 +240,6 @@ class _WhisperLinkSettingPageState extends State<WhisperLinkSettingPage> {
|
|||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
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,
|
value: response!.first.setting == 1,
|
||||||
onChanged: (value) =>
|
onChanged: (value) =>
|
||||||
_controller.setMute(response.first.setting == 1),
|
_controller.setMute(response.first.setting == 1),
|
||||||
|
|||||||
@@ -53,12 +53,6 @@ class ImSettingsItem extends StatelessWidget {
|
|||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
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,
|
value: item.switch_1.switchOn,
|
||||||
onChanged: (value) => onChanged(),
|
onChanged: (value) => onChanged(),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -227,17 +227,6 @@ abstract class PageUtils {
|
|||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
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
|
value: shutdownTimerService
|
||||||
.waitForPlayingCompleted,
|
.waitForPlayingCompleted,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
|
|||||||
@@ -115,6 +115,14 @@ abstract class ThemeUtils {
|
|||||||
cupertinoOverrideTheme: CupertinoThemeData(
|
cupertinoOverrideTheme: CupertinoThemeData(
|
||||||
selectionHandleColor: colorScheme.primary,
|
selectionHandleColor: colorScheme.primary,
|
||||||
),
|
),
|
||||||
|
switchTheme: const SwitchThemeData(
|
||||||
|
thumbIcon: WidgetStateProperty<Icon?>.fromMap(
|
||||||
|
<WidgetStatesConstraint, Icon?>{
|
||||||
|
WidgetState.selected: Icon(Icons.done),
|
||||||
|
WidgetState.any: null,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
if (isDark) {
|
if (isDark) {
|
||||||
if (Pref.isPureBlackTheme) {
|
if (Pref.isPureBlackTheme) {
|
||||||
|
|||||||
Reference in New Issue
Block a user