Skip to content

InputDecoration: looks like contentPadding is broken on master branch #44726

Closed

Description

@EugenePisotsky

I updated flutter on master and can't reduce contentPadding anymore

Steps to Reproduce

import 'package:flutter/material.dart';

class TestWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Material(
      child: Padding(
        padding: EdgeInsets.all(30),
        child: Column(
          children: <Widget>[
            Container(
              color: Colors.red,
              child: TextField(
                decoration: InputDecoration(
                  hintText: 'Hello World',
                  border: InputBorder.none,
                  contentPadding: EdgeInsets.zero
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}

Target Platform: Android

Logs

[✓] Flutter (Channel unknown, v1.10.15-pre.503, on Mac OS X 10.15 19A602, locale en-GB)
    • Flutter version 1.10.15-pre.503 at /Users/eugenepisotsky/Development/flutter
    • Framework revision 9e0df259df (17 hours ago), 2019-11-11 15:56:43 -0800
    • Engine revision 31cd2dfca2
    • Dart version 2.7.0

 
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/eugenepisotsky/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.1, Build version 11A1027
    • CocoaPods version 1.8.4

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 35.3.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] IntelliJ IDEA Community Edition (version 2019.1.4)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 40.2.2
    • Dart plugin version 191.8593

[✓] Connected device (3 available)
    • ASUS X00TD • K2AXB761Z914LDJ • android-arm64  • Android 9 (API 28)
    • Chrome     • chrome          • web-javascript • Google Chrome 76.0.3809.100
    • Web Server • web-server      • web-javascript • Flutter Tools

! Doctor found issues in 1 category.

Activity

  1. changed the title [-]InputDecoration: contentPadding looks like is broken on master branch[/-] [+]InputDecoration: looks like contentPadding is broken on master branch[/+] on Nov 12, 2019
  2. added
    p: material_uimaterial_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Nov 12, 2019
  3. ajviera commented on Nov 25, 2019

    @ajviera

    +1 The same problem

  4. algodave commented on Nov 26, 2019

    @algodave

    Same problem here

  5. MohsinN commented on Nov 26, 2019

    @MohsinN

    Facing the same issue.

  6. MohsinN commented on Nov 27, 2019

    @MohsinN

    Following changes to TextFormField are the cause.
    #44726

    Recently isDense property was added to class InputDecoration. Setting it to true along with contentPadding, resolves the issue.

    Whether it should be included in collapsed by default is a separate discussion.

  7. rafagith commented on Dec 13, 2019

    @rafagith

    Same issue here

  8. droplet-js commented on Dec 16, 2019

    @droplet-js

    same issue #46964

  9. justinmc commented on Dec 17, 2019

    @justinmc
    Contributor

    This is caused by #42449, which increased the height of TextFields by 8px in order to make them meet the Material guidelines for minimum interactive size.

    The solution is to use isDense as @MohsinN said.

    I'll go ahead and close this, but let me know if any problem still remains and we can reopen.

  10. github-actions commented on Aug 25, 2021

    @github-actions

    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 -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    frameworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions