| Sample |
|---|
![]() |
DrawWithMe is a modern Flutter application designed to help artists and hobbyists trace images onto paper using their phone's camera as a lightbox. The app overlays any image from your gallery onto the live camera feed, allowing you to trace contours with precision.
The project is built following Clean Architecture principles using Provider for scalable, testable state management.
Real-time camera feed as the base layer for tracing.
Load any image from gallery and overlay it on the camera preview.
- Camera Zoom: Adjust the camera to get a 1:1 real-size view
- Image Zoom: Scale the overlay image independently (0.5x - 3x)
Adjust overlay transparency to see both the image and paper underneath.
- Horizontal Balance Bar: Shows device tilt left/right
- Vertical Balance Bar: Shows device tilt forward/backward
- Real-time sensor values: Roll and pitch in degrees
- Level Indicator: Green "LEVEL" badge when perfectly flat
Lock opacity, zoom, and position to prevent accidental changes while drawing.
Pan and position the overlay image precisely where needed.
| Category | Technology | Purpose |
|---|---|---|
| Language | Dart / Flutter | Cross-platform mobile app |
| Architecture | Clean Architecture | Scalability & testability |
| State Management | Provider | Robust & compile-time safe |
| Camera | camera | Live camera preview |
| Sensors | sensors_plus | Gyroscope & accelerometer |
| Image Selection | image_picker | Gallery access |
| Permissions | permission_handler | Camera permissions |
lib/
βββ features/
β βββ ar_viewer/
β βββ adapters/
β β βββ ar_viewer_presenter.dart
β βββ application/
β β βββ ports/
β β β βββ sensor_service_port.dart
β β βββ usecases/
β β βββ update_orientation.dart
β βββ domain/
β β βββ orientation_data.dart
β βββ infrastructure/
β βββ services/
β β βββ sensor_service_impl.dart
β βββ widgets/
β βββ ar_viewer_screen.dart
βββ widgets/
β βββ control_panel.dart
β βββ horizontal_balance_bar.dart
β βββ vertical_balance_bar.dart
βββ injections.dart
βββ main.dart
- Contains pure business logic
- Defines:
OrientationData(sensor data model)SensorServicePort(abstract interface)
- Use cases orchestrating business logic
UpdateOrientationmanages sensor streaming
- Implements sensor service using
sensors_plus - UI widgets and screens
ARViewerPresenter- state management with ChangeNotifier- Bridges domain logic with UI
git clone https://github.com/yourusername/drawwithme.git
cd drawwithmeflutter pub getAdd camera permission to android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />Add to ios/Runner/Info.plist:
<key>NSCameraUsageDescription</key>
<string>Camera access is required for tracing</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo library access is required to select images</string>flutter run
β οΈ Note: Run on a physical device. Camera and sensors don't work on emulators.
- Open the app - Camera preview starts automatically
- Tap the gallery icon - Select an image to trace
- Adjust camera zoom (left slider) - Get a 1:1 real-size view
- Adjust opacity (bottom slider) - See paper through the image
- Level your device - Use the balance bars to keep phone flat
- Drag the image - Position it exactly where needed
- Lock controls - Tap the lock icon to prevent accidental changes
- Start tracing! - Draw the contours on your paper
βββββββββββββββββββββββββββββββββββββββ
β [Horizontal Balance Bar] β β Top
β β LEVEL β
ββββββ¬ββββββββββββββββββββββββββββ¬βββββ€
β β β β
β C β β V β
β A β CAMERA PREVIEW β E β
β M β + β R β
β β IMAGE OVERLAY β T β
β Z β β β
β O β β B β
β O β β A β
β M β β R β
β β β β
ββββββ΄ββββββββββββββββββββββββββββ΄βββββ€
β [π·] [π] [Opacity] [Zoom] [β»] β β Bottom
βββββββββββββββββββββββββββββββββββββββ
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.8
provider: ^6.1.2
camera: ^0.11.0+2
sensors_plus: ^6.1.1
image_picker: ^1.1.2
permission_handler: ^11.3.1
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^6.0.0- Sketching: Trace photos onto paper
- Calligraphy: Copy lettering with precision
- Technical Drawing: Transfer diagrams accurately
- Art Projects: Outline complex images
- Learning: Practice drawing by tracing
Pull requests are welcome!
Before submitting, please run:
dart format .
flutter analyzeThis project is licensed under the MIT License.
Made with β€οΈ by Mohamed
