mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-27 03:28:40 +00:00
@@ -358,6 +358,54 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
||||
),
|
||||
);
|
||||
|
||||
void onSelectColor(int index) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 16),
|
||||
title: Text.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
const TextSpan(
|
||||
text: 'Color Picker ',
|
||||
style: TextStyle(fontSize: 15),
|
||||
),
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: Container(
|
||||
height: 10,
|
||||
width: 10,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: _blockColor[index],
|
||||
),
|
||||
),
|
||||
style: const TextStyle(fontSize: 13, height: 1),
|
||||
),
|
||||
TextSpan(
|
||||
text: ' ${_blockSettings[index].first.title}',
|
||||
style: const TextStyle(fontSize: 13, height: 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
content: SlideColorPicker(
|
||||
color: _blockColor[index],
|
||||
callback: (Color? color) {
|
||||
_blockColor[index] = color ?? _blockSettings[index].first.color;
|
||||
setting.put(
|
||||
SettingBoxKey.blockColor,
|
||||
_blockColor
|
||||
.map((item) => item.value.toRadixString(16).substring(2))
|
||||
.toList());
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
@@ -402,55 +450,7 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
||||
itemBuilder: (context, index) => ListTile(
|
||||
dense: true,
|
||||
enabled: _blockSettings[index].second != SkipType.disable,
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 16),
|
||||
title: Text.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
const TextSpan(
|
||||
text: 'Color Picker ',
|
||||
style: TextStyle(fontSize: 15),
|
||||
),
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: Container(
|
||||
height: 10,
|
||||
width: 10,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: _blockColor[index],
|
||||
),
|
||||
),
|
||||
style: const TextStyle(fontSize: 13, height: 1),
|
||||
),
|
||||
TextSpan(
|
||||
text: ' ${_blockSettings[index].first.title}',
|
||||
style: const TextStyle(fontSize: 13, height: 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
content: SlideColorPicker(
|
||||
color: _blockColor[index],
|
||||
callback: (Color? color) {
|
||||
_blockColor[index] =
|
||||
color ?? _blockSettings[index].first.color;
|
||||
setting.put(
|
||||
SettingBoxKey.blockColor,
|
||||
_blockColor
|
||||
.map((item) =>
|
||||
item.value.toRadixString(16).substring(2))
|
||||
.toList());
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
onTap: () => onSelectColor(index),
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user