mofilo_content_filter 1.0.0 copy "mofilo_content_filter: ^1.0.0" to clipboard
mofilo_content_filter: ^1.0.0 copied to clipboard

A comprehensive content filtering package for Flutter that blocks offensive language, hate speech, profanity, and harmful content in multiple languages with advanced bypass detection.

Mofilo Content Filter #

A comprehensive, military-grade content filtering package for Flutter that protects your app from offensive, inappropriate, and harmful content.

Features #

  • Multi-layer Detection: 12+ detection layers to catch sophisticated bypass attempts
  • Multi-language Support: Filters offensive content in English, Spanish, French, German, Polish, Russian, Portuguese, Italian, Dutch
  • Advanced Normalization: Catches l33tspeak, Unicode tricks, zero-width characters, emojis, and visual lookalikes
  • Bypass Prevention: Detects encoding (Base64, ROT13, Hex, reversed text), spacing tricks, and character substitution
  • Security Protection: Blocks SQL injection, XSS, and other attack patterns
  • Comprehensive Coverage: Filters profanity, slurs, hate speech, violence, sexual content, self-harm, and more
  • Fuzzy Matching: Uses Levenshtein distance to catch misspellings and variations
  • Context-Aware: Analyzes combined text to catch context-based violations

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  mofilo_content_filter: ^0.0.1

Usage #

Basic Usage #

import 'package:mofilo_content_filter/mofilo_content_filter.dart';

// Validate a single field
final result = ContentFilter.validateFoodName("apple");
if (result.isAllowed) {
  print("Content is safe!");
} else {
  print("Blocked: ${result.reason}");
  print("Violations: ${result.violations}");
  print("Severity: ${result.severity}");
}

Validate Multiple Fields #

// Validate food name and brand together
final results = ContentFilter.validateAll(
  foodName: "chocolate cake",
  brandName: "Generic Brand",
);

if (results.isEmpty) {
  print("All content is safe!");
} else {
  results.forEach((field, result) {
    print("$field blocked: ${result.reason}");
  });
}

Custom Validation #

// Validate with custom fields
final result = ContentFilter.filter(
  foodName: "pizza",
  brandName: "Pizza Hut",
);

if (!result.isAllowed) {
  // Handle blocked content
  showError(result.reason);
}

What Gets Blocked #

The filter detects and blocks:

Language-Based #

  • Profanity and vulgar language (multiple languages)
  • Racial, ethnic, and religious slurs
  • Homophobic and transphobic slurs
  • Sexist and misogynistic language
  • Ableist slurs

Threat-Based #

  • Violence and death threats
  • Terrorism and extremism
  • Hate speech and symbols
  • Nazi/white supremacy content
  • Holocaust denial

Harmful Content #

  • Self-harm and suicide encouragement
  • Child abuse and pedophilia references
  • Sexual content and harassment
  • Drug references
  • Animal abuse

Technical Attacks #

  • SQL injection attempts
  • XSS (Cross-Site Scripting)
  • Spam and gibberish patterns
  • Encoded malicious content (Base64, ROT13, etc.)

Bypass Techniques Defended Against #

  1. Character Substitution: l33tspeak (f0ck, sh1t), symbols (@ss, f*ck)
  2. Spacing/Separators: f.u.c.k, f-u-c-k, f u c k
  3. Unicode Tricks: Cyrillic (фuck), fullwidth (fuck), circled (ⓕⓤⓒⓚ)
  4. Zero-Width Characters: fu​‌‍ck (invisible chars)
  5. Emojis: f😀u😀c😀k
  6. Encoding: Base64, ROT13, Hex, reversed text
  7. Mixed Case: FuCk, FUCK, fUcK
  8. Asterisks: fk, ner
  9. Homoglyphs: Using visually similar characters
  10. Fuzzy Spelling: fck, fuk, fuuk (Levenshtein distance matching)

Result Object #

class ContentFilterResult {
  final bool isAllowed;          // Whether content passes filter
  final String? reason;           // Reason for blocking (if blocked)
  final List<String> violations;  // List of specific violations
  final ContentFilterSeverity severity; // Severity level
}

enum ContentFilterSeverity {
  none,      // Content is safe
  low,       // Suspicious but might be legitimate
  medium,    // Likely violation
  high,      // Definite violation
  critical,  // Severe violation (slurs, hate speech, CSAM)
}

Publishing Checklist #

Before publishing to pub.dev:

  1. Update homepage/repository URLs in pubspec.yaml
  2. Ensure all tests pass: flutter test
  3. Check package score: flutter pub publish --dry-run
  4. Update CHANGELOG.md with version notes
  5. Publish: flutter pub publish

Contributing #

Contributions are welcome! Please:

  1. Test thoroughly with edge cases
  2. Follow existing code style
  3. Update documentation
  4. Add tests for new features

License #

[Your License Here]

Disclaimer #

This filter aims to block offensive content but no filter is 100% perfect. Always combine with human moderation for critical applications.

mofilo_content_filter #

2
likes
0
points
347
downloads

Publisher

verified publishermofilo.app

Weekly Downloads

A comprehensive content filtering package for Flutter that blocks offensive language, hate speech, profanity, and harmful content in multiple languages with advanced bypass detection.

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on mofilo_content_filter