From 35b0a00c35d80d6055865bfa330f201d2f7aacc3 Mon Sep 17 00:00:00 2001 From: kmahmood74 Date: Thu, 15 Feb 2024 16:48:05 -0800 Subject: [PATCH] https://github.com/EnsembleUI/ensemble/issues/1242 Text and TextInput should return '' instead of null when value has not been set --- lib/widget/Text.dart | 2 +- lib/widget/input/form_textfield.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widget/Text.dart b/lib/widget/Text.dart index 233b509dd..28f3e7aa8 100644 --- a/lib/widget/Text.dart +++ b/lib/widget/Text.dart @@ -24,7 +24,7 @@ class EnsembleText extends StatefulWidget @override Map getters() { return { - 'text': () => _controller.text, + 'text': () => _controller.text ?? '', 'textStyle': () => _controller.textStyle }; } diff --git a/lib/widget/input/form_textfield.dart b/lib/widget/input/form_textfield.dart index 4c8d4ed7a..27fee4305 100644 --- a/lib/widget/input/form_textfield.dart +++ b/lib/widget/input/form_textfield.dart @@ -116,7 +116,7 @@ abstract class BaseTextInput extends StatefulWidget @override Map getters() { return { - 'value': () => textController.text, + 'value': () => textController.text ?? '' }; }