flutter_profanity_filter 0.0.4 copy "flutter_profanity_filter: ^0.0.4" to clipboard
flutter_profanity_filter: ^0.0.4 copied to clipboard

A simple profanity filter for Dart and Flutter applications.

Profanity Filter #

Profanity Filter is a Dart package that helps you detect and censor profanity in text strings. It provides a simple API to check if a given text contains profanity and to censor profanity by replacing it with asterisks.

Installation #

To use Profanity Filter in your Dart project, add it to your pubspec.yaml file:

dependencies:
  flutter_profanity_filter: ^0.0.2



// example/main.dart
import 'package:flutter_profanity_filter/profanity_filter.dart';

void main() {
  final filter = ProfanityFilter();

  // Check if a text contains profanity
  print(filter.hasProfanity('This is a fuck')); // true
  print(filter.hasProfanity('This is clean')); // false

  // Censor profanity in a text
  print(filter.censor('This is a fuck')); // 'This is a *******'
  print(filter.censor('This is clean')); // 'This is clean'
}

Supported languages:

  • English
  • Spanish
2
likes
150
points
53
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A simple profanity filter for Dart and Flutter applications.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_profanity_filter