Skip to content

mohamedchouat/Draw-with-me

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎨 DrawWithMe

πŸ“· Screenshots

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.


✨ Features

πŸ“Ή Live Camera Preview

Real-time camera feed as the base layer for tracing.

πŸ–ΌοΈ Image Overlay

Load any image from gallery and overlay it on the camera preview.

πŸ” Dual Zoom Control

  • Camera Zoom: Adjust the camera to get a 1:1 real-size view
  • Image Zoom: Scale the overlay image independently (0.5x - 3x)

🎚️ Opacity Control

Adjust overlay transparency to see both the image and paper underneath.

πŸ“ Precision Leveling

  • 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 Controls

Lock opacity, zoom, and position to prevent accidental changes while drawing.

🎯 Drag & Position

Pan and position the overlay image precisely where needed.


πŸ—οΈ Tech Stack

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

🧩 Architecture

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

Layer Responsibilities

Domain

  • Contains pure business logic
  • Defines:
    • OrientationData (sensor data model)
    • SensorServicePort (abstract interface)

Application

  • Use cases orchestrating business logic
  • UpdateOrientation manages sensor streaming

Infrastructure

  • Implements sensor service using sensors_plus
  • UI widgets and screens

Adapters

  • ARViewerPresenter - state management with ChangeNotifier
  • Bridges domain logic with UI

πŸ”‘ Setup & Installation

1️⃣ Clone the Repository

git clone https://github.com/yourusername/drawwithme.git
cd drawwithme

2️⃣ Install Dependencies

flutter pub get

3️⃣ Android Setup

Add 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" />

4️⃣ iOS Setup

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>

5️⃣ Run the App

flutter run

⚠️ Note: Run on a physical device. Camera and sensors don't work on emulators.


πŸ“ Usage

  1. Open the app - Camera preview starts automatically
  2. Tap the gallery icon - Select an image to trace
  3. Adjust camera zoom (left slider) - Get a 1:1 real-size view
  4. Adjust opacity (bottom slider) - See paper through the image
  5. Level your device - Use the balance bars to keep phone flat
  6. Drag the image - Position it exactly where needed
  7. Lock controls - Tap the lock icon to prevent accidental changes
  8. Start tracing! - Draw the contours on your paper

🎯 UI Layout

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      [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

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

🎨 Use Cases

  • 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

🀝 Contributing

Pull requests are welcome!

Before submitting, please run:

dart format .
flutter analyze

πŸ›‘οΈ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Made with ❀️ by Mohamed

About

DrawWithMe is a Flutter app that turns your phone into a live lightbox for tracing images. Overlay any gallery image on the camera preview, adjust zoom and opacity, and use device sensors for precision leveling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors