Skip to content

Commit

Permalink
local blocking rules
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangtian616 committed May 19, 2024
1 parent e53c892 commit 32a36f1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ class ConfigureBlockingRulePage extends StatelessWidget {
controller: state.textEditingController,
textAlign: TextAlign.right,
decoration: InputDecoration(isDense: true),
onChanged: (text) => state.blockingExpression = text,
onChanged: (text) {
state.blockingExpression = text;
},
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BlockingRulePage extends StatelessWidget {
groups: Map.fromEntries(state.rules.map((rule) => MapEntry('${rule.target.desc.tr} - ${rule.attribute.desc.tr}', true))),
elements: state.rules,
elementGroup: (LocalBlockRule rule) => '${rule.target.desc.tr} - ${rule.attribute.desc.tr}',
groupBuilder: (context, groupName, isOpen) => _groupBuilder(context, groupName, isOpen).marginAll(5),
groupBuilder: (context, group, isOpen) => _groupBuilder(context, group, isOpen).marginAll(5),
elementBuilder: (BuildContext context, LocalBlockRule rule, isOpen) => _itemBuilder(context, rule),
groupUniqueKey: (String group) => group,
elementUniqueKey: (LocalBlockRule rule) => rule.id.toString(),
Expand Down Expand Up @@ -97,10 +97,21 @@ class BlockingRulePage extends StatelessWidget {
),
child: Row(
children: [
const SizedBox(width: 12),
const SizedBox(width: 16),
Text(groupName, maxLines: 1, overflow: TextOverflow.ellipsis),
const Expanded(child: SizedBox()),
GroupOpenIndicator(isOpen: isOpen).marginOnly(right: 8),
IconButton(
icon: const Icon(Icons.add),
onPressed: () {
toRoute(
Routes.configureBlockingRules,
arguments: ConfigureBlockingRulePageArgument(
mode: ConfigureBlockingRulePageMode.add,
),
)?.then((_) => logic.getBlockRules());
},
),
const SizedBox(width: 8),
],
),
),
Expand All @@ -114,6 +125,7 @@ class BlockingRulePage extends StatelessWidget {
title: Text(rule.expression),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
trailing: _buildListTileTrailing(context, rule),
contentPadding: const EdgeInsets.only(left: 16, right: 8),
onTap: () => _showOperationBottomSheet(context, rule),
).paddingSymmetric(horizontal: 5);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: jhentai
description: A flutter app for E-Hentai/EXHentai

publish_to: 'none'
version: 7.5.3+216
version: 7.5.3+217

environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down

0 comments on commit 32a36f1

Please sign in to comment.