A cross-platform mobile clipboard history manager built with Flutter, supporting both iOS and Android with advanced background monitoring, robust logging, and error handling capabilities.
- Real-time clipboard monitoring
- Background clipboard tracking on both Android and iOS
- Comprehensive logging system
- Detailed error handling and reporting
- Local storage of clipboard history
- Search functionality
- Copy and delete individual clipboard entries
- Clear entire clipboard history
- Timestamp for each clipboard entry
debug
: Detailed information for troubleshootinginfo
: General operational eventswarning
: Potential issues that don't prevent functionalityerror
: Recoverable errorscritical
: Severe errors that may impact application stability
- Logs are stored in the application's documents directory
- Log files are rotated when they exceed 5MB
- Supports console and file-based logging
- Configurable log levels
Logs can be retrieved programmatically for debugging or user support.
- Comprehensive try/catch blocks
- Graceful error recovery
- Detailed error logging with stack traces
- User-friendly error notifications
- Uses foreground service for persistent clipboard monitoring
- Leverages
ClipboardManager
to detect clipboard changes - Runs as a foreground service to improve reliability
- Utilizes background fetch and periodic checking
- Checks clipboard content at regular intervals
- Respects iOS background task limitations
clipboard_manager/
├── lib/
│ ├── core/
│ │ ├── clipboard_service.dart
│ │ ├── history_manager.dart
│ │ ├── logger.dart
│ │ ├── platform_channel_service.dart
│ │ └── shared_prefs_service.dart
│ ├── models/
│ │ └── clipboard_item.dart
│ ├── providers/
│ │ └── clipboard_provider.dart
│ └── ui/
│ ├── screens/
│ │ └── home_screen.dart
│ └── widgets/
│ └── clipboard_list_item.dart
└── pubspec.yaml
- Flutter SDK
provider
for state managementclipboard
for clipboard interactionsshared_preferences
for local storageuuid
for unique item identificationintl
for timestamp formattingpath_provider
for log file managementpermission_handler
for runtime permissions
- Ensure Flutter SDK is installed
- Clone the repository
- Run
flutter pub get
- Connect a device or start an emulator
- Run
flutter run
- App automatically tracks clipboard content in the background
- Search through clipboard history
- Tap the copy icon to restore a previous clipboard entry
- Tap the delete icon to remove a specific entry
- Use the clear all button to reset clipboard history
final logger = Logger();
final logs = await logger.getLogs(); // Retrieve logs
await logger.clearLogs(); // Clear log file
- Background clipboard monitoring has platform-specific restrictions
- iOS background monitoring is less consistent due to system limitations
- Battery and performance impact may vary
Contributions are welcome! Please submit pull requests or open issues on the repository.
- Enhanced error handling
- More advanced search functionality
- Customizable background monitoring preferences
- Comprehensive testing
- Improved platform-specific background task management
- Advanced log filtering and export