Repository: flutter
Issue: Overflow using prefix or suffix in an TextFormField while using material 3
Labels: a: text input,framework,f: material design,a: error message,has reproducible steps,found in release: 3.3,found in release: 3.7,team-design,triaged-design

I am trying to create a form within a CustomScrollView. The app is built using material3 theme, and one of the fields needs a prefix. That combination leads to an overflow. Changing the theme to material2 fixes the issue. Removing the prefix solves the issue as well. Using SingleChildScrollView solves the issue too (but I can't use it due to other limitations).

_Note: The same behavior happens with the suffix. And changing the style of the text seems to affect the result. The overflow changes, but using Headline6 removes the overflow for some reason (even tough it is a style with a considerable font size)._

## Steps to Reproduce
1. Create a new project
2. Replace the main.dart by the provided code sample
3. Run the project.
4. See the exception in the console.
5. See the "overflow warning" by scrolling to the bottom of the page.

**Expected results:**
The widget should not overflow and should behave like it does with the material3 flag disabled.

**Actual results:** <!-- what did you see? -->
The widget overflows by 1.5px with the default style, but changes depending on the style used in the prefix or suffix.

## Additional information
<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 MaterialApp(
        theme: ThemeData(colorSchemeSeed: Colors.red, useMaterial3: true), // Switching to material 2 fixes the overflow
        home: Scaffold(
          appBar: AppBar(title: const Text('Bug with prefix and suffix of TextFormField')),
          body: const MyStatelessWidget(),
        ),
      );
    }
  }
  
  class MyStatelessWidget extends StatelessWidget {
    const MyStatelessWidget({super.key});
  
    @override
    Widget build(BuildContext context) {
      return CustomScrollView(
        slivers: [
          SliverFillRemaining(
            hasScrollBody: false,
            child: Column(
              children: [
                TextFormField(
                  initialValue: 'abc',
                  decoration: const InputDecoration(
                    //Using style bodyText1, bodyText2, subtitle, ... cause overflow as well. But Headline6 works fine WTF
                    prefix: Text('Prefix'), // If the prefix is removed, the overflown disapears
                    // suffix: Text('Sufix'), // The suffix also causes the overflow
                    border: OutlineInputBorder(),
                  ),
                ),
                SizedBox(height: 1000, child: Placeholder()), // To force a necessary scroll
              ],
            ),
          ),
        ],
      );
    }
  }
```
</details>

### Console outputs

<details>
  <summary>Flutter run</summary>

```
Using hardware rendering with device sdk gphone64 x86 64. If you notice graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...                              6.5s
√  Built build\app\outputs\flutter-apk\app-debug.apk.
Syncing files to device sdk gphone64 x86 64...                      67ms

Flutter run key commands.
r Hot reload.
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

 Running with sound null safety

An Observatory debugger and profiler on sdk gphone64 x86 64 is available at: http://127.0.0.1:58167/Oied4aeJbPY=/
I/xample.mysample( 9799): Compiler allocated 4533KB to compile void android.view.ViewRootImpl.performTraversals()

══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during layout:
A RenderFlex overflowed by 1.5 pixels on the bottom.

The relevant error-causing widget was:
  Column Column:file:///K:/mysample/lib/main.dart:30:18

The overflowing RenderFlex has an orientation of Axis.vertical.
The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and
black striped pattern. This is usually caused by the contents being too big for the RenderFlex.
Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the
RenderFlex to fit within the available space instead of being sized to their natural size.
This is considered an error condition because it indicates that there is content that cannot be
seen. If the content is legitimately bigger than the available space, consider clipping it with a
ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex,
like a ListView.
The specific RenderFlex in question is: RenderFlex#9eb78 OVERFLOWING:
  needs compositing
  creator: Column ← _SliverFillRemainingWithoutScrollable ← SliverFillRemaining ← Viewport ←
    IgnorePointer-[GlobalKey#ecc79] ← Semantics ← Listener ← _GestureSemantics ←
    RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#1178c] ← Listener ← _ScrollableScope
    ← _ScrollSemantics-[GlobalKey#3b76b] ← ⋯
  parentData: paintOffset=Offset(0.0, -0.0)
  constraints: BoxConstraints(w=392.7, h=1064.0)
  size: Size(392.7, 1064.0)
  direction: vertical
  mainAxisAlignment: start
  mainAxisSize: max
  crossAxisAlignment: center
  verticalDirection: down
◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤
════════════════════════════════════════════════════════════════════════════════════════════════════
The Flutter DevTools debugger and profiler on sdk gphone64 x86 64 is available at: http://127.0.0.1:9106?uri=http://127.0.0.1:58167/Oied4aeJbPY=/
E/SurfaceSyncer( 9799): Failed to find sync for id=0
W/Parcel  ( 9799): Expecting binder but got null!
```

</details>

<details>
  <summary>flutter analyze</summary>

```
   info - Prefer const with constant constructors - lib\main.dart:40:15 - prefer_const_constructors
   info - Prefer const with constant constructors - lib\main.dart:40:45 - prefer_const_constructors
```

</details>

<details>
  <summary>flutter doctor -v</summary>

```
[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.22621.963], locale en-150)
    • Flutter version 3.3.10 on channel stable at K:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 135454af32 (7 days ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0

Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Users\guple\AppData\Local\Android\Sdk
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = C:\Users\guple\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.19)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.32901.82
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[√] VS Code (version 1.74.2)
    • VS Code at C:\Users\guple\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.22621.963]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 108.0.5359.125
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 108.0.1462.54

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
```

</details>

### Images

Text field with prefix
![2022-12-22 11_01_35-Emulator - tunzaa_marketplace](https://user-images.githubusercontent.com/11029629/209086540-a609b69d-6183-4a70-a5fb-821d0661d03c.png)

Scrolling to the bottom shows the overflow warning
![2022-12-22 11_01_08-Emulator - tunzaa_marketplace](https://user-images.githubusercontent.com/11029629/209087210-06bc2284-cc8f-4201-b9b0-870bec51816d.png)