diff --git a/.gitignore b/.gitignore
index 446ed0d..c1f17b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,5 @@ build/
ios/.generated/
ios/Flutter/Generated.xcconfig
ios/Runner/GeneratedPluginRegistrant.*
+
+.idea/**
diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml
index 51db6e8..a7102d6 100644
--- a/.idea/libraries/Dart_Packages.xml
+++ b/.idea/libraries/Dart_Packages.xml
@@ -5,174 +5,182 @@
-
+
-
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml
index 22ebdc2..3aeef26 100644
--- a/.idea/libraries/Dart_SDK.xml
+++ b/.idea/libraries/Dart_SDK.xml
@@ -1,27 +1,27 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b646b67..b980615 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -18,9 +18,8 @@
+
-
-
@@ -30,7 +29,6 @@
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh
new file mode 100755
index 0000000..86f60fc
--- /dev/null
+++ b/example/ios/Flutter/flutter_export_environment.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+# This is a generated file; do not edit or check into version control.
+export "FLUTTER_ROOT=/home/felipe/snap/flutter/common/flutter"
+export "FLUTTER_APPLICATION_PATH=/home/felipe/Sources/pin_code_text_field/example"
+export "FLUTTER_TARGET=lib/main.dart"
+export "FLUTTER_BUILD_DIR=build"
+export "SYMROOT=${SOURCE_ROOT}/../build/ios"
+export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
+export "FLUTTER_FRAMEWORK_DIR=/home/felipe/snap/flutter/common/flutter/bin/cache/artifacts/engine/ios"
+export "FLUTTER_BUILD_NAME=1.0.0"
+export "FLUTTER_BUILD_NUMBER=1"
+export "DART_OBFUSCATION=false"
+export "TRACK_WIDGET_CREATION=false"
+export "TREE_SHAKE_ICONS=false"
+export "PACKAGE_CONFIG=.packages"
diff --git a/lib/pin_code_text_field.dart b/lib/pin_code_text_field.dart
index 5989b69..445c577 100644
--- a/lib/pin_code_text_field.dart
+++ b/lib/pin_code_text_field.dart
@@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
+import 'package:pin_code_text_field/upper-case-text-formatter.dart';
typedef OnDone = void Function(String text);
typedef PinBoxDecoration = BoxDecoration Function(
@@ -140,6 +141,7 @@ class PinCodeTextField extends StatefulWidget {
final TextInputType keyboardType;
final EdgeInsets pinBoxOuterPadding;
final bool hasUnderline;
+ final bool upperCase;
const PinCodeTextField({
Key key,
@@ -178,6 +180,7 @@ class PinCodeTextField extends StatefulWidget {
this.pinBoxRadius = 0,
this.hideDefaultKeyboard = false,
this.hasUnderline = false,
+ this.upperCase = false
}) : super(key: key);
@override
@@ -377,6 +380,7 @@ class PinCodeTextFieldState extends State
keyboardType: widget.keyboardType,
inputFormatters: widget.keyboardType == TextInputType.number
? [WhitelistingTextInputFormatter.digitsOnly]
+ : widget.upperCase ? [UpperCaseTextFormatter()]
: null,
style: TextStyle(
height: 0.1, color: Colors.transparent,
@@ -417,6 +421,7 @@ class PinCodeTextFieldState extends State
keyboardType: widget.keyboardType,
inputFormatters: widget.keyboardType == TextInputType.number
? [WhitelistingTextInputFormatter.digitsOnly]
+ : widget.upperCase ? [UpperCaseTextFormatter()]
: null,
style: TextStyle(
color: Colors.transparent,
diff --git a/lib/upper-case-text-formatter.dart b/lib/upper-case-text-formatter.dart
new file mode 100644
index 0000000..bffb77b
--- /dev/null
+++ b/lib/upper-case-text-formatter.dart
@@ -0,0 +1,13 @@
+import 'package:flutter/services.dart';
+import 'package:flutter/widgets.dart';
+
+class UpperCaseTextFormatter extends TextInputFormatter {
+ @override
+ TextEditingValue formatEditUpdate(
+ TextEditingValue oldValue, TextEditingValue newValue) {
+ return TextEditingValue(
+ text: newValue.text?.toUpperCase(),
+ selection: newValue.selection,
+ );
+ }
+}