safe_text library
Classes
- CustomMask
- Replaces the entire matched word with a fixed replacement string.
- FullMask
- Masks every character of the matched word with obscureSymbol.
- MaskStrategy
-
obscureSymbolmust be exactly one character (e.g.'*','#','X'), defaults to kDefaultObscureSymbol. - ObscureSymbolStrategy
- Base class for strategies that mask with a single obscureSymbol character.
- PartialMask
- Partially masks the matched word, keeping the first character visible. For words with 4+ characters, also keeps the last character visible.
- PhoneNumberChecker
- SafeText
- Legacy facade that delegates to SafeTextFilter and PhoneNumberChecker.
- SafeTextFilter
- Core filter class that uses Aho-Corasick trie for efficient searching
Enums
- Language
- Supported languages for the profanity word dataset.
Extensions
- LanguageExtension on Language
- Utility extension on Language for string conversion and asset path resolution.
Constants
- kDefaultObscureSymbol → const String
- The default character used to mask profanity in FullMask and PartialMask strategies.
- kDefaultReplacement → const String
- The default replacement string used by CustomMask when no custom value is provided.