GardenMobile & interfaces

A Flutter form that scrolls around the keyboard

An older Scaffold and Android launch-theme example for a screen with several text fields.

A form with several fields needs a way to keep the focused input visible when the keyboard reduces the available space. The original example combined a Scaffold with a scrollable column:

@override
Widget build(BuildContext context) {
  return Scaffold(
    resizeToAvoidBottomPadding: true,
    appBar: AppBar(
      title: Text(widget.title),
    ),
    body: Center(
      child: SingleChildScrollView(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            TextField(),
            TextField(),
            TextField(),
            TextField(),
            TextField(),
            TextField(),
            Text('end'),
            TextField(),
          ],
        ),
      ),
    ),
  );
}

Check the Android window too

The source also noted that a fullscreen launch-theme flag affected keyboard behavior in its application. Its ordinary launch theme was:

<resources>
    <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
        <!-- Show a splash screen on the activity. Automatically removed when
            Flutter draws its first frame -->
        <item name="android:windowBackground">@drawable/launch_background</item>
    </style>
</resources>

The temporary splash treatment and the form’s normal window behavior are separate concerns. A flag intended for launch should not silently determine how the interactive form handles the keyboard.

This is an older Flutter example using resizeToAvoidBottomPadding. The property name and Android embedding belong to that toolchain; no current Flutter build or keyboard interaction was tested for this revision.

← Back to the garden