xxxxxxxxxx
import 'package:flutter/material.dart';
class KeyboardPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: GestureDetector(
onTap: () {
// Open the keyboard without focusing on a text field
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
FocusManager.instance.primaryFocus.requestFocus();
}
},
child: Container(
alignment: Alignment.center,
child: Text(
'Tap anywhere to open keyboard',
style: TextStyle(fontSize: 20),
),
),
),
);
}
}