Browse Source

模板节点展示扩展前

master
hejl 2 months ago
parent
commit
9e489b3da8
  1. 10
      win_text_editor/lib/modules/template_parser/widgets/template_parser_view.dart

10
win_text_editor/lib/modules/template_parser/widgets/template_parser_view.dart

@ -133,6 +133,8 @@ class _TemplateParserViewState extends State<TemplateParserView> {
final templateNode = node as TemplateNode; final templateNode = node as TemplateNode;
final isAttribute = node.depth > 0 && node.name.startsWith('@'); final isAttribute = node.depth > 0 && node.name.startsWith('@');
return Consumer<TemplateParserController>(
builder: (context, controller, _) {
return Padding( return Padding(
padding: EdgeInsets.only(left: 12.0 * node.depth), // padding: EdgeInsets.only(left: 12.0 * node.depth), //
child: ListTile( child: ListTile(
@ -152,13 +154,11 @@ class _TemplateParserViewState extends State<TemplateParserView> {
templateNode.isRepeated templateNode.isRepeated
? const Text("(repeated)", style: TextStyle(color: Colors.grey)) ? const Text("(repeated)", style: TextStyle(color: Colors.grey))
: null, : null,
onTap: onTap: () => controller.selectTreeNode(templateNode),
() => Provider.of<TemplateParserController>(
context,
listen: false,
).selectTreeNode(templateNode),
), ),
); );
},
);
} }
Widget _buildGridView(List<TemplateItem> items) { Widget _buildGridView(List<TemplateItem> items) {

Loading…
Cancel
Save