Skip to content

InputDecorator height does not respect content constraints #159431

@bleroux

Description

@bleroux

Steps to reproduce

  1. Run the code sample.
  2. Observe the InputDecorator height using the widget inspector.

Expected results

The InputDecorator height is 48 (content height = 32 + default vertical padding = 8 * 2).

Notice that when adding an Icon to the content (uncomment the corresponding line in the code sample), the InputDecorator is properly sized.

image

image

Actual results

The InputDecorator height is 71.4:

image

image

Code sample

Code sample
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: Center(
          child: InputDecorator(
            decoration: InputDecoration(
              filled: true
            ),
            child: SizedBox(
              height: 32.0,
              child: Row(
                children: [
                  Text(
                    'Text',
                    style: TextStyle(fontSize: 60.0),
                  ),
                  // Uncomment this line to get the correct height
                  // for the InputDecorator.
                  Icon(Icons.arrow_drop_down),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
Flutter (Channel master, 3.27.0-1.0.pre.632, on Ubuntu 24.04.1 LTS 6.8.0-49-generic, locale fr_FR.UTF-8)

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: text inputEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.found in release: 3.24Found to occur in 3.24found in release: 3.27Found to occur in 3.27frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-text-inputOwned by Text Input team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions