textField input & auto calculated text in flutter

734 views
Skip to first unread message

Samer Jallad

unread,
May 9, 2021, 12:59:09 AM5/9/21
to Flutter Development (flutter-dev)
good morning i have an issue & I will be appreciated if someone can help me
I started Flutter recently because i need to make an IOS copy from already lunched App on android using Java... the aim is to make 3 textFields which allow the user from entering the text & at the same time it will do simple math calculation... for example if textField1 & textField2 entered the summation of 1 & 2 will be shown in textField3, the user can keep the value and use it or re-type it, the same should happen for textField1&textField3, the result will be displayed in textField2... so I tried several time to do so, but I have some issues that once summation is entered in textField3 i can't change it...also i can't apply the first step to the second case.. textField case.gif
 my code is attached & I really appreciate any help or hint to solve this issue


Flutter1.txt

Suzuki Tomohiro

unread,
May 9, 2021, 7:56:10 AM5/9/21
to Samer Jallad, Flutter Development (flutter-dev)
key: Key(totalCalculated()),

This is strange. I’ve never seen a key calculated by a function. Would you explain what you want by this line?

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/b7347234-0b1f-433a-be3f-601a7112d465n%40googlegroups.com.

Samer Jallad

unread,
May 9, 2021, 10:03:12 AM5/9/21
to Suzuki Tomohiro, Flutter Development (flutter-dev)
Hi, 
And thanks for replying, I put the key to keep monitoring the changes in the controller... Whenever I remove the key related to the function the APP stop updating the textField(maybe I am doing it wrong) 
The perpose of my app is to create input text Feilds to allow the user to input data in the same time in the same fields it will give calculation as a guide line for the values to be entered.... The same was done using Java 
Thanks again and regards, 


Sent from my Huawei phone

Suzuki Tomohiro

unread,
May 9, 2021, 10:46:15 AM5/9/21
to Samer Jallad, Flutter Development (flutter-dev)
The statement “Whenever I remove the key related to the function the APP stop updating the textField” does not explain how/why it works. Would you elaborate a bit more?



This code below is also strange.
int.parse(velocityEditingController.toString())
Maybe you want
int.parse(velocityEditingController.text())

Samer Jallad

unread,
May 10, 2021, 10:31:16 PM5/10/21
to Flutter Development (flutter-dev)
Dear All, I almost solved the issue but still I have one thing which still making a problem for me. the issue is how can I disable/remove the control listener for a textField in flutter, I am using 3 textField connected with a simple math.. (textField1 + textField2 = textField3) & (textField1 - textField3 = textField2)... I need to change the value of textField3 & keep the value of textField2 unchanged?. this is the current situation... also the code is attached ... please need help & thanks RemoveTextField.gif
textField 11-5-2021.txt

Suzuki Tomohiro

unread,
May 10, 2021, 11:02:56 PM5/10/21
to Samer Jallad, Flutter Development (flutter-dev)
> how can I disable/remove the control listener for a textField in flutter

Use removeListener.


Samer Jallad

unread,
May 10, 2021, 11:13:41 PM5/10/21
to Flutter Development (flutter-dev)
Thanks I will try
Reply all
Reply to author
Forward
0 new messages