Fixed space between two TextFormField on Flutter

I’m trying to create an app for my work with login and signup form. The page is ok, but there is a litte problem: on each TextFormField there is a validator for check the field, but when appears the error message below the field, the other fields goes down. The question is: how can I… Read More Fixed space between two TextFormField on Flutter

How can i put 1 icon and 1 iconbutton in TextFormField Flutter

I want to put 1 icon and 1 iconbutton in a textformfield. I added but both settled on the left. I want to put the iconbutton on the left. TextFormField( keyboardType: TextInputType.visiblePassword, obscureText: !_showPassword, decoration: InputDecoration( labelStyle: TextStyle(color: Colors.black87), labelText: ‘Enter password’, prefixIcon: Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Icon(Icons.lock), IconButton( icon: _showPassword ?… Read More How can i put 1 icon and 1 iconbutton in TextFormField Flutter

How to change TextFormField labeltext and border color in Flutter?

I have TextFormField and I want to change color of border and labelText, how can I do that? That’s how it looks now, and I want to change blue to purple. (https://im.ge/i/FImpIh) import ‘package:flutter/material.dart’; class InputTextFormField extends StatefulWidget { final String labelText; TextEditingController? controller; InputTextFormField({Key? key, required this.labelText, required this.controller}); @override _InputTextFormFieldState createState() => _InputTextFormFieldState();… Read More How to change TextFormField labeltext and border color in Flutter?

Flutter Checkbox inside a form with Provider notification is not working

I have a checkbox which is rendered in a form (not defined as FormField as it doesn’t exist native for Flutter and trying to extend that didn’t work anyway): import ‘package:flutter/material.dart’; import ‘checkbox_form_field.dart’; import ‘package:sellertools/providers/money.dart’; import ‘package:provider/provider.dart’; class MoneyFormCheckbox<T extends Money> extends StatelessWidget { final String label; const MoneyFormCheckbox(this.label, {Key? key}) : super(key: key); @override… Read More Flutter Checkbox inside a form with Provider notification is not working

Form validation in flutter passes despite not meeting conditions

I am building a Flutter application with multiple TextFormFields. I create a reusable TextFormfield Widget to keep things modular. The problem is, when the submit button is clicked, even though the Text Form Fields are not valid, it runs like it is valid. My TextFormField widget: class AndroidTextField extends StatelessWidget { final ValueChanged<String> onChanged; final… Read More Form validation in flutter passes despite not meeting conditions

Flutter _AssertionError 'initialValue == null || controller == null': is not true. Error

I have a code like this: TextEditingController adSoyadTextBox = TextEditingController(text: "Loading.."); // … TextFormField( controller: adSoyadTextBox, initialValue: ad, decoration: InputDecoration( hintStyle: TextStyle(color: Colors.grey), enabledBorder: UnderlineInputBorder( borderSide: BorderSide(color: Colors.grey), ), focusedBorder: UnderlineInputBorder( borderSide: BorderSide(color: Colors.grey), ), ), ), My code throws an error like this: _AssertionError (‘package:flutter/src/material/text_form_field.dart’: Failed assertion: line 155 pos 15: ‘initialValue == null… Read More Flutter _AssertionError 'initialValue == null || controller == null': is not true. Error

Add a special character inside of textformfield input [Flutter]

In a classic textformfield widget, I want to put the "/" character automatically after the fourth character when the user enters input. How can I do this? Thanks for help! Example input 2012/324234 OcasTextFormFieldContent( maxLength: 12, inputType: TextInputType.number, validator: (String? fieldContent) { if (fieldContent == "" || fieldContent == null) { return ‘not empty’; }… Read More Add a special character inside of textformfield input [Flutter]

Is it possible to just use one TextFormField for the email and password?

My idea is to use only one TextFormField for the email and password… But I also want to make the password obscure, and I have no idea how to implement this, using just a TextFormField TextFormField inputField({ required String hintText, required String errorMessage, required bool isPassword, }) { return TextFormField( decoration: InputDecoration( enabledBorder: inputBorder(const Color(0xFF000000),… Read More Is it possible to just use one TextFormField for the email and password?