Repository: flutter
Issue: [RawAutocomplete] Remove assert that don't seem to be needed
Labels: framework,f: focus,has reproducible steps,P3,team-framework,triaged-framework,found in release: 3.13,found in release: 3.14

### 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

I am using `FocusScope` to manage the `FocusNode` in the page, when I combine it with `RawAutocomplete`, the assertion is telling me that I can't just give it the `textEditingController`, I don't get any valid information from the assertion, I removed the assertion, and it seems to still be working fine, is it possible to remove the assertion, or any other suggestions.

1. Run Code sample directly to get the error report.

### Expected results

I think should run as well.

### Actual results

'package:flutter/src/widgets/autocomplete.dart': Failed assertion: line 142 pos 15: '(focusNode == null) == (textEditingController == null)': is not true.

### 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(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final FocusScopeNode _globalFocusNode = FocusScopeNode();

  final TextEditingController _nameCtrl = TextEditingController();
  final TextEditingController _passwordCtrl = TextEditingController();

  @override
  void dispose() {
    _nameCtrl.dispose();
    _passwordCtrl.dispose();
    _globalFocusNode
      ..unfocus()
      ..dispose();

    super.dispose();
  }

  void onSubmit() {
    print('name: ${_nameCtrl.text} password: ${_passwordCtrl.text}');
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const Text('RawAutocomplete Demo Page'),
      ),
      body: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 16),
        child: Center(
          child: FocusScope(
            node: _globalFocusNode,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                RawAutocomplete<String>(
                  textEditingController: _nameCtrl,
                  // Don't pass in `FocusNode` because I want to manage via
                  // `_globalFocusNode`.
                  // focusNode: ,
                  optionsBuilder: (TextEditingValue value) => ['A', 'B', 'C'],
                  optionsViewBuilder: (
                    BuildContext context,
                    void Function(String) onSelected,
                    Iterable<String> options,
                  ) =>
                      Align(
                    alignment: Alignment.topLeft,
                    child: Material(
                      child: Container(
                        margin: const EdgeInsets.only(top: 10),
                        width: MediaQuery.sizeOf(context).width - 32,
                        color: Colors.grey,
                        child: Column(
                          mainAxisSize: MainAxisSize.min,
                          children: options.map((e) => Text(e)).toList(),
                        ),
                      ),
                    ),
                  ),
                  fieldViewBuilder: (
                    _,
                    TextEditingController textEditingController,
                    FocusNode focusNode,
                    __,
                  ) =>
                      TextFormField(
                    controller: textEditingController,
                    focusNode: focusNode,
                    textInputAction: TextInputAction.next,
                    onEditingComplete: _globalFocusNode.nextFocus,
                  ),
                ),
                TextFormField(
                  controller: _passwordCtrl,
                  obscureText: true,
                  textInputAction: TextInputAction.done,
                  onEditingComplete: _globalFocusNode.nextFocus,
                ),
                ElevatedButton(
                  onPressed: onSubmit,
                  child: const Text('Submit'),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
```

</details>


### Screenshots or Video

_No response_

### Logs

<details><summary>Logs</summary>

```console
'package:flutter/src/widgets/autocomplete.dart': Failed assertion: line 142 pos 15: '(focusNode == null) == (textEditingController == null)': is not true.
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.4, on macOS 13.5.2 22G91 darwin-arm64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.82.2)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!
```

</details>