219 questions
1
vote
2
answers
79
views
Setting a widget property conditionally is not working
I have this widget:
TextInputSettingsTile(
title: 'Valor actual',
settingKey: 'current_value',
initialValue: '0',
keyboardType: isNumber
? TextInputType....
2
votes
1
answer
169
views
How to properly support different text heights for a TextField?
I'm working with a rich text field that has different text heights:
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const ...
1
vote
1
answer
91
views
How to find duplicate values in TextFormfield?
TextFormField duplicate values Passwords and IDs cannot overlap.
But I don't know how to code that
Is there anywhere that tells you how to do that?
TextFormField(
cursorColor:cousorColor,
...
0
votes
1
answer
71
views
How to prevent Textformfield from shrinking when the validation message appears?
This is my code for text form field
TextFormField(
autovalidateMode: AutovalidateMode.onUserInteraction,
validator: (value) {
if (value =...
1
vote
1
answer
45
views
How to center text in a custom TextFormField vertically
I am trying to center a text vertically in custom TextFormField which looks like this:
class CustomTextFormField extends StatelessWidget {
final TextEditingController controller;
final String? ...
1
vote
2
answers
83
views
How do I wrap a label in a TextFormField while keeping the floating label behavior in Flutter?
I am trying to create a TextFormField with a label that can wrap to multiple lines if the text is long. However, I want to keep the floating label behavior, which is the default behavior where the ...
0
votes
0
answers
82
views
TextField is automatically selected when start typing, causing the next letter to overwrite the existing text
I am experiencing an issue with TextField in Flutter 3.27.1 while running a desktop application on macOS 15.3.1. When I start typing in a TextField, the entire text gets selected automatically, ...
0
votes
1
answer
95
views
Text form field label text behaviour - flutter dart
This is the goal
This is what i made
I can't customize properly the behaviour of the label text
Container(
width: 270,
height: 40,
decoration: BoxDecoration(
color: const Color.fromARGB(255, ...
0
votes
1
answer
83
views
In flutter text field cursor position
In flutter I have a text field. now let say user types 2+2+2+2+2+2+2+2+2
and now he click on let say 2nd '2' from left and keeps typing '3' the text grows and moves to right and at some point my ...
0
votes
0
answers
42
views
Bottom overflow inside SingleChildScrollView when TextFormFields expand on error
I have a signup page with a bunch of TextFormFields that are inside a SingleChildScrollView so the user can scroll when the keyboard pops up. If I hit the signup button while the entries don't pass ...
0
votes
1
answer
91
views
How do I make the helper text in textform field appear conditionally
How do I make the helper text in textformfield appear conditionally I don't want helper text if there is no error and need when the error message needs to be displayed
helperText: Validator.validate(...
2
votes
1
answer
235
views
error in the textformfield in Flutter web, keyboard does not work
I'm having an issue with my Flutter Web system. My TextFormField fields are not working correctly in production. They worked perfectly before, but now, on version 3.24.3, when I try to type something ...
0
votes
0
answers
55
views
Unable to link DropdownButton to TextFormField in flutter using provider
Problem: I'm trying to link the value of a dropdown to a text field in Flutter. I'm using Provider for state management. The value from the dropdown updates the state correctly, but the text field is ...
0
votes
1
answer
65
views
Positioning Validator Message Outside of Border in Custom TextFormField in Flutter
am developing a Flutter application and using a CustomTextFormField widget to handle user input. However, I am facing an issue with the validator message appearing inside the border of the field, and ...
0
votes
2
answers
82
views
Show Icon after TextForm Field
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(height: 40),
Row(
children: [
SizedBox(...
0
votes
1
answer
65
views
Samsung autofill password breaks GestureDetector unfocus due to AutofillHints.password
I'm using the password autofill feature on my Android Samsung Galaxy A14, but after the keyboard updates the field, I lose my GestureDetector's onTap unfocus ability. Here's a video walkthrough ...
1
vote
1
answer
248
views
Properly handle linebreak from TextField in flutter to Markdown
I am having a TextField and I take the content from its controller like this:
var text = textController.text
when I do print(text.characters.toList()) I get this:
[t, e, s, t,
, a, s, d, f]
My raw ...
0
votes
1
answer
192
views
Flutter - Autofocus
I have three screens to navigate and second screen should get the autofocus on one TextFormField. Somehow my keyboard didn't want to close when I switched screen. Also tried with FocusNode and when I ...
1
vote
1
answer
181
views
How to Manage TextEditingControllers Across Multiple Pages in a PageView Using Provider?
I am building a Flutter application that includes an extensive form for Technician registration. The form is split across multiple pages using a PageView widget, with each page containing several ...
0
votes
1
answer
53
views
how to add textstyle for textformfield theme in flutter?
I have a register form where I have used many TextFormField.
instead of designing all TextFormField I have created InputDecoration theme for it,
but I don't know how to add textStyle to it.
I mean ...
1
vote
1
answer
120
views
TextFormField Error message on validation - Flutter
I have implemented SignIn screen in which I created customTextFormField cause I need to use it in another screen also but my concern is when someone enter the value in email field it will show error ...
0
votes
1
answer
132
views
How to trigger the undo controller of a text field in flutter test
I have this widget containing a TextField and a UndoHistoryController :
class _MyHomePageState extends State<MyHomePage> {
final TextEditingController _controller = TextEditingController();
...
0
votes
1
answer
81
views
When i don't give the optional suffixIcon to my customTextField the hintText also not visible
Text field code:
calling text field:
When i don't give the optional suffixIcon to my customTextField the hintText also not visible.
But when i give the suffixIcon hintText is visible. How can i ...
0
votes
5
answers
116
views
Text Color didn't change
I try to use FocusNode() in TextFormField so it will detect when I focus on the TextFormField, the text above will have it's color changed. But it seems not working, what seems to be the problem?
...
-4
votes
1
answer
99
views
flutter web issue: keyboard is not opening when pressed on textfield
When I add some text in Textfield then keyboard is not opening, closing automatically.
I have assigned UniqueKey to textfield's Key parameter.
I have added Form key as well.
My keyboard will open ...
1
vote
1
answer
137
views
Why is my number keyboard jumping to a default one. For a moment?
Did any of you happen to encounter this bug before? I'm trying to implement OTP for my app project, but during the quick focus change between the 6 fields, Flutter apparently doesn't have enough time ...
4
votes
1
answer
217
views
How to apply uniform letter spacing to all the letters being added to the TextFormField in Flutter?
Is it possible to apply letter spacing uniformly based on the text form field width and the letters being added to it?
For example, consider that my text form field width is 50, and I add a five-...
0
votes
2
answers
168
views
How to completely hide typed characters in a Flutter TextFormField?
In my Flutter app, I use a TextFormField, so my users can enter a password.
In order to hide the characters while they are being typed, I set the obscureText property to true. But on some devices, ...
0
votes
0
answers
70
views
Flutter- How to Get the Firebase Options Value in Text Instead Of the ID
I trying to select the options value that retrieved from Firebase (A1) but why the hint value that displayed in text field is along with the text value of the option that selected instead of change ...
0
votes
2
answers
73
views
Flutter TextFieled , The hint and cursor is in the bottom of the text filed even with specifying that the verticalTextAlign as Center
import 'package:flutter/material.dart';
class TextFiledMessageSend extends StatelessWidget {
const TextFiledMessageSend({super.key});
@override
Widget build(BuildContext context) {
return ...
1
vote
1
answer
99
views
Caret color changes to error text color in flutter textformfield
When my flutter textformfield throws a validation error, the caret color changes to the same color that I have set in errorStyle.
Is there a way to turn this off?
TextFormField(
controller: ...
1
vote
0
answers
277
views
Display the default/native context menu
I have an app with Flutter, which has a text field and button:
Row(
children: [
Expanded(
child: TextFormField(),
),
Expanded(
child: ElevatedButton(
onPressed: () {}...
0
votes
1
answer
156
views
How to add margin to hintText and Text in a TextFormField in flutter?
I would like to move the text down to be centered in the TextFormField.
[This is what it looks like]
(https://i.sstatic.net/0SoHm.png)
[This is what I want it to look - move the text down a few pixels ...
0
votes
0
answers
54
views
how to use startWith and substring in flutter
@override
Widget build(BuildContext context) {
final AppStateManager manager = AppStateManager.of(context);
String textLetter = manager.appState.replacementsController.text;
String ...
0
votes
1
answer
457
views
Keyboard closes immediately after opening in CustomTextField
I'm facing a persistent issue when using Flutter in my app. When clicking on a CustomTextField, the keyboard appears, but immediately closes, making typing impossible. I've tried several solutions, ...
1
vote
1
answer
138
views
How to focus the next field?
I have a page with several text fields, I used FocusTraversalGroup so the fields are focused in the desired order when pressing tab. See:
Now, when I click on the icon button next, I want to send the ...
0
votes
1
answer
114
views
Flutter, change the size of text entered by the user in the TextFormField
Helo boys and girls! I would like to change the size of the text that the user enters into the TextFormField field. This is the moment when the user clicks on the field and starts typing something. I ...
-1
votes
1
answer
68
views
Show Flutter TextFormField error on top of input
I'd like to show the flutter TextFormField error on top of the input - not below. Can i achieve this with TextFormField itself or do I have to build it myself?
Thank you in advance.
0
votes
1
answer
129
views
How to add a prefix icon to TextFormField without shifting the label?
I'm developing Flutter application and I want to add prefix icon to my TextFormField widget. Something like that:
And when I try to add a prefix icon, my label aligns (vertically) with the text, but ...
0
votes
1
answer
413
views
Flutter: How to disable LongPress on TextFormField?
There's a problem. I'm new to flutter. I needed to place a TextFormField in a ReorderableListView, but at the same time I can’t shuffle the fields when I hold it for a long time, since clicking on the ...
0
votes
1
answer
149
views
How to set See More and See Less content button to right side of the last line of TextformField in flutter
I want Textformfield functionality like besides the last line of textfoemfield there should be one textbutton called seemore and seeless. firstly textformfield will have initial value and have set ...
2
votes
1
answer
2k
views
TextFormField gains focus current page gets closed
In my login page both username and password fields exist when any of the field gets focus keyboard displayed and suddenly the page gets closed immediately. Analysed and found that this issue is ...
1
vote
2
answers
737
views
Rebuilding issue when I declare MediaQuery within the build function
import 'package:bug_fix/home_screen.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@OverRide
...
0
votes
2
answers
766
views
Flutter TextField disables the GestureDetector to recieve the onTap event
I have a TextField as the child of a GestureDetector. When I tap on the TextField, it gains focus and shows the keyboard on the screen which is normal. But I also want to call the onTap function of ...
0
votes
1
answer
75
views
The toolbar of TextFormField is under the AppBar
I have a StatefulWidget named Root and this is the start address of my application. The Root widget contains the single and common AppBar of the application, but its body varies.
My question is: I ...
1
vote
0
answers
115
views
How to change style of TextFormField's contextMenu
I'm using my custom ThemeData and TextFormField. When I long press the TextFormField, the content of the menu that appears near the TextFormField does not appear. Below are my Custom ThemeData and ...
1
vote
1
answer
714
views
How to dynamically change the font size in the text field
I am writing an application on Flutter. I want to dynamically change the font size in the text field (actually TextFormField) when the number of characters in it increases. What I want to achieve is ...
1
vote
0
answers
300
views
Form: Keyboard unexpectedly dismissal
I am using a Bottom sheet in my project and using a form, when I give a form key to my form , my keyboard splashes and disappear quickly
This shows in my CONSOLE
app_time_stats: avg=1118.30ms min=24....
0
votes
0
answers
42
views
How to get state of TextFormField or its current border color in flutter
How to get current state of the TextFormField like if it has error or it has focus or it doesn't have focus.
What I want to achieve is that I have a suffix icon Widget (not Icon widget type, any ...
0
votes
1
answer
76
views
Is their any way to make error Text align to textFormField border and their content inside with padding 16
TextFormField
I want to make a custom text field with validation that has content padding of 16 px,
but the error Text aligns with the text field borders.
I wrote some code but was not able to achieve ...