A Flutter desktop application with functionalities for capturing screenshots and headshots using native Swift code.
- Introduction
- Features
- Technologies Used
- Prerequisites
- Setup
- Usage
- Project Structure
- Troubleshooting
- Contributing
- License
The flutter_desktop_app
is a desktop application built using Flutter. It leverages native Swift code to capture screenshots and headshots. The app is structured using the Bloc architecture for state management, providing a clean and maintainable codebase.
- Capture screenshots of the entire screen.
- Capture headshots using the device's camera.
- Flutter
- Bloc State Management
- freezed
- Swift (for native code)
Before you begin, ensure you have met the following requirements:
- Flutter installed on your machine
- Xcode (for macOS development)
- Cocoapods (for managing native dependencies)
Follow these steps to set up and run the project:
git clone https://github.com/mimi-tech/flutter_desktop_capturing_app
cd flutter_desktop_app
flutter pub get
open terminal run flutter pub run build_runner build --delete-conflicting-outputs
Open the macOS project workspace with Xcode using the following command:
open macos/Runner.xcworkspace
- In Xcode, navigate to the
Runner
project. - Select the
Runner
target. - Change the Minimum Deployment target to
10.15
to accommodate AVFoundation import.
-
Open the
macos/Podfile
file. -
Change the platform line from:
platform :osx, '10.13'
to:
platform :osx, '10.15'
-
Run
pod install
to update the CocoaPods dependencies.
The app automatically request for camera permission but if your IDE (IntelliJ or VSCode) ensure that your application has the necessary permissions to access the camera:
- Open System Preferences.
- Go to Security & Privacy.
- Navigate to the Privacy tab.
- Select Camera.
- Ensure your IDE (IntelliJ or VSCode) and the application have permission to access the camera.
Navigate back to the root of the Flutter project and run the app:
flutter run
Once the application is running, you can use the provided UI to capture screenshots and headshots.
lib/
: Contains the Dart source code, including the Bloc implementation.macos/
: Contains the macOS-specific code, including the Swift native code for capturing images.
- MissingPluginException: Ensure that the method channels are correctly set up and that the native code is correctly registered.
- Camera Access Denied: Verify that the application and IDE have camera permissions in System Preferences.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.