You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:win_text_editor/shared/components/tree_view.dart';
|
|
|
|
|
|
|
|
class TemplateNode implements TreeNode {
|
|
|
|
@override
|
|
|
|
final String name;
|
|
|
|
@override
|
|
|
|
final List<TemplateNode> children;
|
|
|
|
@override
|
|
|
|
final int depth;
|
|
|
|
@override
|
|
|
|
bool isExpanded;
|
|
|
|
|
|
|
|
final String path;
|
|
|
|
bool isRepeated;
|
|
|
|
bool isAttribute;
|
|
|
|
int repeatCount;
|
|
|
|
bool isChecked;
|
|
|
|
final bool isTextNode;
|
|
|
|
|
|
|
|
TemplateNode({
|
|
|
|
required this.name,
|
|
|
|
required this.children,
|
|
|
|
required this.depth,
|
|
|
|
required this.path,
|
|
|
|
this.isExpanded = false,
|
|
|
|
this.isRepeated = false,
|
|
|
|
this.isAttribute = false,
|
|
|
|
this.repeatCount = 1,
|
|
|
|
this.isChecked = false,
|
|
|
|
this.isTextNode = false,
|
|
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool get isDirectory => children.isNotEmpty;
|
|
|
|
|
|
|
|
@override
|
|
|
|
IconData? get iconData => isAttribute ? Icons.code : Icons.label_outline;
|
|
|
|
|
|
|
|
@override
|
|
|
|
String get id => path;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum NodeType { element, attribute, text }
|
|
|
|
|
|
|
|
class TemplateItem {
|
|
|
|
final int id;
|
|
|
|
final String rowId;
|
|
|
|
final String xPath;
|
|
|
|
final String value;
|
|
|
|
|
|
|
|
TemplateItem({required this.id, required this.rowId, required this.xPath, required this.value});
|
|
|
|
}
|