mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-22 00:58:40 +00:00
fix update skip type
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -515,14 +515,20 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Builder(
|
Builder(
|
||||||
builder: (context) {
|
builder: (btnContext) {
|
||||||
return PopupMenuButton(
|
return PopupMenuButton<SkipType>(
|
||||||
initialValue: item.second,
|
initialValue: item.second,
|
||||||
onSelected: (e) {
|
onSelected: (e) {
|
||||||
|
final updateItem = e == SkipType.disable ||
|
||||||
|
item.second == SkipType.disable;
|
||||||
item.second = e;
|
item.second = e;
|
||||||
setting.put(SettingBoxKey.blockSettings,
|
setting.put(SettingBoxKey.blockSettings,
|
||||||
_blockSettings.map((e) => e.second.index).toList());
|
_blockSettings.map((e) => e.second.index).toList());
|
||||||
(context as Element).markNeedsBuild();
|
if (updateItem) {
|
||||||
|
(context as Element).markNeedsBuild();
|
||||||
|
} else {
|
||||||
|
(btnContext as Element).markNeedsBuild();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
itemBuilder: (context) => SkipType.values
|
itemBuilder: (context) => SkipType.values
|
||||||
.map((item) => PopupMenuItem<SkipType>(
|
.map((item) => PopupMenuItem<SkipType>(
|
||||||
|
|||||||
Reference in New Issue
Block a user