Keyboard not displaying properly
Closed this issue · 2 comments
Cali0707 commented
Hi,
When I try to use the keyboard in my app, it doesn't display the full keyboard:
My code is:
import 'package:flutter/material.dart';
import '../resources/constants.dart';
import 'package:groovin_widgets/groovin_widgets.dart';
import 'package:radio_button_form_field/radio_button_form_field.dart';
import 'package:keyboard_actions/keyboard_actions.dart';
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
final FocusNode _textNode = new FocusNode();
final GlobalKey _formKey = new GlobalKey();
double difficultyFactor;
int time;
KeyboardActionsConfig _buildConfig(BuildContext context) {
return KeyboardActionsConfig(
actions: [KeyboardActionsItem(focusNode: _textNode)]);
}
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Scaffold(
body: KeyboardActions(
config: _buildConfig(context),
child: SingleChildScrollView(
child: Column(
children: [
Stack(
children: [
Container(
height: size.height * 0.15,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30.0),
bottomRight: Radius.circular(30.0)),
color: Colors.blueAccent,
),
),
SafeArea(
child: Padding(
padding: EdgeInsets.all(20.0),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
'Welcome back',
style: TextStyle(
color: Colors.white,
fontSize: 24.0
),
),
),
),
),
],
),
Form(
key: _formKey,
child: Padding(
padding: EdgeInsets.all(20.0),
child: GroovinExpansionTile(
boxDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0),
color: Colors.blueAccent),
title: Text(
'New Workout',
style: TextStyle(color: Colors.white),
),
defaultTrailingIconColor: Colors.white,
children: [
Column(
children: [
Text(
'Difficulty',
style: TextStyle(color: Colors.white),
),
RadioButtonFormField(
context: context,
padding: EdgeInsets.all(8.0),
data: difficultyOptions,
display: 'display',
value: 'value',
toggleable: true,
activeColor: Colors.white,
titleStyle: TextStyle(color: Colors.white),
onSaved: (value) {
difficultyFactor = value;
},
),
Padding(
padding: EdgeInsets.all(15.0),
child: TextFormField(
onSaved: (value) {
time = int.parse(value) * 60;
},
style: TextStyle(color: Colors.white),
keyboardType: TextInputType.number,
focusNode: _textNode,
decoration: InputDecoration(
labelText: 'Length of Time',
hintText: 'How many minutes?',
hintStyle: TextStyle(color: Colors.white),
labelStyle: TextStyle(color: Colors.white),
border: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.white,
),
borderRadius: BorderRadius.circular(15.0)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.white,
),
borderRadius: BorderRadius.circular(15.0)),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.white,
),
borderRadius: BorderRadius.circular(15.0)),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.white,
),
borderRadius: BorderRadius.circular(15.0)),
),
),
),
FlatButton(
onPressed: () {
FormState _thisFormState =
_formKey.currentState;
_thisFormState.save();
},
child: Text(
'Next',
style: TextStyle(color: Colors.white),
)),
],
)
],
),
),
)
],
),
),
),
);
}
}
diegoveloper commented
Select your simulator, check the menu options, press I/O -> Keyboard -> Toggle Software Keyboard
Cali0707 commented
Thanks for the quick reply - it's working now!