सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
Flutter Secure Keyboard एक Flutter पैकेज है जो मोबाइल उपकरणों पर उपयोगकर्ता इनपुट को कीलॉगर आ attaacks और स्क्रीन कैप्चर से सुरक्षित रखने के लिए डिज़ाइन किया गया है। यह सुरक्षित कीबोर्ड इंटरफ़ेस प्रदान करता है जो संवेदनशील इनपुट, जैसे पासवर्ड या पिन, को अवरुद्ध या रिकॉर्ड करने से अलग करता है। सुरक्षा के बारे में सोचकर बनाया गया, यह Android और iOS पर प्लेटफॉर्म-विशिष्ट विशेषताओं का उपयोग करता है ताकि डेटा दर्ज करते समय गोपनीय रहे। यह पैकेज बैंकिंग ऐप्स या प्रमाणीकरण प्रणालियों जैसे उच्च सुरक्षा आवश्यकता वाले ऐप्स के लिए आदर्श है।
उपयोग
सुरक्षित पासवर्ड इनपुट
PIN इनपुट सुरक्षा
प्रमाणीकरण प्रवाह
स्क्रीन रिकॉर्डिंग से बचाव
कीलॉगिंग को कम करना
संवेदनशील डेटा इनपुट
मुख्य विशेषताएँ
स्क्रीन कैप्चर रोकता है
कीलॉगर हमलों का प्रतिरोध करता है
प्लेटफॉर्म-नेटिव सुरक्षा
आइसोलेटेड इनपुट हैंडलिंग
क्रॉस-प्लेटफ़ॉर्म समर्थन (Android और iOS)
pub add के माध्यम से आसान एकीकरण
इनके लिए उपयुक्त
वित्तीय एप्लिकेशन
प्रमाणीकरण प्रणाली
गोपनीयता-केंद्रित ऐप्स
एंटरप्राइज मोबाइल सॉल्यूशन्स
संवेदनशील प्रमाणपत्रों का संचालन करने वाले ऐप्स
विचार योग्य बातें
उपयोगकर्ता अनुभव के लिए सावधानीपूर्वक UI डिज़ाइन की आवश्यकता होती है
सुविधाजनक विशेषताओं को प्रभावित कर सकता है
सीमित कस्टमाइजेशन विकल्प
प्लेटफॉर्म-स्तरीय सुरक्षा पर निर्भर करता है
पूर्ण एन्क्रिप्शन का प्रतिस्थापन नहीं है
पुराने उपकरणों पर संभावित प्रदर्शन अतिरिक्त खर्च
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
Mobile secure keyboard to prevent KeyLogger attack and screen capture.
classWithSecureKeyboardExampleextendsStatefulWidget{
@override_WithSecureKeyboardExampleStatecreateState() =>
_WithSecureKeyboardExampleState();
}
class_WithSecureKeyboardExampleStateextendsState<WithSecureKeyboardExample> {
final _secureKeyboardController = SecureKeyboardController();
final _passwordEditor = TextEditingController();
final _passwordTextFieldFocusNode = FocusNode();
final _pinCodeEditor = TextEditingController();
final _pinCodeTextFieldFocusNode = FocusNode();
@overrideWidgetbuild(BuildContext context) {
// Set the WithSecureKeyboard widget as the top-level widget// in the build function so that the secure keyboard works properly.returnWithSecureKeyboard(
controller: _secureKeyboardController,
child: Scaffold(
appBar: AppBar(
title: Text('flutter_secure_keyboard'),
),
body: _buildContentView(),
),
);
}
Widget_buildContentView() {
// We recommend using the ListView widget to prevent widget overflow.returnListView(
padding: constEdgeInsets.all(8.0),
children: [
_buildPasswordTextField(),
SizedBox(height: 12.0),
_buildPinCodeTextField(),
],
);
}
Widget_buildPasswordTextField() {
returnColumn(
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() {
returnColumn(
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);
},
);
},
),
],
);
}
@overridevoiddispose() {
super.dispose();
_secureKeyboardController.dispose();
_passwordEditor.dispose();
_pinCodeEditor.dispose();
}
}
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).
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.