Mobile secure keyboard to prevent KeyLogger attack and screen capture.

Overview

Mobile secure keyboard to prevent KeyLogger attack and screen capture.

pub package

Screenshots

Alphanumeric Numeric

Getting started

To use this plugin, add flutter_secure_keyboard as a dependency in your pubspec.yaml file. For example:

dependencies:
  flutter_secure_keyboard: ^2.2.2

Examples

class WithSecureKeyboardExample extends StatefulWidget {
  @override
  _WithSecureKeyboardExampleState createState() => _WithSecureKeyboardExampleState();
}

class _WithSecureKeyboardExampleState extends State<WithSecureKeyboardExample> {
  final _secureKeyboardController = SecureKeyboardController();

  final _passwordEditor = TextEditingController();
  final _passwordTextFieldFocusNode = FocusNode();

  final _pinCodeEditor = TextEditingController();
  final _pinCodeTextFieldFocusNode = FocusNode();

  @override
  Widget build(BuildContext context) {
    // Set the WithSecureKeyboard widget as the top-level widget
    // in the build function so that the secure keyboard works properly.
    return WithSecureKeyboard(
      controller: _secureKeyboardController,
      child: Scaffold(
        appBar: AppBar(title: Text('with_secure_keyboard_example')),
        body: _buildContentView()
      ),
    );
  }

  Widget _buildContentView() {
    // We recommend using the ListView widget to prevent widget overflow.
    return ListView(
      padding: const EdgeInsets.all(8.0),
      children: [
        _buildPasswordTextField(),
        SizedBox(height: 12.0),
        _buildPinCodeTextField()
      ],
    );
  }

  Widget _buildPasswordTextField() {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text('Password'),
        TextFormField(
          controller: _passwordEditor,
          focusNode: _passwordTextFieldFocusNode,
          // We recommended to set false to prevent the software keyboard from opening.
          enableInteractiveSelection: false,
          obscureText: true,
          onTap: () {
            _secureKeyboardController.show(
              type: SecureKeyboardType.ALPHA_NUMERIC,
              focusNode: _passwordTextFieldFocusNode,
              initText: _passwordEditor.text,
              hintText: 'password',
              // Use onCharCodesChanged to have text entered in real time.
              onCharCodesChanged: (List<int> charCodes) {
                _passwordEditor.text = String.fromCharCodes(charCodes);
              }
            );
          },
        ),
      ],
    );
  }

  Widget _buildPinCodeTextField() {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text('PinCode'),
        TextFormField(
          controller: _pinCodeEditor,
          focusNode: _pinCodeTextFieldFocusNode,
          // We recommended to set false to prevent the software keyboard from opening.
          enableInteractiveSelection: false,
          obscureText: true,
          onTap: () {
            _secureKeyboardController.show(
              type: SecureKeyboardType.NUMERIC,
              focusNode: _pinCodeTextFieldFocusNode,
              initText: _pinCodeEditor.text,
              hintText: 'pinCode',
              // Use onDoneKeyPressed to allow text to be entered when you press the done key,
              // or to do something like encryption.
              onDoneKeyPressed: (List<int> charCodes) {
                _pinCodeEditor.text = String.fromCharCodes(charCodes);
              }
            );
          },
        ),
      ],
    );
  }
}

Package

  • WithSecureKeyboard - A widget that implements a secure keyboard with controller.
  • SecureKeyboardController - Controller to check or control the state of the secure keyboard.

Note: The parameters marked with an asterisk(*) are required.

WithSecureKeyboard

Parameter Description
controller* Controller to control the secure keyboard.
child* A child widget with a secure keyboard.
keyboardHeight The height of the keyboard.
Default value is 280.0.
keyRadius The radius of the keyboard key.
Default value is 4.0.
keySpacing The spacing between keyboard keys.
Default value is 1.2.
keyInputMonitorPadding The padding of the key input monitor.
Default value is const EdgeInsets.only(left: 10.0, right: 5.0).
keyboardPadding The padding of the keyboard.
Default value is const EdgeInsets.symmetric(horizontal: 5.0).
backgroundColor The background color of the keyboard.
Default value is const Color(0xFF0A0A0A).
stringKeyColor The color of the string key(alphanumeric, numeric..).
Default value is const Color(0xFF313131).
actionKeyColor The color of the action key(shift, backspace, clear..).
Default value is const Color(0xFF222222).
doneKeyColor The color of the done key.
Default value is const Color(0xFF1C7CDC).
activatedKeyColor The key color when the shift action key is activated. If the value is null, doneKeyColor is used.
keyTextStyle The text style of the text inside the keyboard key.
Default value is const TextStyle(color: Colors.white, fontSize: 17.0, fontWeight: FontWeight.w500).
inputTextStyle The text style of the text inside the key input monitor.
Default value is const TextStyle(color: Colors.white, fontSize: 17.0, fontWeight: FontWeight.w500).
screenCaptureDetectedAlertTitle Security Alert title, only works on iOS.
screenCaptureDetectedAlertMessage Security Alert message, only works on iOS
screenCaptureDetectedAlertActionTitle Security Alert actionTitle, only works on iOS.

SecureKeyboardController

Function Description
isShowing Whether the secure keyboard is showing.
show Show secure keyboard.
hide Hide secure keyboard.

SecureKeyboardController.show()

Parameter Description
type* The type of the secure keyboard.
focusNode The FocusNode that will receive focus on.
initText The initial value of the input text.
hintText The hint text to display when the input text is empty.
inputTextLengthSymbol The symbol to use when displaying the input text length.
doneKeyText The text of the done key.
clearKeyText The text of the clear key.
obscuringCharacter The secure character to hide the input text.
Default value is .
maxLength The maximum length of text that can be entered.
alwaysCaps Whether to always display uppercase characters.
Default value is false.
obscureText Whether to hide input text as secure characters.
Default value is true.
shuffleNumericKey Whether to shuffle the position of the numeric keys.
Default value is true.
hideKeyInputMonitor Whether to hide the key input monitor.
Default value is false.
disableKeyBubble Whether to disable the key bubble.
Default value is false.
onKeyPressed Called when the key is pressed.
onCharCodesChanged Called when the character codes changed.
onDoneKeyPressed Called when the done key is pressed.
onCloseKeyPressed Called when the close key is pressed.
You might also like...

A SECURE personal data Analysis and Storage system.

Magic Data Bottle Our goal is to design and implement a secure personal data analysis and storage system. Repo Structure app An android app written in

Sep 27, 2022

An implementation for flutter secure file storage

Flutter secure file storage An implementation for flutter secure file storage. F

Oct 29, 2022

Generate secure passwords, check for exposed passwords, get visual feedback for password strength or get form validation with a minimum password strength required.

Generate secure passwords, check for exposed passwords, get visual feedback for password strength or get form validation with a minimum password strength required.

password_strength_checker Generate secure passwords, check for exposed passwords, get visual feedback for password strength or get form validation wit

Aug 8, 2023

Flutter form fields designed to take much of the burden of form-related coding off the programmer's back — masks, validations, keyboard type, etc.

Flutter form fields designed to take much of the burden of form-related coding off the programmer's back — masks, validations, keyboard type, etc.

well_formed Contents Overview Getting Started Demo application References Overview Well-Formed Widget Fields - Well-Formed - is a collection of Flutte

Nov 2, 2022

Flutter package to get keyboard height. Can be used to display a sticker/emoji modal with correct height.

Flutter package to get keyboard height. Can be used to display a sticker/emoji modal with correct height.

flutter_persistent_keyboard_height Flutter package to get keyboard height. The height is persisted during app sessions and keyboard states (you can us

Oct 17, 2022

A Flutter package that provides an Emoji Keyboard widget.

Flutter Choose Keyboard A Flutter package that provides an Emoji Keyboard widget. BASED IN: https://github.com/JeffG05/emoji_picker Key Features Flutt

Oct 22, 2021

A new Flutter widget that add support for AndroidTV app. Using keyboard to control focus node.

A new Flutter widget that add support for AndroidTV app. Using keyboard to control focus node.

flutter_tv_autofocus A new Flutter widget that add support for AndroidTV app. Using keyboard to control focus node. Getting Started Wrap your flutter

Aug 18, 2022

Keyboard Store UI Built With Flutter

Keyboard Store UI Built With Flutter

Flutter UI Day 15 of 100 - Keyboard Store UI Getting Started git clone https://github.com/afifudinn/flutter-keyboard-store cd flutter-keyboard-store f

Dec 4, 2021

A custom keyboard UI for flutter

A custom keyboard UI for flutter

Flutter Custom Keyboard Design Credit: Dribbble

Nov 28, 2022
Owner
null
Doctor Consultation App in Flutter containing splash screen on boarding screen Routing state management Dash board Bottom navigation Decorated Drawer and Doctors Screen in the last.

Online doctor Consultation App UI in Flutter Doctor Consultation App UI in Flutter Visit Website Features State Management Navigation Bar Responsive D

Habib ullah 14 Jan 1, 2023
Android test task master - Create PIN code screen, authentication by PIN code screen and menu screen

Here is described test tasks for a android dev. Need to implement three screens:

null 3 Oct 4, 2022
Ozzie is your testing friend. Ozzie will take an screenshot during integration tests whenever you need. Ozzie will capture performance reports for you.

ozzie.flutter Ozzie is your testing friend. Ozzie will take an screenshot during integration tests whenever you need. Ozzie will capture performance r

Jorge Coca 40 Nov 3, 2022
SeizeYourSpace - An App to capture details about folks interested in joining Publicis Sapient. Especially useful at events!

photo_job A simple app to take in candidate applications at a Conference Booth. This simplifies the work for a recruiter and eliminates the paper work

Pavan Podila 4 Jul 11, 2022
Color detection in images to capture presense of known objects.

swatch Color detection in images to capture presence of known objects. Why? There is great object and face detection software out there, but sometimes

Nicolas Mowen 35 Dec 7, 2022
Appwrite is a secure end-to-end backend server for Web, Mobile, and Flutter developers that is packaged as a set of Docker containers for easy deployment 🚀

A complete backend solution for your [Flutter / Vue / Angular / React / iOS / Android / *ANY OTHER*] app Appwrite 0.12 has been released! Learn what's

Appwrite 28.2k Jan 3, 2023
A beautiful, secure and simple authenticator app that supports multiple protocols and services. Free and open source. Written in Flutter and Dart.

OpenAuth A beautiful, secure and simple authenticator app that supports multiple protocols and services. Free and open source. Written in Flutter and

Isaiah Collins Abetong 31 Oct 5, 2022
Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.

supabase_flutter Flutter package for Supabase. What is Supabase Supabase is an open source Firebase alternative. We are a service to: listen to databa

Supabase 251 Jan 7, 2023
An easy configurable and secure open-source personal password manager.

An easy configurable and secure open-source personal password manager. Anyone can you this project and generate his own personal mobile app. All the passwords will be saved into your own Firebase Firestone database with encryption.

Shudipto Trafder 18 Dec 28, 2022
Naan is an easy to use and secure wallet for NFTs & DeFi on the Tezos blockchain.

Naan - A Tasty Tezos Wallet Naan is a fun, simple, and secure way to create a Tezos wallet, collect NFTs, and explore the new world of Web3 on Tezos.

Tezsure 3 Aug 26, 2022