flutter/packages
Taha Tesser 1f8d110b8f
Fix InputDecorators suffix and prefix widgets are tappable when hidden (#143308)
fixes [The InputDecoration's suffix and prefix widget can be tapped even if it does not appear](https://github.com/flutter/flutter/issues/139916)

This PR also updates two existing tests to pass the tests for this PR. These tests are trying to tap prefix and  suffix widgets when they're hidden. While the linked issue had visible prefix and suffix widgets https://github.com/flutter/flutter/issues/39376 for reproduction.

### Code sample

<details>
<summary>expand to view the code sample</summary> 

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(MainApp());
}

class MainApp extends StatelessWidget {
  final _messangerKey = GlobalKey<ScaffoldMessengerState>();

  MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      scaffoldMessengerKey: _messangerKey,
      home: Scaffold(
        body: Container(
          alignment: Alignment.center,
          padding: const EdgeInsets.all(16.0),
          child: TextField(
            decoration: InputDecoration(
              labelText: 'Something',
              prefix: GestureDetector(
                onTap: () {
                  _messangerKey.currentState?.showSnackBar(
                      const SnackBar(content: Text('A tap has occurred')));
                },
                child: const Icon(Icons.search),
              ),
              suffix: GestureDetector(
                onTap: () {
                  _messangerKey.currentState?.showSnackBar(
                      const SnackBar(content: Text('A tap has occurred')));
                },
                child: const Icon(Icons.search),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
```

</details>

### Before
![ScreenRecording2024-02-12at18 40 34-ezgif com-video-to-gif-converter](https://github.com/flutter/flutter/assets/48603081/c101e0d6-ce5a-4b28-9626-28bcb83d2a5c)

### After
![ScreenRecording2024-02-12at18 40 10-ezgif com-video-to-gif-converter](https://github.com/flutter/flutter/assets/48603081/923b348e-8adf-4d64-9dc3-e75d30e3e2fb)
2024-02-13 08:48:18 +00:00
..
flutter Fix InputDecorators suffix and prefix widgets are tappable when hidden (#143308) 2024-02-13 08:48:18 +00:00
flutter_driver Upgrade leak_tracker. (#143236) 2024-02-09 14:41:22 -08:00
flutter_goldens Upgrade leak_tracker. (#143236) 2024-02-09 14:41:22 -08:00
flutter_localizations Upgrade leak_tracker. (#143236) 2024-02-09 14:41:22 -08:00
flutter_test Upgrade leak_tracker. (#143236) 2024-02-09 14:41:22 -08:00
flutter_tools Revert "[Re-land] Enforce a policy on supported Gradle, Java, AGP, and KGP versions" (#143314) 2024-02-12 18:04:05 +00:00
flutter_web_plugins Upgrade leak_tracker. (#143236) 2024-02-09 14:41:22 -08:00
fuchsia_remote_debug_protocol Upgrade leak_tracker. (#143236) 2024-02-09 14:41:22 -08:00
integration_test Revert "Migrate integration_test plugin to Gradle Kotlin DSL (#142008)" (#143329) 2024-02-12 23:26:18 +00:00
analysis_options.yaml Unify analysis options (#108462) 2022-07-28 09:07:49 -07:00