Skip to content

How can I make the keyboard fill the full screen? #27

@pegvin

Description

@pegvin

I am trying to make a keyboard app using this library, Thus I just want to fill the whole app's screen with the keyboard.

How can I do this? I tried the following:

class MyApp extends StatelessWidget {
	const MyApp({super.key});

	@override
	Widget build(BuildContext context) {
		return MaterialApp(
			title: 'Keyboard',
			builder: OnscreenKeyboard.builder(
				aspectRatio: 16 / 9,
				theme: OnscreenKeyboardThemeData.ios(),
				showControlBar: false,
			),
			home: const MyHomePage(),
		);
	}
}

class MyHomePage extends StatefulWidget {
	const MyHomePage({super.key});

	@override
	State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
	late final kbd = OnscreenKeyboard.of(context);

	@override
	void initState() {
		super.initState();

		WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
			kbd.open();
		});
	}

	@override
	Widget build(BuildContext context) {
		return SizedBox.shrink();
	}
}

As my window's aspect ratio is 16 / 9 as well (800x450), But this results in bottom overflow by 14px:

Image

Although doing the same but without any custom theming fills the screen just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions