safe_text
3.1.1, released 5 days ago by an unverified publisher
Fast Dart profanity and swear word filter with phone number detection for 80+ languages.
What it does
Filters offensive language and detects phone numbers in text using the Aho-Corasick algorithm. Supports character substitutions, custom word lists, and multiple masking strategies across 80+ languages.
AI-written summary of version 3.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to moderate user-generated text content like chat messages or comments
- You want to detect phone numbers embedded in natural language or mixed formats
- Performance on the UI thread is critical
Skip it when
- You require complex contextual or semantic AI-based content moderation beyond dictionary lookups
Strengths
- High performance suitable for running on the UI thread
- Supports 80+ languages and 55,000+ curated bad words
- Detects various phone number formats including leet-speak and multipliers
Weaknesses
- Relies on keyword and pattern matching which can produce false positives or miss context-dependent slurs
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:safe_text/safe_text.dart';
void main() async {
SafeTextFilter.init(language: Language.english);
final clean = SafeTextFilter.filterText(text: "What the f@ck!");
print(clean);
}Alternatives
Packages that do the same job and could replace safe_text.
- phone_numbers_parser
Dart library for parsing, validating, and formatting international phone numbers.
87Compare - flutter_charset_detector
Detect and decode the character encoding of text bytes automatically.
69Compare - linkify
Low-level Dart library that parses text into URLs, emails, phone numbers and user tags.
50Compare - number_to_word_arabic
Convert integer numbers to Arabic words up to 99 trillion.
47Compare