supabase_error_translator_flutter 1.0.1 copy "supabase_error_translator_flutter: ^1.0.1" to clipboard
supabase_error_translator_flutter: ^1.0.1 copied to clipboard

Translate Supabase error codes into user-friendly messages in 9 languages. Perfect for international Flutter apps with automatic language detection and robust fallback system.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

1.0.0 - 2025-01-15 #

Added #

  • 🌍 Multi-language Support: Complete translation support for 9 languages

    • English (en), Spanish (es), French (fr), German (de), Italian (it)
    • Portuguese (pt), Dutch (nl), Polish (pl), Russian (ru)
  • 🎯 Complete Supabase Service Coverage:

    • Auth: Authentication, user management, MFA, rate limiting
    • Database: Connections, queries, constraints, permissions
    • Storage: Files, buckets, permissions, size limits
    • Realtime: Connections, subscriptions, channels, rate limiting
    • Functions: Execution, timeouts, networking, memory limits
  • πŸš€ Core Features:

    • Simple translate() method for basic usage
    • Rich translateErrorCode() method with metadata
    • Automatic device language detection
    • Manual language setting with enum or string codes
    • Temporary language override for specific translations
    • Comprehensive error handling with 4-step fallback system
  • πŸ”§ Developer Experience:

    • Type-safe enums for languages and services
    • Comprehensive error code coverage (50+ error codes per service)
    • Rich TranslationResult class with metadata
    • Custom TranslatorException for error handling
    • Language validation and management utilities
  • πŸ§ͺ Testing & Quality:

    • 31 comprehensive tests with 100% coverage
    • Edge case handling (null values, unknown codes)
    • Model validation and enum testing
    • Fallback system testing
    • Auto-detection functionality testing
  • πŸ“– Documentation:

    • Complete API documentation with examples
    • Real-world Flutter integration examples
    • Comprehensive README with usage patterns
    • Example app demonstrating all features

Technical Details #

  • Minimum Flutter Version: 3.0.0
  • Dart SDK: >=2.17.0 <4.0.0
  • Dependencies: Only Flutter SDK (no external dependencies)
  • Platform Support: iOS, Android, Web, Desktop
  • Performance: O(1) lookup time with static translations
  • Memory Usage: Minimal - all translations are compile-time constants

Supported Error Codes #

Auth Service (25+ error codes)

  • email_not_confirmed, invalid_credentials, user_not_found, user_already_exists
  • password_too_short, password_too_weak, email_already_registered, phone_already_registered
  • invalid_phone, invalid_email, signup_disabled, email_rate_limit_exceeded
  • sms_rate_limit_exceeded, too_many_requests, phone_exists, email_exists
  • session_expired, token_expired, invalid_token, mfa_challenge_expired
  • mfa_verification_failed, provider_disabled, oauth_callback_error

Database Service (25+ error codes)

  • connection_failed, query_timeout, duplicate_key, foreign_key_violation
  • not_null_violation, check_violation, unique_violation, permission_denied
  • invalid_input, syntax_error, type_mismatch, out_of_range
  • deadlock_detected, serialization_failure, connection_limit_exceeded
  • disk_full, memory_exhausted, table_not_found, column_not_found, function_not_found

Storage Service (20+ error codes)

  • file_not_found, bucket_not_found, file_already_exists, bucket_already_exists
  • access_denied, invalid_token, file_size_exceeded, storage_quota_exceeded
  • invalid_file_type, upload_failed, download_failed, delete_failed
  • bucket_not_empty, invalid_bucket_name, database_error, internal_error

Realtime Service (20+ error codes)

  • connection_failed, websocket_error, subscription_error, channel_error
  • authorization_failed, realtime_disabled, tenant_not_found, connection_limit_exceeded
  • channel_limit_exceeded, rate_limit_exceeded, database_error, cdc_stream_error
  • replication_error, node_disconnected, migration_error, internal_error

Functions Service (15+ error codes)

  • function_not_found, execution_error, timeout_error, memory_limit_exceeded
  • permission_denied, invalid_input, network_error, internal_error
  • function_disabled, invalid_function_name, deployment_error, runtime_error

Migration Guide #

This is the initial release, so no migration is needed.

Known Limitations #

  • Languages are limited to the 9 currently supported
  • Error codes are predefined (no custom error codes yet)
  • Translation context is service-based only

Future Roadmap #

  • Additional language support (Japanese, Korean, Chinese)
  • Custom error code support
  • Integration with Flutter's Localizations
  • Contextual error messages
  • Error analytics and reporting

Thanks #

  • Flutter and Supabase communities for inspiration
  • All beta testers who provided feedback
  • Contributors who helped with translations and testing
  • bucket_not_found, file_not_found, bucket_already_exists, file_already_exists
  • file_size_limit_exceeded, invalid_file_type, permission_denied, invalid_token
  • upload_failed, download_failed, delete_failed, quota_exceeded
  • invalid_path, operation_not_supported, bucket_not_empty, invalid_bucket_name
  • file_corrupted, network_error, service_unavailable

Realtime Service

  • connection_failed, channel_not_found, subscription_failed, unauthorized
  • rate_limit_exceeded, channel_limit_exceeded, connection_limit_exceeded
  • invalid_channel_name, tenant_not_found, realtime_disabled, websocket_error
  • message_too_large, invalid_message_format, join_rate_limit, broadcast_failed
  • presence_failed, node_disconnected, migration_failed, counter_tracking_error

Functions Service

  • function_not_found, execution_failed, timeout, memory_limit_exceeded
  • invalid_input, permission_denied, rate_limit_exceeded, cold_start_timeout
  • network_error, internal_error
3
likes
145
points
34
downloads

Publisher

verified publishermrehman.co.uk

Weekly Downloads

Translate Supabase error codes into user-friendly messages in 9 languages. Perfect for international Flutter apps with automatic language detection and robust fallback system.

Repository (GitHub)
View/report issues
Contributing

Topics

#supabase #error-handling #i18n #flutter

Documentation

Documentation
API reference

Funding

Consider supporting this project:

github.com
www.buymeacoffee.com

License

MIT (license)

Dependencies

flutter, intl

More

Packages that depend on supabase_error_translator_flutter