Victor Sanni
153301ae9c
Constrain RawAutocomplete options by soft keyboard (#181930)
Fixes [Autocomplete options overlay should automatically moves up when
soft keyboard is
visible](https://github.com/flutter/flutter/issues/157664)
Fixes b/317115348
Unblocked by https://github.com/flutter/flutter/pull/181579.
## Before
https://github.com/user-attachments/assets/586944be-6ff1-4817-980e-334bfefb6c62
## After
https://github.com/user-attachments/assets/086f4be9-0ebc-43af-b85b-3435d4144920
<details>
<summary>Sample code</summary>
```dart
import "package:flutter/material.dart";
void main() => runApp(const AutocompleteExampleApp());
/// Flutter code sample for [RawAutocomplete].
class AutocompleteExampleApp extends StatelessWidget {
const AutocompleteExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text("RawAutocomplete Basic"),
),
body: const CustomScrollView(
slivers: [
SliverPadding(padding: EdgeInsets.symmetric(vertical: 300)),
SliverToBoxAdapter(child: AutocompleteBasicExample()),
SliverPadding(padding: EdgeInsets.symmetric(vertical: 700)),
],
),
),
);
}
}
class AutocompleteBasicExample extends StatelessWidget {
const AutocompleteBasicExample({super.key});
static const List<String> _options = <String>[
"aardvark",
"bobcat",
"chameleon",
"chameleon",
];
@override
Widget build(BuildContext context) {
return RawAutocomplete<String>(
optionsBuilder: (TextEditingValue textEditingValue) {
return _options.where((String option) {
return option.contains(textEditingValue.text.toLowerCase());
});
},
fieldViewBuilder: (
BuildContext context,
TextEditingController textEditingController,
FocusNode focusNode,
VoidCallback onFieldSubmitted,
) {
return TextFormField(
controller: textEditingController,
focusNode: focusNode,
onFieldSubmitted: (String value) {
onFieldSubmitted();
},
);
},
optionsViewBuilder: (
BuildContext context,
AutocompleteOnSelected<String> onSelected,
Iterable<String> options,
) {
return const Column(
children: <Widget>[Expanded(child: Placeholder())],
);
},
);
}
}
```
</details>
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Navaron Bracke <brackenavaron@gmail.com>
2026-02-05 22:34:28 +00:00
..
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-27 22:10:04 +00:00
2026-01-27 22:08:04 +00:00
2026-01-28 02:26:24 +00:00
2025-12-27 00:14:05 +00:00
2026-01-02 19:20:06 +00:00
2025-12-27 00:12:17 +00:00
2026-01-02 19:20:06 +00:00
2026-01-27 23:05:02 +00:00
2026-01-27 22:08:04 +00:00
2025-12-27 00:22:24 +00:00
2026-01-20 23:08:22 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-12-27 01:14:08 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2026-02-05 22:34:28 +00:00
2026-01-29 17:21:52 +00:00
2025-11-26 01:10:39 +00:00
2026-02-04 05:54:29 +00:00
2026-02-04 04:12:13 +00:00
2026-01-20 03:16:22 +00:00
2026-02-03 16:38:14 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2026-01-30 10:46:26 +00:00
2026-01-27 22:12:05 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2026-01-06 01:19:06 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-10 01:05:19 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-02-03 22:00:08 +00:00
2026-01-02 19:20:06 +00:00
2025-12-29 22:50:32 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-13 16:04:07 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2026-01-18 10:28:35 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:21:52 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:21:52 +00:00
2026-01-29 17:21:52 +00:00
2026-01-29 17:21:52 +00:00
2025-11-26 01:10:39 +00:00
2026-01-13 16:12:57 +00:00
2026-02-03 21:05:31 +00:00
2026-01-06 01:06:59 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-12 04:32:33 +00:00
2026-01-02 19:20:06 +00:00
2026-01-21 18:12:56 +00:00
2026-01-20 03:16:22 +00:00
2026-02-05 19:22:24 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:29:01 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-21 22:44:06 +00:00
2025-11-26 01:10:39 +00:00
2025-12-03 02:05:40 +00:00
2026-01-22 22:59:07 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2026-01-21 22:58:24 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-27 22:13:53 +00:00
2025-11-26 01:10:39 +00:00
2026-01-27 22:10:03 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-02-03 23:42:01 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-18 10:30:09 +00:00
2025-11-26 01:10:39 +00:00
2026-01-20 03:16:22 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2026-01-17 01:46:22 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-27 14:23:09 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-21 18:13:00 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:29:01 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-20 03:16:22 +00:00
2026-01-20 03:16:22 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-29 17:29:01 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-02-03 23:42:01 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2025-12-05 21:54:29 +00:00
2025-11-26 01:10:39 +00:00
2026-02-04 06:53:23 +00:00
2025-11-26 01:10:39 +00:00
2026-02-03 08:36:18 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2026-01-06 15:22:38 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:21:52 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-07 21:58:42 +00:00
2026-02-04 06:53:23 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 16:19:26 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:21:52 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:21:52 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-02-03 11:48:33 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-12-09 20:24:24 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:21:52 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2026-01-22 23:11:34 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 22:43:24 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:21:52 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:21:52 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2026-01-07 20:05:09 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-20 03:16:22 +00:00
2026-02-03 00:49:09 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-02-03 00:49:09 +00:00
2026-02-03 18:14:08 +00:00
2026-01-23 06:59:15 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:29:01 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-20 03:16:22 +00:00
2026-01-07 20:05:09 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:21:52 +00:00
2026-01-29 17:21:52 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:21:52 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-26 21:37:22 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:21:52 +00:00
2025-11-26 01:10:39 +00:00
2026-01-17 00:53:56 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-02-03 16:38:14 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-02 19:20:06 +00:00
2026-01-02 19:20:06 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2025-11-26 01:10:39 +00:00
2026-01-29 17:29:01 +00:00
2026-01-29 17:29:01 +00:00
2025-11-26 01:10:39 +00:00
2026-01-08 21:53:56 +00:00
2026-01-02 19:20:06 +00:00