Comments (3)
FYI: My current workaround is that I put the AppBar
in a ExcludeFocus
widget, since there is that (IMHO annoying) PreferredSizeWidget
you need to write a lot of boilerplate of it:
UnfocusableAppBar
class UnfocusableAppBar extends StatelessWidget implements PreferredSizeWidget {
final AppBar _appBar;
UnfocusableAppBar({
super.key,
Widget? leading,
bool automaticallyImplyLeading = true,
Widget? title,
List<Widget>? actions,
Widget? flexibleSpace,
PreferredSizeWidget? bottom,
double? elevation,
double? scrolledUnderElevation,
ScrollNotificationPredicate notificationPredicate = defaultScrollNotificationPredicate,
Color? shadowColor,
Color? surfaceTintColor,
ShapeBorder? shape,
Color? backgroundColor,
Color? foregroundColor,
IconThemeData? iconTheme,
IconThemeData? actionsIconTheme,
bool primary = true,
bool? centerTitle,
bool excludeHeaderSemantics = false,
double? titleSpacing,
double toolbarOpacity = 1.0,
double bottomOpacity = 1.0,
double? toolbarHeight,
double? leadingWidth,
TextStyle? toolbarTextStyle,
TextStyle? titleTextStyle,
}): _appBar = AppBar(
leading: leading,
automaticallyImplyLeading: automaticallyImplyLeading,
title: title,
actions: actions,
flexibleSpace: flexibleSpace,
bottom: bottom,
elevation: elevation,
scrolledUnderElevation: scrolledUnderElevation,
notificationPredicate: notificationPredicate,
shadowColor: shadowColor,
surfaceTintColor: surfaceTintColor,
shape: shape,
backgroundColor: backgroundColor,
foregroundColor: foregroundColor,
iconTheme: iconTheme,
actionsIconTheme: actionsIconTheme,
primary: primary,
centerTitle: centerTitle,
excludeHeaderSemantics: excludeHeaderSemantics,
titleSpacing: titleSpacing,
toolbarOpacity: toolbarOpacity,
bottomOpacity: bottomOpacity,
toolbarHeight: toolbarHeight,
leadingWidth: leadingWidth,
toolbarTextStyle: toolbarTextStyle,
titleTextStyle: titleTextStyle,
);
@override
Widget build(BuildContext context) => ExcludeFocus(child: _appBar);
@override
Size get preferredSize => _appBar.preferredSize;
}
Please be aware that this breaks the usage of the app bar with the keyboard and accessibility. For my use case this seems to be acceptable.
from flutter.
Hi @rekire
I'm unsure what the actual result is. Do you mean the drawer is auto-open while entering text on the field? If so, I couldn't reproduce it.
Open the drawer with a bluetooth keyboard and close it
For this step, do you use keyboard or tap on drawer button?
from flutter.
I want to type text into the WebView without accidentally executing any other actions. When you used the native UI and use then the WebView the AppBar has the keyboard focus, but you can type text into the input fields. Since the letters "h", "e", "l" and "o" are not handled the AppBar the WebView can consume it, but enter and space is consumed by the other widgets. If the key pressed would not be handled by the WebView it would be less confusing for the customer
It does not really matter how you opened it first tap or enter/space works both
from flutter.
Related Issues (20)
- Flutter Web engine removes query parameter encoding HOT 2
- InkWell highlight not working HOT 1
- Navigator without transitions not working HOT 7
- [tool_crash] ProcessException: Process exited abnormally with exit code 72:xcrun: error: unable to find utility "xcodebuild", no
- mac-23 & mac-26 lost external connection phone device. HOT 2
- linux-58 is dead. HOT 2
- mac-8 lost external connection phone device. HOT 2
- mac-2 is low on disk space. HOT 2
- mac-7 & mac-37 lost external connection phone device. HOT 2
- mac-6 is low on disk space. HOT 2
- linux-51 is dead. HOT 1
- [cocoon] Broken builds navigate to builders, not the broken build HOT 4
- linux-37 lost external connection phone device. HOT 1
- Web semantics picks up clicks instead of letting Flutter handle them (?) HOT 1
- Migrate `flutter/engine` to a Dart workspace for Dart/pub packages
- weird behaviour from the Text widget or from the dart anlysis not sure HOT 7
- flutter-devicelab-mac-14 is quarantined: No device is available HOT 3
- [Impeller] fix remaining slow frames in flutter gallery application.
- win-12 is low disk space on Temp directory. HOT 1
- [et] Forward `--verbose` to `ninja` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.