A rich text editor for Flutter with support for non-editable nodes, variable IDs, and custom callbacks. An extensible fork of flutter_quill.
- All features from the original flutter_quill package
- Support for non-editable text nodes
- Variable ID and name attributes for nodes
- Custom callbacks for node interactions
- Methods to delete nodes by ID or position
Add this to your package's pubspec.yaml
file:
dependencies:
quill_extensable: ^1.0.0
final controller = QuillController(
document: Document(),
selection: TextSelection.collapsed(offset: 0),
config: QuillControllerConfig(
onNonEditableNodeTap: (text, start, length, variableId, variableName) {
print('Clicked on variable: $variableName');
print('Variable ID: $variableId');
print('Text content: $text');
},
),
);
// Create a non-editable node with ID and variable name
controller.formatTextStyle(
index,
length,
Style().merge(Style().putAll([
Attribute.editable.withValue(false),
Attribute.variableId.withValue('123456'),
Attribute.variableName.withValue('userName'),
Attribute.bold,
Attribute.color.withValue('blue'),
]))
);
// Delete by position
controller.deleteNonEditableNode(offset);
// Delete by ID
controller.deleteNonEditableNodeById('123456');
{
"insert": "Variable de usuario",
"attributes": {
"editable": false,
"_id": "123456",
"variableName": "userName",
"bold": true,
"color": "blue"
}
}
This project is licensed under the MIT License - see the LICENSE file for details.
This package is a fork of flutter_quill with additional functionality.