mirror of
https://github.com/flutter/flutter.git
synced 2026-01-20 04:31:52 +08:00
## Description This PR changes the TextField intrinsic width computation for non-empty TextField. Before: When a TextField is non-empty, the intrinsic width can't be smaller than the hint width:  After: The width does not depend on the hint when the TextField is non empty.  <details><summary>Code sample</summary> ```dart 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( title: 'Material App', home: Scaffold( body: Center( child: IntrinsicWidth( child: TextField( decoration: InputDecoration( filled: true, hintText: 'Moderately long hint text', ), ), ), ), ), ); } } ``` </details> ## Related Issue Fixes [[TextField] The computation of the intrinsic width of a TextField should include the hint width only when visible](https://github.com/flutter/flutter/issues/93337) ## Tests Adds 2 tests.
Flutter
Flutter is a new way to build high-performance, cross-platform mobile, web, and desktop apps. Flutter is optimized for today's — and tomorrow's — mobile and desktop devices. We are focused on low-latency input and high frame rates on all platforms.
See the getting started guide for information about using Flutter.