Skip to content

Commit

Permalink
chore: linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adil192 committed Oct 20, 2023
1 parent a6502ac commit 763c886
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions lib/components/canvas/_rectangle_stroke.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,4 @@ class RectangleStroke extends Stroke {
penType: penType,
rect: rect,
);

// TODO(adil192): Add HighlighterStroke class and move canvas drawing logic to Stroke.
}
2 changes: 0 additions & 2 deletions lib/data/tools/select.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:saber/components/canvas/_circle_stroke.dart';
import 'package:saber/components/canvas/_editor_image.dart';
import 'package:saber/components/canvas/_rectangle_stroke.dart';
import 'package:saber/components/canvas/_stroke.dart';

import 'package:saber/data/tools/_tool.dart';
Expand Down
8 changes: 7 additions & 1 deletion lib/data/tools/shape_pen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:interactive_shape_recognition/interactive_shape_recognition.dart';
import 'package:logging/logging.dart';
import 'package:saber/components/canvas/_circle_stroke.dart';
import 'package:saber/components/canvas/_rectangle_stroke.dart';
import 'package:saber/components/canvas/_stroke.dart';
Expand All @@ -25,6 +26,8 @@ class ShapePen extends Pen {

static Pen currentShapePen = ShapePen();

static final log = Logger('ShapePen');

static const IconData shapePenIcon = FontAwesomeIcons.shapes;

static DetectedShape? detectedShape;
Expand Down Expand Up @@ -58,8 +61,10 @@ class ShapePen extends Pen {

switch (detectedShape.shape) {
case Shape.unknown:
log.info('Detected unknown shape');
return rawStroke;
case Shape.line:
log.info('Detected line: ${detectedShape.firstPoint} -> ${detectedShape.lastPoint}');
return Stroke(
strokeProperties: rawStroke.strokeProperties,
pageIndex: rawStroke.pageIndex,
Expand All @@ -71,7 +76,7 @@ class ShapePen extends Pen {
..isComplete = true;
case Shape.rectangle:
final rect = detectedShape.generateRectangle();
print('rect: $rect');
log.info('Detected rectangle: $rect');
return RectangleStroke(
strokeProperties: rawStroke.strokeProperties,
pageIndex: rawStroke.pageIndex,
Expand All @@ -80,6 +85,7 @@ class ShapePen extends Pen {
);
case Shape.circle:
final circle = detectedShape.generateCircle();
log.info('Detected circle: $circle');
return CircleStroke(
strokeProperties: rawStroke.strokeProperties,
pageIndex: rawStroke.pageIndex,
Expand Down

0 comments on commit 763c886

Please sign in to comment.