Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 57 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ import 'package:keyboard_actions/keyboard_actions.dart';


class Content extends StatefulWidget {
const Content({
Key key,
}) : super(key: key);
const Content({super.key});

@override
_ContentState createState() => _ContentState();
Expand Down Expand Up @@ -104,7 +102,7 @@ class _ContentState extends State<Content> {
return AlertDialog(
content: Text("Custom Action"),
actions: <Widget>[
FlatButton(
TextButton(
child: Text("OK"),
onPressed: () => Navigator.of(context).pop(),
)
Expand All @@ -115,9 +113,9 @@ class _ContentState extends State<Content> {
),
KeyboardActionsItem(
focusNode: _nodeText4,
displayCloseWidget: false,
displayDoneButton: false,
),
KeyboardActionsItem(
KeyboardActionsItem(
focusNode: _nodeText5,
toolbarButtons: [
//button 1
Expand Down Expand Up @@ -166,64 +164,68 @@ class _ContentState extends State<Content> {

@override
Widget build(BuildContext context) {
return KeyboardActions(
config: _buildConfig(context),
child: Center(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
TextField(
keyboardType: TextInputType.number,
focusNode: _nodeText1,
decoration: InputDecoration(
hintText: "Input Number",
return Scaffold(
appBar: AppBar(title: Text('Keyboard Actions Sample')),
body: KeyboardActions(
config: _buildConfig(context),
child: Center(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
TextField(
keyboardType: TextInputType.number,
focusNode: _nodeText1,
decoration: InputDecoration(
hintText: "Input Number",
),
),
),
TextField(
keyboardType: TextInputType.text,
focusNode: _nodeText2,
decoration: InputDecoration(
hintText: "Input Text with Custom Done Button",
TextField(
keyboardType: TextInputType.text,
focusNode: _nodeText2,
decoration: InputDecoration(
hintText: "Input Text with Custom Done Button",
),
),
),
TextField(
keyboardType: TextInputType.number,
focusNode: _nodeText3,
decoration: InputDecoration(
hintText: "Input Number with Custom Action",
TextField(
keyboardType: TextInputType.number,
focusNode: _nodeText3,
decoration: InputDecoration(
hintText: "Input Number with Custom Action",
),
),
),
TextField(
keyboardType: TextInputType.text,
focusNode: _nodeText4,
decoration: InputDecoration(
hintText: "Input Text without Done button",
TextField(
keyboardType: TextInputType.text,
focusNode: _nodeText4,
decoration: InputDecoration(
hintText: "Input Text without Done button",
),
),
),
TextField(
keyboardType: TextInputType.number,
focusNode: _nodeText5,
decoration: InputDecoration(
hintText: "Input Number with Toolbar Buttons",
TextField(
keyboardType: TextInputType.number,
focusNode: _nodeText5,
decoration: InputDecoration(
hintText: "Input Number with Toolbar Buttons",
),
),
),
TextField(
keyboardType: TextInputType.number,
focusNode: _nodeText6,
decoration: InputDecoration(
hintText: "Input Number with Custom Footer",
TextField(
keyboardType: TextInputType.number,
focusNode: _nodeText6,
decoration: InputDecoration(
hintText: "Input Number with Custom Footer",
),
),
),
],
],
),
),
),
),
);
}
}


```

## Using Custom Keyboard
Expand Down Expand Up @@ -280,7 +282,7 @@ class Content extends StatelessWidget {
builder: (context, val, hasFocus) {
return Container(
alignment: Alignment.center,
color: hasFocus ? Colors.grey[300] : Colors.white,
color: hasFocus! ? Colors.grey[300] : Colors.white,
child: Text(
val,
style:
Expand All @@ -296,7 +298,7 @@ class Content extends StatelessWidget {
builder: (context, val, hasFocus) {
return Container(
width: double.maxFinite,
color: val ?? Colors.transparent,
color: val,
);
},
),
Expand All @@ -316,7 +318,7 @@ class ColorPickerKeyboard extends StatelessWidget
final ValueNotifier<Color> notifier;
static const double _kKeyboardHeight = 200;

ColorPickerKeyboard({Key key, this.notifier}) : super(key: key);
ColorPickerKeyboard({super.key, required this.notifier});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -357,7 +359,7 @@ class CounterKeyboard extends StatelessWidget
implements PreferredSizeWidget {
final ValueNotifier<String> notifier;

CounterKeyboard({Key key, this.notifier}) : super(key: key);
CounterKeyboard({super.key, required this.notifier});

@override
Size get preferredSize => Size.fromHeight(200);
Expand Down
10 changes: 5 additions & 5 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/diego/fvm/versions/3.7.3"
export "FLUTTER_APPLICATION_PATH=/Users/diego/Development/workspaces/flutter/flutter_keyboard_actions"
export "FLUTTER_ROOT=C:\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\Dell\Videos\flutter_keyboard_actions"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=4.1.1"
export "FLUTTER_BUILD_NUMBER=4.1.1"
export "FLUTTER_BUILD_NAME=4.2.0"
export "FLUTTER_BUILD_NUMBER=4.2.0"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
Expand Down