From 7fd63a08498f009c415216127e9399180d45cb15 Mon Sep 17 00:00:00 2001 From: Thomas Faust Date: Fri, 18 Mar 2022 17:43:41 +0100 Subject: [PATCH 1/2] check array access index - avoid exception --- lib/circular_text/widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } From ea07dc0d805c84e36655a4f23c7bf63681293313 Mon Sep 17 00:00:00 2001 From: Thomas Faust Date: Fri, 18 Mar 2022 17:52:39 +0100 Subject: [PATCH 2/2] update version and changelog --- CHANGELOG.md | 3 +++ pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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/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: