electric_digital_sketch 1.0.3 copy "electric_digital_sketch: ^1.0.3" to clipboard
electric_digital_sketch: ^1.0.3 copied to clipboard

Offline-first Flutter package for drawing, annotating and exporting electrical network sketches.

electric_digital_sketch #

Offline-first Flutter package for drawing, annotating and exporting electrical network sketches.

This package provides a ready-to-use editor page built on top of simple_painter, with workflows focused on electrical design and field sketching.

Features #

  • Freehand drawing and erase tools
  • Selection, layer management, undo and redo
  • Electrical network line mode with specialized line styles
  • Geometric shapes and grouped electrical symbols
  • Text insertion and editing
  • Location and description metadata for custom electrical items
  • Result preview with share/export flow
  • Confirmation callback that returns the generated image file

Included editor tools #

  • SketchMode.select
  • SketchMode.brush
  • SketchMode.erase
  • SketchMode.changes
  • SketchMode.text
  • SketchMode.shapes
  • SketchMode.layers
  • SketchMode.redes

The package also includes grouped electrical symbols such as:

  • transformers
  • poles
  • switches
  • grounding items
  • surge protection items

Installation #

Add the package to your pubspec.yaml:

dependencies:
  electric_digital_sketch: ^1.0.0

Then run:

flutter pub get

Basic usage #

The package exports a single entry-point:

import 'package:electric_digital_sketch/electric_digital_sketch.dart';

Use ElectricSketchPage as a full-screen editor:

import 'dart:io';

import 'package:electric_digital_sketch/electric_digital_sketch.dart';
import 'package:flutter/material.dart';

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: ElectricSketchPage(
        onConfirm: (File imageFile) async {
          debugPrint('Generated image: ${imageFile.path}');
        },
      ),
    );
  }
}

To start the editor with an existing image as the background:

import 'dart:io';

Widget build(BuildContext context) {
  return ElectricSketchPage(
    initialBackgroundImage: File('/path/to/sketch-base.png'),
    onConfirm: (file) async {
      // Handle the generated PNG file.
    },
  );
}

Export and confirmation flow #

When the user opens the result preview:

  • the editor renders the current sketch as a PNG file
  • the result page shows the generated image
  • the user can share/save the file
  • if onConfirm is provided, the page exposes confirm action and returns the generated File

Example:

Widget build(BuildContext context){
  return ElectricSketchPage(
    onConfirm: (file) async {
      // Upload, persist or attach the final PNG file.
    },
  );
}

Platform behavior #

  • Android and iOS: result export uses the native share sheet
  • Desktop platforms: result export uses a native save dialog

Current public API #

Main public types:

  • ElectricSketchPage
  • ElectricSketchController
  • SketchMode
  • LineStyle
  • ElectricShapeType
  • LocationService

Example project #

An example app is included in example/.

Run it with:

flutter run -d <device>

Notes #

  • The package is designed around an editor page, not a low-level drawing API.
  • Internal widgets and controllers may evolve, but ElectricSketchPage is the intended integration point for consumers.
  • Location-related features depend on platform permission configuration in the host app.

License #

This project is licensed under the MIT License.

1
likes
150
points
49
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Offline-first Flutter package for drawing, annotating and exporting electrical network sketches.

Repository (GitHub)
View/report issues

Topics

#electrical #drawing #editor #sketch

License

MIT (license)

Dependencies

collection, electric_shapes, file_selector, flutter, geolocator, mb_color_picker, phosphor_flutter, share_plus, simple_painter, tabler_icons_plus, universal_io

More

Packages that depend on electric_digital_sketch