Repository navigation
Description
Steps to reproduce
1.copy/ paste the provided code.
2.Run the code in any simulator/emulator.
3.press the submit button
Expected results
contentPadding should affect the actual content entered by user or hint-text present inside the text field.
not the errorText specially. for errorText there should be separate errorPadding property be there which will add more customization to TextFormFields.
Actual results
contentPadding->InputDecoration->TextFormField is affecting the content inside the text field as well as the error text outside the field which in turns creating the ambiguity between the propertyName and text which it affecting.
property says contentPadding but also adding padding to errorText which is visually not part of TextField content.
Code sample
Code sample
import 'package:flutter/material.dart';
class TestFormField extends StatelessWidget {
TestFormField({super.key});
final GlobalKey<FormState> _key=GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
final Size size = MediaQuery.sizeOf(context);
return Scaffold(
body: Container(
height: size.height,
width: size.width,
alignment: Alignment.center,
padding: const EdgeInsets.all(16.0),
child: Form(
key: _key,
autovalidateMode: AutovalidateMode.onUserInteraction,
child: SizedBox(
width: size.width/2,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 20,
children: [
TextFormField(
validator: (value) => value == null || value.isEmpty ? 'Please enter some text' : null,
decoration: const InputDecoration(
labelText: 'Enter text',
border: OutlineInputBorder(),
contentPadding: EdgeInsets.all(0)
),
),
ElevatedButton(onPressed: (){
if(_key.currentState!.validate()){
print('Valid');
}
}, child: Text('Submit'))
],
),
),
),
),
);
}
}Screenshots or Video
Screenshots / Video demonstration
This screenshot the contentPadding is 30.
This screenshot the contentPadding is 0.
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.35.7, on macOS 15.1 24B83 darwin-arm64, locale en-IN)
[✗] Android toolchain - develop for Android devices
✗ cmdline-tools component is missing.
Try installing or updating Android Studio.
Alternatively, download the tools from https://developer.android.com/studio#command-line-tools-only and make sure to set the ANDROID_HOME environment
variable.
See https://developer.android.com/studio/command-line for more details.
[!] Xcode - develop for iOS and macOS (Xcode 16.1)
✗ CocoaPods not installed.
CocoaPods is a package manager for iOS or macOS platform code.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/to/platform-plugins
For installation instructions, see https://guides.cocoapods.org/using/getting-started.html#installation
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] Android Studio (version 2024.1)
[✓] Android Studio (version 3.1)
[✓] VS Code (version 1.106.3)
[✓] Connected device (2 available)
[✓] Network resources
! Doctor found issues in 2 categories.
Activity
bilaldev05 commentedon Jan 31, 2026
Hi 👋,
I'd like to work on separating contentPadding from errorText.
I’ll investigate how InputDecoration handles padding and propose a fix.
Suraj260801 commentedon Jan 31, 2026
@bilaldev05 Thanks for taking this up!
I’m happy to collaborate —feel free to reach out if you need any context or clarification.
puneetkukreja98 commentedon Feb 9, 2026
Hey @Suraj260801 , in my opinion this isn’t a bug. It looks more like an enhancement request or a proposal. I’ll forward it to the relevant team.
[-]content Padding in textFormField under inputDecoration affects errorText[/-][+]Proposal - content Padding in textFormField under inputDecoration affects errorText[/+]MohanadAbdallah-mv commentedon Feb 10, 2026
Hey @puneetkukreja98 , does that mean we will have to wait for flutter team to work on it or review it and give it additional labels or contributors can still work on that issue ?
puneetkukreja98 commentedon Feb 10, 2026
@MohanadAbdallah-mv You can also contribute to the issue. You can leave a comment saying that you’re interested, and the team will assign it to you afterward.
justinmc commentedon Feb 10, 2026
Moving this to the text input team. I'm pretty sure I've seem a similar issue on GitHub recently, I'll post it if I find it.
MohanadAbdallah-mv commentedon Feb 11, 2026
I have identified where the error padding happens.
on reviewing the text_form_field I found out that errorText use InputDecoration “effectiveDecoration” variable
so the problem isn’t with defining error padding or separate error InputDeocration for the error inside TextFormField,
InputDecoration itself need to be modified.
at input_decorator.dart -> performLayout method
the responsible code snippet for padding or layout in that case is
when i tried to modify it to that
I got that result
As far as I know separating errorText padding will take effect on every descendent widget that use Inputdecoration so we will have to verify with the tests the new layout for each one of them .
Hope that was helpful,
Let me know if my theory is correct or if we will take in consideration that generalizing that solution will be good idea or not as I would like to keep investigating and work on this issue .
Renzo-Olivares commentedon Feb 12, 2026
Going to close this as a duplicate of #175834, please feel free to re-open if this is not the case.
github-actions commentedon Feb 26, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.