Repository: flutter
Issue: In an AppBar, leadingWidth property has priority over centerTitle, making the later misbehave when the former is too big
Labels: f: material design,has reproducible steps,P2,workaround available,found in release: 3.10,team-design,triaged-design,found in release: 3.13

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

1. Make a simple page with a `Scaffold` and an `AppBar`;
2. Provide a `title` widget to the `AppBar`;
3. In the `AppBar`, set the `centerTitle` option to `true`;
4. In the `AppBar`, set the `leadingWidth` to a value big enough to fill more than half the screen width.


### Expected results

Because `centerTitle` is set to `true`, the `title` should be centered.

This was the behavior in Flutter 3.3 or less.

### Actual results

The `leadingWidth` pushes the `title` off the center.
If `leadingWidth` is big enough, it pushes `title` entirely out of the screen.

This behavior was introduced in Flutter 3.7 in https://github.com/flutter/flutter/pull/112548.

### Code sample

<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(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(
        appBar: AppBar(
          backgroundColor: Theme.of(context).colorScheme.inversePrimary,
          title: const Text('Some title'),
          leadingWidth: 500,
          centerTitle: true,
          leading: const Row(
            children: [
              BackButton(),
              Expanded(
                child: Text('A widget'),
              ),
            ],
          ),
          actions: const [Text('Another widget')],
        ),
      ),
    );
  }
}
```
</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

Pre-3.7 behavior:

<img width="542" alt="image" src="https://github.com/flutter/flutter/assets/4605213/c30b8476-abc2-49b5-a2f1-ad6cc4908cc9">

3.7+ behavior:

<img width="542" alt="image" src="https://github.com/flutter/flutter/assets/4605213/c123603d-3edf-4365-8e0b-cf1c790545c9">

</details>


### Logs

_No response_

### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.1 22C65 darwin-x64, locale en-BR)
    • Flutter version 3.10.5 on channel stable at /Users/pintome/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (4 weeks ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/pintome/Library/Android
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = /Users/pintome/Library/Android/
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment Temurin-11.0.14+9 (build 11.0.14+9)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio
    • Android Studio at /Users/pintome/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/231.9011.34.2311.10366083/Android Studio Preview.app/Contents
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[!] Android Studio
    • Android Studio at /Users/pintome/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/231.9161.38.2311.10413018/Android Studio Preview.app/Contents
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[!] Android Studio
    • Android Studio at /Users/pintome/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/231.9161.38.2311.10457801/Android Studio Preview.app/Contents
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[!] Android Studio
    • Android Studio at /Users/pintome/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4345.14.2221.9189903/Android Studio Preview.app/Contents
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 13.1 22C65 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 114.0.5735.198

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 5 categories.
```

</details>