secure_textfield 1.0.1 copy "secure_textfield: ^1.0.1" to clipboard
secure_textfield: ^1.0.1 copied to clipboard

A Flutter package that provides a secure text field widget blocking copy/paste functionality across iOS, Android, and web platforms.

Changelog #

1.0.1 - 2025-08-03 #

Bug Fixes #

1.0.0 - 2025-07-31 #

โš  BREAKING CHANGES #

  • Initial release

Features #

  • add CI workflow for linting and code analysis (#1) (0dd5a19)
  • add Conventional Commits guide and update README with commit conventions (#5) (ae880c9)
  • add test coverage workflow and update README with coverage instructions (#3) (657ef46)
  • initial release of SecureTextField package (9ad4491)

Bug Fixes #

  • add permissions for issues in release workflow (bf69741)
  • ci check badge (#4) (aabbdfa)
  • correct action reference in release workflow (#6) (d3ad16a)

๐Ÿ”’ Secure TextField #

CI Check Test Coverage codecov pub package

A Flutter package that provides an enhanced secure text field widget designed to protect sensitive user input by preventing copy, paste, cut, and select operations across iOS, Android, and web platforms. Perfect for password fields, PINs, credit card numbers, and other confidential data entry scenarios. ๐Ÿ›ก๏ธ

โœจ Features #

๐ŸŒ Universal Platform Support: Seamlessly works across iOS, Android, and web browsers with consistent behavior
๐Ÿšซ Complete Input Protection: Intelligently blocks copy, paste, cut, and select all operations to safeguard sensitive data
โŒจ๏ธ Smart Keyboard Blocking: Automatically prevents common keyboard shortcuts (Ctrl+C/V/X/A, Cmd+C/V/X/A) across all platforms
๐Ÿ“‹ Context Menu Defense: Disables right-click menus on web and long-press context menus on mobile devices
๐ŸŽฏ Full TextField Compatibility: Maintains 100% compatibility with standard TextField properties, callbacks, and styling options
๐Ÿ”ง Zero Configuration: Works out of the box with no additional setup required - just replace TextField with SecureTextField!

๐Ÿš€ Getting started #

Add the package to your pubspec.yaml:

dependencies:
  secure_textfield: ^0.1.0

Then run:

flutter pub get

๐Ÿ’ป Usage #

Import the package and use SecureTextField instead of the standard TextField:

import 'package:flutter/material.dart';
import 'package:secure_textfield/secure_textfield.dart';

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SecureTextField(
      decoration: InputDecoration(
        labelText: 'Secure Input',
        hintText: 'Copy/paste is blocked here',
        border: OutlineInputBorder(),
      ),
      onChanged: (value) {
        print('Text changed: $value');
      },
    );
  }
}

๐Ÿ” Password Field Example #

SecureTextField(
  obscureText: true,
  decoration: InputDecoration(
    labelText: 'Password',
    prefixIcon: Icon(Icons.lock),
    border: OutlineInputBorder(),
  ),
)

๐Ÿ“ Multiline Example #

SecureTextField(
  maxLines: 4,
  decoration: InputDecoration(
    labelText: 'Comments',
    hintText: 'Enter your comments here...',
    border: OutlineInputBorder(),
    alignLabelWithHint: true,
  ),
)

๐ŸŽฎ With Controller #

final TextEditingController controller = TextEditingController();

SecureTextField(
  controller: controller,
  decoration: InputDecoration(
    labelText: 'Controlled Input',
    border: OutlineInputBorder(),
  ),
  onSubmitted: (value) {
    print('Submitted: $value');
  },
)

๐Ÿ“ฑ Example App #

Check out the example app for a comprehensive demonstration of all features:

cd example
flutter run

๐Ÿงช Testing #

The package includes comprehensive tests covering:

  • Widget behavior and rendering
  • Platform-specific functionality
  • Keyboard shortcut blocking
  • All TextField property support
  • Edge cases and error scenarios

Run tests with:

flutter test

๐Ÿค Contributing #

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

๐Ÿ“ Commit Convention #

This project uses Conventional Commits for automated changelog generation and version bumping. Please format your commit messages as:

<type>[optional scope]: <description>

Examples:

  • feat: add new validation feature
  • fix: resolve input focus issue
  • docs: update README with new examples

See .github/CONVENTIONAL_COMMITS.md for detailed guidelines.

๐Ÿš€ Release Process #

Releases are automated using Release Please:

  1. Commit changes using conventional commit format
  2. Push to main branch
  3. Release Please automatically creates a release PR with updated version and changelog
  4. When the release PR is merged, a new GitHub release is created
  5. The package can then be published to pub.flutter-io.cn (currently manual)

๐Ÿ“„ License #

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ“š Additional Information #

  • ๐Ÿ› Issue Tracker: GitHub Issues
  • ๐Ÿ“– Documentation: Check the API documentation for detailed information about all available properties and methods
  • ๐Ÿ“ˆ Changelog: See CHANGELOG.md for version history

๐Ÿ” Security Considerations #

This package provides UI-level protection against copy/paste operations. For sensitive data:

  1. Use additional server-side validation
  2. Implement proper data encryption
  3. Consider using secure storage solutions
  4. Be aware that determined users may still find ways to extract data

The package is designed to prevent casual copy/paste operations and improve user experience, but should not be relied upon as the sole security measure for highly sensitive data.

0
likes
160
points
34
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package that provides a secure text field widget blocking copy/paste functionality across iOS, Android, and web platforms.

Repository (GitHub)
View/report issues

Topics

#flutter #security #textfield #copy-paste #input-protection

Documentation

API reference

License

MIT (license)

Dependencies

flutter, universal_io

More

Packages that depend on secure_textfield