Learn to Drive a Model T: Register for the Model T Driving Experience

Flutter always show keyboard

if not click the blank area in Home page, then will show a virtual keyboard. You will also need a way for widgets on pages to access the hidden widget's FocusNode object. Actual results: Virtual keyboard always keep in screen, even there is no any TextField widget on the screen. Features # Dec 4, 2018 · Specifically, create a Stack at the top of your application with a hidden text field. dart. final _form2Key = GlobalKey<FormState>(); Padding(. class KeyboardListener extends StatefulWidget Feb 24, 2021 · Thank your answer @Defiant UA - In first way FirstDisabledFocusNode when you double tap on TextField keyboard still show In Second way I need show cursor. However, this project will handel the Sep 16, 2018 · 19. invokeMethod('TextInput. The following sample app uses suggestions as user type from api and display in list which user can select by tapping. The TextFormField is disabled when you click on RaisedButton to add the item to list. Feb 8, 2024 · Flutter TypeAhead # A TypeAhead (autocomplete) widget for Flutter, where you can show suggestions to users as they type. showBottomSheet<T Apr 6, 2018 · As @creativecreatorormaybenot already answered, you can use wakeLock to keep the screen on. I am building a desktop app with Flutter and I would like to show the touchscreen keyboard of Windows when I need it, for example in a TextFormField . This widget is useful when you have a single box that will normally be entirely visible, for example a clock face in a time picker, but you need to make sure it can be scrolled if the container gets too small in one axis (the scroll direction). Ideally it should stays there only only the below screen TextFormField should scroll up. Apr 7, 2021 · Your code not working as expected keyboard appears when I first click on the icon and when i again click on the icon the keyboard disappear. Scaffold. @override. How to solve this issue, below is the sample dart code till now what i tried this. Scrollbar. void hideKeyboard(BuildContext context) { FocusScope. The widget specified by finder must be an EditableText or have an EditableText descendant. Kelvin Mboto. I would like the first keyboard entry to be a capital letter but can't see a way of achieving that (e. final. I am working on Flutter, Calling API based on Search Parameters. Scaffold(. Then, you can use it by adding the following import statement. What I have done is: onChange of that TextField, I have called method to get data from server. Because the keyboard that Android / iOS offers us specifically when we are in numeric mode, does not bring the button to hide the keyboard. Now, however, the BottomNavigationBar sticks to the top of the keyboard when it appears and is always visible. KeyboardListener constructor. – Chinmay Mourya. The XTextField below will only show the keyboard when tapped after already holding focus. 5. Display the Keyboard: Add your custom keyboard widget to the Flutter UI where you want the keyboard to appear. resizeToAvoidBottomInset : false, body: YourWidgets(), ); Solution 2 : Force your column to be the same height as the screen, then place it in a SingleChildScrollView so that Flutter automatically scrolls the screen up just enough when the Nov 12, 2019 · a: desktop Running on desktop a: text input Entering text in a text field or keyboard related problems c: proposal A detailed proposal for a change to Flutter framework flutter/packages/flutter repository. Sep 14, 2021 · You will see the virtual keyboard is still showing. Step 2: Add keyboardType parameter and assign the TextInputType. enabled: !kReleaseMode, builder: (context) => const MyApp(), // Wrap your app. Rather keep it as it is and put your code inside done button of keyboard event. requestFocus(FocusNode()); edited Jan 24, 2020 at 14:20. To prevent the keyboard from pushing the FloatingActionButton (FAB) upwards in your Flutter app, you can use the MediaQuery and Visibility widgets. A benefit of this approach is that it doesn't prevent existing Flutter focus nodes from receiving events, so you don't have to manually handle keyboard event propagation. show'); super. May 16, 2021 · You can always treat pickers as widgets that's why there is no need to call them through the button clicks. Step 4: Run the app. Aug 18, 2018 · The other answers here have many widgets to get the job done. Code Sample: Oct 18, 2020 · 3. You can acheive this buy creating your own UIViewRepresentable and changing the inputView of a UITextField. method. logicalKey. But when the TextField or TextFormField is focused, the keyboard should push the full screen till the bottom of the layout, so that the button is visible. flutter. Nov 12, 2019 · I would like to create a text field with a prefix that is always visible. I tried: @override. ) Give the text input widget specified by finder the focus, as if the onscreen keyboard had appeared. Jun 6, 2024 · showKeyboard. enable();. viewInsets. property. These represent logical keys, which are keys which are interpreted in the context of any modifiers, modes, or keyboard layouts which may be in effect. DevicePreview(. A KeyboardListener is useful for listening to key events and hardware buttons that are represented as keys. bottom, we can determine whether the keyboard is open or closed. only(bottom: 32. A box in which a single widget can be scrolled. This is contrast to PhysicalKeyboardKey, which represents a physical Apr 3, 2021 · 18. black),), hintText: "Unique Subject", border: OutlineInputBorder(), Sorry for the img link, im still new to stackoverflow still havent reached 10 reputations. To create a local project with this code sample, run: flutter create --sample=material. 0, color: Colors. BUT, in case of complicated widgets tree, it doesn't work. Customize this to your liking. The prefix text is not returned as part of the user's input. I would like to have the country code as a persistent prefix. Jun 5, 2020 · Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. This causes a lot of inconvenience for users, so this package allows adding functionality to the existing keyboard. You can use this way to make it work. 1 mysample. bottom instead of padding. Flutter Version: 1. Other widgets will be placed in a SingleChildScrollView-> Column. only(top: 8. ); } ) Here, the user is forced to input in the small letter even if they open the capital keyboard in Flutter. Jun 12, 2022 · How can I have the listview builder shrink to show the last message when the keyboard appears? Note: This issue doesn't happen on Android. Nov 13, 2022 · Goal: when send button is pressed, don't close the keyboard and keep it open/focused Problem: when send button is pressed, keyboard is closed, then reopens because of focusNode. disableTextFormField(); bool textFormFieldEnabled = true; void enableTextFormField(){. It seems that a recent update of Flutter changed the behavior of the BottomNavigationBar. Also, you can preview how your app will look when the keyboard is open. The problem here, is that this behavior is not what I want. 0), child: Container(. Then I wrapped my TextField with a KeyboardListener implemented as follows:. Jun 14, 2024 · Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android, iOS, and MacOS. Feb 1, 2022 · Similarly, you have to pass the onCapitalKeyPressed to main screen from KeyBoardLower and KeyBoardHigher. but navigator to second route, still has problem, touch any position, on screen keyboard will show. 1 and Dart 2. unfocus(); for check visiblity of keyboard : FocusScope. checkHasEmojiKeyboard(), then call await KeyboardEmojiPicker Jul 17, 2019 · As a supplement to other answers: If you want to show some overlays, the flutter_portal may indeed be a better choice that is simpler to use. 4. Here's how it looks: Hide bottom naviagtion bar when keyboard is visible. 0) (default is 20. Optional text prefix to place on the line before the input. When the multi-language feature is enabled Jun 3, 2020 · Use this library flutter_barcode_listener. KeyboardListener. Because this desktop app will be installed on HMI panels where Windows is installed but there is no physical keyboard. . The library is written in Dart and has no native code dependancy. This project has forked from virtual_keyboard project because the virtual_keyboard project built to only display a buttons on the screen with single language. This sample shows a Scrollbar that executes a fade animation as scrolling occurs. Aug 17, 2020 · You can copy paste run full code below You can use bottomSheet attribute of Scaffold. Jan 1, 2024 · Steps to show numeric input keyboard in Flutter. Flutter has a keyboard service that provides Flutter with raw key events from hardware keyboards, and you can ask this service to give you key events as well. Formerly, when the keyboard appeared, the keyboard would cover the BottomNavigationBar. The MediaQuery widget provides access to information about the current device screen. Cos Commented Jan 15, 2021 at 9:49 Sep 17, 2022 · You see, than when keyboard is shown after adding message 11 and and message 12 last messages in CustomScrollView are not seen. 17. keyboard_visibility: ^0. Asking for help, clarification, or responding to other answers. bottom if you are using a stack. addListener shall be in initState(), not build(), because that would result in adding a listener every time a widget is built and you most likely don't want that. number. sheetHeight = MediaQuery. dispose(); Assign the FocusNode to the textfield and write the following code in onSubmitted: :-. 5, when I touch textFiled, on screen keyborad show. Aug 12, 2020 · I usually set the autovalidate:true and in validator always return some text. width: screenWidth / 1. The Scrollbar will fade into view as the user scrolls, and fade out when scrolling stops. Using "Is On-Screen Keyboard Visible" to hide bottom KeyboardListener. How should I do this? Here is my code and demo: Code: runApp(. 0). See full list on blog. Flutter Gems is also a visual alternative to pub. There is a plugin named flutter_keyboard_visibility that provides the capability to detect whether the keyboard is open or closed. Here's the Code. initState(); And this does force open the virtual keyboard if I run on a virtual Nov 27, 2019 · How to focus on TextField without showing keyboard. A class with static values that describe the keys that are returned from RawKeyEvent. Typically, this is within a Stack or Oct 22, 2019 · double sheetHeight; double keyboardHeight; I use MediaQuery and it returns 683 for the screen height, but always 0 for the keyboard height. Uses the prefixStyle. bottom; This always makes my listview cover the entire screen, the opposite of what I want. 1. But the correct way is to go with FocusNode. Jun 6, 2024 · showCursor. Looking inside of that call we see the following line. As you can see in the left screen, the validation works well for all text fields but, in the right screen, you can see that after May 9, 2023 · 0. Aug 30, 2018 · The next action usually uses in the middle field of the form that will drive the focus to the next field when user tap on it. launching the keyboard with shift pressed) that at the moment. return Scaffold(. Table Of Contents. children: <Widget>[. It has buttons to adjust the zoom level and canvas size and see your app in light/dark mode. This package is a straightforward and convenient provider that helps get info Aug 25, 2020 · Since flutter v. The first approach uses self-written code and the second one uses a third-party library. Here is a code to make text capitalization. By checking the value of viewInsets. digitsOnly] to it. The keyboard's visibility can affect the user experience significantly, mainly when the keyboard covers text input fields or when certain widgets need to react to the keyboard's presence. So it is not good user experience. 1, height: screenHeight / 5. bottom > 0; and this works for Android, but on iOS this bottom property always seems to return 0, no matter if the keyboard is visible or not. Basically, it looks like: PortalTarget( // Declarative portalFollower: MyAwesomeOverlayWidget(), // Align anywhere you like. And TextFormField is enabled when you click on itself. requestFocus(); for to unvisible keyboard this code: FocusScope. While adding, use the " Is On-Screen Keyboard Visible " that will hide the bottom navigation bar whenever the keyboard is displayed. – Jun 15, 2019 · Listening to the keyboard. mytext1. selection. 13. zero for both padding and viewInsets, whether the keyboard is visible or not, therefore the dialog is never moved. your provided code: class Search extends StatefulWidget {. We’ll have a simple setup. We’ll start by adding the package to the pubspec. Sep 14, 2023 · Handle User Input: Wrap each button or key with a GestureDetector to capture taps or gestures. text and textCapitalization: TextCapitalization. But for this, you've to use TextFormField. See Widget. Step 1: Add TextField widget to your dart file. SystemChannels. Display a SnackBar. Creates a widget that receives keyboard events. of(context) always returns EdgeInsets. sentences,** style: TextStyle ( fontSize: 30. When the virtual keyboard is opened, we can get its height with MediaQuery. The best solution is to handle the value assignment elsewhere, but if you are not concerned with the keyboard hiding part of the screen, you can set resizeToAvoidBottomPadding in your Scaffold to false. void _addPecas() {. . Jul 8, 2019 · To achieve keyboard-visibility-based animated padding, here are a few modifications over @10101010's great answer: If you want the bottom change when keyboard changes visibility to be animated AND you want extra padding under your floating child then: 1- Use keyboard_visibility flutter pub. Problem: When I hide the keyboard after my searching is done using back press, It's requesting again to get data. for to visible keyboard this code: FocusScope. import SwiftUI. I am currently using SingleChildScrollView to avoid overflow, but even if i do not use a SingleChildScrollView , the screen still repositions after opening the keyboard, only Dec 3, 2018 · 1. You need to add it as a dependency. First, create a SnackBar, then display it using ScaffoldMessenger. Flutter is only implementing the Android behavior. key. Jan 15, 2021 · autofocus false seem still will show up the keyboard, i use showCursor: true, readOnly: true can get hide keyboard. To build such behavior, you can add Conditional Visibility on the bottom navigation. Jan 23, 2020 · 13. Have any way to disable keyboard still keep using TextField – Jan 11, 2020 · your keyboard is automatically popping up because you have set autofocus to true, please modify to false or remove that property to avoid keyboard from automatically popping up. By other words, when message 12 is added user can't see message 11 . Anyway, Blocking the phone's UI is not something that should be even tried in most circumstances. In the gesture handler, update the keyboard input state (e. text: value. link. prefix: Text("Subject: ", style: TextStyle(color: Colors. constructor. – Shailendra Madda Commented Mar 2 at 7:53 May 17, 2021 · Solution 1 : In your Scaffold, set "resizeToAvoidBottomInset" property to false. But when dimiss the keyboard by pressing back button or dismissing button in keyboard, keyboard will be hidden, and then shows up again automatically. requestFocus(inputFieldNode), Now the textfield will not lose focus even after pressing the submit button. // ---. Step 3: Add inputFormatters parameter and assign the [FilteringTextInputFormatter. Sep 20, 2021 · 5. Oct 18, 2022 · flutter_keyboard_size. 2 in 2020 the floating behaviour got smarter and I believe it should now be possible to always show the suffix when floatingLabelBehavior: FloatingLabelBehavior. It works like the following. The done action indicate that is the last field of the form and Jul 9, 2017 · See the answer for newer versions of Flutter. hasFocus. (Flutter version 1. Jul 20, 2019 · Run your code on a device with a smaller screen like an iPhone SE. So for example if I Apr 27, 2017 · 16. I could implement the hacks that were suggested on other stackoverlfow threads: bool keyboardvisible = MediaQuery. So whenever the user clicks on the textfield it never loses the focus. stream: _chats, builder: (context, snapshot) {. The Canvas Area displays the mobile device screen where you can add widgets by dragging and dropping them onto the canvas. I implemented for my app using Stack. exe, can solve, touch any position, on screen keyboard will not show. void initState() {. size class. Create FocusNode for each of your TextFormFields, assign it to the TextFormFields and onEditingComplete, request focus to the next Node. but cannot paste in the text – B. setState(() {. So, every time we have to mutate the keyboard size down to the widget tree. Focus that text field whenever you need to keep the keyboard visible and navigate between pages. Here is a fully correct answer. TextFormField in one container and ListTiles in another container and overlaying the listtile as user types on the container of text input field. LogicalKeyboardKey. requestFocus, when send button is pressed after that, the keyboard doesn't open anymore Looking for two options: Feb 7, 2019 · MediaQuery. Here a code snippet how I used it and it works fine for me: As of now, you can’t see a way to make the first keyboard entry a capital letter. flutter pub add flutter_keyboard_visibility. const snackBar = SnackBar( content: Text('Yay! A SnackBar!'), ); // Find the ScaffoldMessenger in the widget tree // and use it to show a SnackBar. onCapitalKeyPressed, }); final VoidCallback onCapitalKeyPressed; // REST OF THE CODE SAME. Check the full example below or run online here. You can simply give the widget a bottom position of MediaQuery. The key is an identifier for widgets, and is unrelated to keyboards. But problem is when i try this on my code then this container get hidden if keyboard popsup. FinderBase < Element > finder. May 9, 2023 · Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Example code below. return Scaffold( bottomSheet: Container( width: MediaQuery. Dart Version: 2. In the latest flutter version, All the above ways do not work if you have a visible icon or any other icon in your form field. For text entry, consider using a EditableText, which integrates with on-screen keyboards and input method editors (IMEs). com Aug 19, 2020 · In this post, we will create a demo to learn how to show and hide/dismiss soft keyboard in Flutter using FocusNode. characters to the TextField. You won't be able to do that with Flutter (I think) as the keyboard is handled by the Android System itself. of(context). If you don’t want to go through step by step, you can use below method to save time: /// Hide the soft keyboard. Jan 3, 2020 · I have controlled enabled field of TextFormField. If a more elaborate prefix is required, consider using prefix instead. , append characters to the input string). Jan 17, 2019 · 20. After the VM updates classes with the new versions of fields and functions, the Flutter framework automatically rebuilds the widget tree Oct 9, 2021 · In the Android, the text-field cursor should keep blinking when the soft keyboard is closed and the text-field has focus. 8. Flutter Gems is a curated list of Dart & Flutter packages that are categorized based on functionality. Let’s explore a simple Apr 27, 2023 · This practical article shows you two different ways to programmatically detect whether the soft keyboard is showing up or not in a Flutter application. so the best approach is to extract it to flutter actual widget, so instead of getBody() just build a widget HomepageBody or something similar. In the iPhone, the text-field cursor should hide as soon as the keyboard is closed. Click here to Subscribe to Johannes Milke: ht May 20, 2022 · When there is content in TextField, if tap the TextField, keyboard will shows up, and that's OK. In device_preview mode, I want to show the virtual keyboard when I tap on a text field and hide the keyboard when I click outside the text field area. Jul 18, 2022 at 11:47. StreamBuilder(. Blocking just your app's UI though, is the right approach whenever you have Canvas Area. State<StatefulWidget> createState() {. I want to detect if the keyboard is visible. To listen when keyboard is appearing/disappearing Show and hide the keyboard programmatically in Flutter by using focus, unfocus or autofocus for your TextField. List of Top Flutter Keyboard, Keyboard Visibility, Different Types of Keyboard packages. return _CrossGridState(); } } class _CrossGridState extends State<CrossGridWidget> {. You can check video for better explanation: Apr 6, 2019 · 2. When thumbVisibility is true, the scrollbar thumb will Oct 16, 2020 · There's a new package called keyboard_emoji_picker, and this package supports opening the native emoji keyboard. ChangeNotifierProvider<AuthService>(. Fast and easy to use custom number pad library for Flutter. bold ), ); Flutter’s TextBox offers prefixText. I recommend using ScopedModel. Jul 1, 2024 · Maintenance Status: Poor. Our MyApp widget will show a HomeView as the home of the Sep 5, 2022 · When I click on the blue button, "Button pressed!" gets printed and the keyboard does not disappear. resizeToAvoidBottomInset: true, body: Stack(. 2 days ago · 2. I can't quite get your approach, could you please provide full example? your _dismissKeyboard() method is just losing focus from textfield, isn't it? Apr 27, 2023 · This practical article shows you two different ways to programmatically detect whether the soft keyboard is showing up or not in a Flutter application. Feb 23, 2022 · I upgrade to flutter 3. I'm experimenting with Flutter development on Windows. Features # Shows suggestions in an floating box with the same width as your TextField; Allows controlling all aspects: suggestions, loading, errors, empty, animation, decoration, layout, etc. Hot reload works by injecting updated source code files into the running Dart Virtual Machine (VM). The problem is that CustomScrollView should be scrolled down when keyboard is shown. required this. Any ideas? Code (a bit simplified) is: Jul 7, 2022 · A simple package for dispaying virtual keyboards on a devices like kiosks and ATMs. Only one of prefix and prefixText can be specified. value = TextEditingValue(. Typically used by games and other apps that use keyboards for purposes other than text entry. Is there a way to achieve it? windows. Aug 31, 2021 · To make the keyboard also caps all the time you need to set keyboardType: TextInputType. Future <void> showKeyboard (. The instruction page for the package says we just have to put a KeyboardEmojiPickerWrapper in the widget tree, check if the native emoji keyboard is available using . focusNode: inputFieldNode, onSubmitted: (String) => FocusScope. Implies a call to pump. Feb 22, 2022 · I used the package keyboard_visibility. Uses hintStyle if prefixStyle isn't specified. Oct 12, 2020 · with autofocus, keyboard is being displayed automatically, but I don't want it to be displayed. See also f: labels. dev. height; keyboardHeight = MediaQuery. Jan 2, 2020 · If you see the screenshot of how my screen currently behaves, you can notice that it gets scrolled up(pay attention to the Logo TextField) when the keyboard is opened. KeyBoardLower({. 10. Now on the main screen toggle the flag isCapital inside the setState. 4. Provide details and share your research! But avoid …. I have a simple test app with an InputField. Expected results: Virtual keyboard should be dismissed and never be shown if there is no TextField get focused. I am creating a phone field similar to the one used for WhatsApp phone number entry. Dec 25, 2017 · Using FocusNode. Whether to show cursor. 22. Nov 18, 2020 · 1. Example Code showing Cupertino date picker: How to Force Small Letter Input on TextField: controller: mytext1, onChanged: (value) {. Sep 3, 2018 · 5. padding: EdgeInsets. I'd like the TextField to implement this difference automatically, to match the Platform. Im new to flutter, i want to view the prefix text in textformfield even not on pressed. text, **textCapitalization: TextCapitalization. On applying the above solution: The TextFormField which is already above the keyboard on gaining the focus it moves upwards and is not visible in the screen. of (context). Nov 2, 2023 · Using flutter_keyboard_visibility. Cellphone: xiaomi 8 (Android 10) Mar 13, 2021 · It is also not showing keyboard on real device) Here is my code which I thought should pop-up keyboard on tap: class CrossGridWidget extends StatefulWidget {. I want that the keyboard disappears when I click somewhere outside of the TextField, and that the button does not get triggered, even when I directly click on it. black, fontWeight: FontWeight. The cursor refers to the blinking caret when the EditableText is focused. But I wanted to add where to put the Wakelock. listen for physical keyboard raw key up event; filter out only 'REAL' characters (ASCII codes lower than 256, without special characters except enter) on each new key check if previous key is older than bufferDuration, if it's older clear internal buffer Nov 22, 2023 · When developing a Flutter application, mobile app developers often need to adjust the layout when the soft keyboard appears on the screen. const TestPage({Key? key}) : super(key: key); Dec 3, 2020 · This is not really an answer, but I can't write comments yet. bool ? showCursor. 1 Using MediaQuery. requestFocus(FocusNode()); } Feb 10, 2024 · In Flutter, handling keyboard visibility can be achieved through various approaches, such as using built-in widgets or packages like `flutter_keyboard_visibility`. Nov 6, 2020 · 11. A widget that calls a callback whenever the user presses or releases a key on a keyboard. In your case, set margin : to MediaQuery. 1. always is set, since the disabled animation would not interfere with the suffix widget. Apr 26, 2019 · super. Thus the flutter always keeps the focus on the text field. The problem is that your Widget tree is rebuilt when the keyboard shows/hides, causing your build method to be called again. textInput. logrocket. g. The bottom sheet in Flutter is shown using the call showBottomSheet. A RawKeyboardListener is useful for listening to raw key events and hardware buttons that are represented as keys. TextField ( keyboardType: TextInputType. Since you make use of TextField widgets, you can use the scrollPadding property which indicates how much space you want to have between so called viewInsets (usually something like the UI keyboard) and the TextField widget. You can dismiss the keyboard by taking away the focus of the TextFormField and giving it to an unused FocusNode: FocusScope. With the Scaffold in place, display a SnackBar. 5, child Jan 3, 2018 · A widget that calls a callback whenever the user presses or releases a key on a keyboard. 6. answered Sep 12, 2020 at 8:58. when I change windows focus, like focus on File explorer, then focus on flutter_demo. Just set the widget to read only (so that it doesn't take inputs) and then define an onTap. class. So you can set something like EdgeInsets. toLowerCase(), selection: mytext1. Apr 8, 2018 · just some info, it turns out that wrapping a widget in function is not a good practice in flutter cause it will always be rendered (if stateful) even if the context is exactly the same. It is also useful if you need to shrink-wrap May 5, 2024 · Flutter's hot reload feature helps you quickly and easily experiment, build UIs, add features, and fix bugs. Oct 30, 2019 · I would like to use this web app on a touch screen kiosk type of setup though so I wanted to always bring up the virtual (on screen) keyboard for text entry. my question is how to not show keyboard in any way if the icon is being clicked – Jul 13, 2019 · Showing the Bottom Sheet. Feb 21, 2023 · Keyboard Actions # Add features to the Android / iOS keyboard in a simple way. Aug 1, 2020 · I want to achieve a layout where only the main button widget will always remain at the bottom of the scaffold. My code: decoration: InputDecoration(. bottom. 2, testing devices = Android 5, Android 7 haven't tried iOS yet) Dec 22, 2022 · If user tap outside of textField and keyboard is open and user type something, than nothing will happen. But this can simply done by using TextFormField only. Dec 9, 2021 · I am follow this stack overflow accepted answer Link to display a container widget right above on keyboard if keyboard pops up. Jul 13, 2018 · After literally days of trying different approaches I found that the only way that I could avoid the keyboard-appearing-and-instantly-disappearing-on-form-field-focus issue was to have the AuthService() be at the top level of my app, in runApp() : void main() => runApp(. size. bz gp gh ez gp ff kl ak mt jv