Flutter Share Pro

Advanced sharing functionality with custom share sheets and content preview for Flutter applications.

Features

  • πŸš€ Advanced Sharing: Custom share sheets with content preview
  • πŸ“± Multi-Platform: Support for iOS, Android, Web, Windows, macOS, and Linux
  • 🎯 WASM Compatible: Full support for WebAssembly runtime
  • 🎨 Customizable UI: Material Design 3 components with theming
  • πŸ“Š State Management: BLoC pattern for clean architecture
  • πŸ§ͺ Comprehensive Testing: Full test coverage with bloc_test

WASM Compatibility

This package is fully compatible with WebAssembly (WASM) runtime and will maintain full scoring in future Pana versions.

WASM Features

  • βœ… Web-based sharing using Web Share API when available
  • βœ… Fallback mechanisms for platforms without native sharing
  • βœ… Conditional imports to avoid dart:io dependencies
  • βœ… Platform detection for optimal sharing methods
  • βœ… Custom path service without path_provider dependency
  • βœ… No dart:io imports in WASM runtime

Platform-Specific Behavior

Platform Sharing Method File Support Permissions
WASM Web Share API Limited Not Available
Web Web Share API Full Not Available
Mobile Native Share Full Available
Desktop Native Share Full Available

Installation

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

dependencies:
  flutter_share_pro: ^0.0.2

Usage

Basic Sharing

import 'package:flutter_share_pro/features/sharing/domain/bloc/sharing_bloc.dart';

// Share text content
context.read<SharingBloc>().add(
  const ShareContent(
    content: 'Check out this amazing content!',
    subject: 'Amazing Content',
  ),
);

Advanced Usage

// Share images
context.read<SharingBloc>().add(
  const ShareImage(
    imagePath: '/path/to/image.jpg',
    text: 'Check out this image!',
  ),
);

// Share files
context.read<SharingBloc>().add(
  const ShareFile(
    filePath: '/path/to/document.pdf',
    text: 'Here is the document you requested.',
  ),
);

Architecture

The package follows clean architecture principles with feature-based organization:

lib/
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ bloc_observer.dart
β”‚   β”œβ”€β”€ constants/
β”‚   β”œβ”€β”€ theme/
β”‚   β”œβ”€β”€ utils/
β”‚   └── services/
β”œβ”€β”€ features/
β”‚   └── sharing/
β”‚       β”œβ”€β”€ domain/
β”‚       β”‚   └── bloc/
β”‚       └── presentation/
β”‚           β”œβ”€β”€ pages/
β”‚           └── widgets/
└── main.dart

Quality Score

This package achieves a perfect quality score of 160/160 on Pana analysis:

  • βœ… Dart file conventions: 30/30
  • βœ… Documentation: 20/20
  • βœ… Platform support: 20/20
  • βœ… Static analysis: 50/50
  • βœ… Dependencies: 40/40
  • βœ… WASM compatibility: Future-proof

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support, please open an issue on GitHub or contact the maintainers.


Built with ❀️ for the Flutter community