diff --git a/CHANGELOG.md b/CHANGELOG.md index ef29553..b7555a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.3.2 +* bugfix: avoid an exception when adding a new `TextItem` + ## 0.3.1 * Added null safety diff --git a/lib/circular_text/widget.dart b/lib/circular_text/widget.dart index d8a7f31..1a5f8db 100644 --- a/lib/circular_text/widget.dart +++ b/lib/circular_text/widget.dart @@ -151,7 +151,7 @@ class _CircularTextPainter extends CustomPainter { bool isTextItemsChanged() { bool isChanged = false; for (int i = 0; i < children.length; i++) { - if (children[i].isChanged(oldDelegate.children[i])) { + if (i >= oldDelegate.children.length || children[i].isChanged(oldDelegate.children[i])) { isChanged = true; break; } diff --git a/pubspec.yaml b/pubspec.yaml index ee3daeb..c30f433 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_circular_text description: Flutter package which places text in a curved circular path. -version: 0.3.1 +version: 0.3.2 homepage: https://github.com/faob-dev/flutter_circular_text environment: