Skip to content

Commit

Permalink
feat: add method: displayName to VertexComponent. Used textGetter.
Browse files Browse the repository at this point in the history
  • Loading branch information
CorvusYe committed Mar 28, 2024
1 parent eaf018c commit 7a89ca7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.2.3
- feat: add method: displayName to VertexComponent. Used textGetter.

## 0.2.2+2
- fix: edge panel display issue. Make overlay name unique.
- fix: increase the mouse touch area on the edge.
Expand Down
4 changes: 2 additions & 2 deletions lib/widgets/vertex_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ class VertexComponent extends ShapeComponent
}
}

String? displayName(String Function(Vertex<dynamic>)? textGetter) {
var txt = textGetter?.call(vertex);
String? displayName() {
var txt = gameRef.options.textGetter.call(vertex);
return '${vertex.id}${txt != vertex.id ? " ($txt) " : ""}';
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_graph_view
description: Widgets for beautiful graphic data structures, such as force-oriented diagrams.
version: 0.2.2+2
version: 0.2.3
homepage: https://github.com/dudu-ltd/flutter_graph_view

environment:
Expand Down

0 comments on commit 7a89ca7

Please sign in to comment.