Skip to content
pubscout

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.

WASM-ready
$ flutter pub add safe_text
Source repository

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.