flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
163.64k stars 26.92k forks source link

Keyboard submit is off the screen on android Wear 2 device. #24001

Open ibrierley opened 5 years ago

ibrierley commented 5 years ago

Problem is on an Android Wear app, mobile is fine.

There is no way to enter any input, as when the keyboard appears, submit is off the screen. Example...

return MaterialApp(
    home: Scaffold(
      body: new TextField(
        keyboardType: TextInputType.multiline,
        maxLines: null,
      ),
    )
  );

Screenshot at https://stackoverflow.com/questions/53161631/flutter-reposition-keyboard-down

Logs

LEO DLXX      • QEV7N17B22001003 • android-arm • Android 8.0.0 (API 26)
sdk gwear x86 • emulator-5554    • android-x86 • Android 8.0.0 (API 26) (emulator)
moo@moo2 ~/AndroidStudioProjects/flutter_gps $ flutter run --verbose
[  +27 ms] executing: [/home/moo/android/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +27 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/beta
[        ] executing: [/home/moo/android/flutter/] git rev-parse --abbrev-ref HEAD
[   +4 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] beta
[        ] executing: [/home/moo/android/flutter/] git ls-remote --get-url origin
[   +4 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[        ] executing: [/home/moo/android/flutter/] git log -n 1 --pretty=format:%H
[   +4 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[        ] f37c235c32fc15babe6dc7b7bc2ee4387e5ecf92
[        ] executing: [/home/moo/android/flutter/] git log -n 1 --pretty=format:%ar
[   +5 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[        ] 6 weeks ago
[        ] executing: [/home/moo/android/flutter/] git describe --match v*.*.* --first-parent --long --tags
[   +5 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v0.9.4-0-gf37c235
[  +61 ms] executing: /media/files/Android/Sdk/platform-tools/adb devices -l
[   +6 ms] Exit code 0 from: /media/files/Android/Sdk/platform-tools/adb devices -l
[        ] List of devices attached
           QEV7N17B22001003       device usb:2-1.5 product:sawshark model:LEO_DLXX device:sawshark transport_id:15
           emulator-5554          device product:sdk_gwear_x86 model:sdk_gwear_x86 device:generic_x86 transport_id:17
[   +9 ms] More than one device connected; please specify a device with the '-d <deviceId>' flag, or use '-d all' to act on all devices.
[   +5 ms] /media/files/Android/Sdk/platform-tools/adb -s QEV7N17B22001003 shell getprop
[ +102 ms] ro.hardware = sawshark
[   +1 ms] ro.build.characteristics = nosdcard,watch
[   +1 ms] /media/files/Android/Sdk/platform-tools/adb -s emulator-5554 shell getprop
[  +15 ms] ro.hardware = ranchu
[   +1 ms] LEO DLXX      • QEV7N17B22001003 • android-arm • Android 8.0.0 (API 26)
[        ] sdk gwear x86 • emulator-5554    • android-x86 • Android 8.0.0 (API 26) (emulator)
[  +10 ms] "flutter run" took 172ms.
[✓] Flutter (Channel beta, v0.9.4, on Linux, locale en_GB.UTF-8)
    • Flutter version 0.9.4 at /home/moo/android/flutter
    • Framework revision f37c235c32 (6 weeks ago), 2018-09-25 17:45:40 -0400
    • Engine revision 74625aed32
    • Dart version 2.1.0-dev.5.0.flutter-a2eb050044

[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /media/files/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /media/files/Android/Sdk
    • Java binary at: /home/moo/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[✓] Android Studio (version 2.2)
    • Android Studio at /media/files/android-studio
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_76-release-b03)

[✓] Android Studio (version 3.2)
    • Android Studio at /home/moo/android-studio
    • Flutter plugin version 30.0.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] Connected devices (2 available)
    • LEO DLXX      • QEV7N17B22001003 • android-arm • Android 8.0.0 (API 26)
    • sdk gwear x86 • emulator-5554    • android-x86 • Android 8.0.0 (API 26) (emulator)

! Doctor found issues in 1 category.
miyoyo commented 5 years ago

This is not flutter specific, this happens to any app not using WearOS' keyboard specifically.

If you try installing a normal android app (say, discord) it will have the same problem.

This requires specific support for WearOS devices, so I don't expect it to be supported by flutter anytime soon.

ibrierley commented 5 years ago

Just trying to understand, I see Messages and Contacts for example can run a keyboard (which pops up the option of voice or keyboard first). Is this somehow not available to normal apps (irrespective of flutter)?

miyoyo commented 5 years ago

The mechanism wearOS uses to show a keyboard is not the same as "regular android", so normal apps will look wierd.

I'll take a screenshot of discord if I have time today.

EDIT: It does seem discord improved on that, since you can now login normally (you get correct keyboards)

It works

However, the main "chat" keyboard is still broken

Doesn't work Here

Maybe showing a keyboard that's not linked to a text field does that? Since the space lost at the top is exactly as high as the size of the black fields

Confirmed working fields: Login Password "Start a conversation"

Partially Broken fields: The chat field

Non-working field: The 2FA entry

au-top commented 3 years ago

Is there a solution ? I hope this problem will be solved. Hope that flutter supports wear OS...

au-top commented 3 years ago

The mechanism wearOS uses to show a keyboard is not the same as "regular android", so normal apps will look wierd.

I'll take a screenshot of discord if I have time today.

EDIT: It does seem discord improved on that, since you can now login normally (you get correct keyboards)

It works

However, the main "chat" keyboard is still broken

Doesn't work Here

Maybe showing a keyboard that's not linked to a text field does that? Since the space lost at the top is exactly as high as > the size of the black fields

Confirmed working fields: Login Password "Start a conversation"

Partially Broken fields: The chat field

Non-working field: The 2FA entry

Normal textfields still don't work and can produce code continuously

au-top commented 3 years ago

I tried the same code on win and MacOS 10.15.6

Different situations have occurred, which can run normally on win, but it appears as shown in the figure on MacOS

Is this related to running a virtual machine system

They have the same operating environment

Fluent version 1.20.3

wearos api28 android9

darshankawar commented 3 weeks ago

Revisiting this issue and trying out the given code sample using latest stable version running on wearOS emulator, tapping on the textfield opens the keyboard but submit / done button isn't visible:

Screenshot 2024-06-26 at 4 21 36 PM Screenshot 2024-06-26 at 4 21 46 PM
runnable code ``` import 'package:flutter/foundation.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', home: Scaffold( resizeToAvoidBottomInset: true, appBar: AppBar( title: const Text('Home Page'), ), body: Center( child: TextField( keyboardType: TextInputType.multiline, maxLines: null, decoration: InputDecoration( ), ), ) ), ); } } ```