Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-deriv committed Dec 16, 2024
1 parent bfc3984 commit d58bf98
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 2 additions & 0 deletions lib/src/add_ons/drawing_tools_ui/drawing_tool_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ abstract class DrawingToolConfig extends AddOnConfig {
return HorizontalDrawingToolConfig.fromJson(json);
case LineDrawingToolConfig.name:
return LineDrawingToolConfig.fromJson(json);
case LineDrawingToolConfigMobile.name:
return LineDrawingToolConfigMobile.fromJson(json);
case RayDrawingToolConfig.name:
return RayDrawingToolConfig.fromJson(json);
case RectangleDrawingToolConfig.name:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class LineDrawingToolConfigMobile extends DrawingToolConfig {
this.lineStyle = const LineStyle(
thickness: 0.9,
color: BrandColors.coral,
markerRadius: 4,
),
this.overlayStyle,
this.pattern = DrawingPatterns.solid,
Expand Down Expand Up @@ -72,7 +71,7 @@ class LineDrawingToolConfigMobile extends DrawingToolConfig {
);

@override
LineDrawingToolConfig copyWith({
LineDrawingToolConfigMobile copyWith({
String? configId,
DrawingData? drawingData,
LineStyle? lineStyle,
Expand All @@ -83,7 +82,7 @@ class LineDrawingToolConfigMobile extends DrawingToolConfig {
bool? enableLabel,
int? number,
}) =>
LineDrawingToolConfig(
LineDrawingToolConfigMobile(
configId: configId ?? this.configId,
drawingData: drawingData ?? this.drawingData,
lineStyle: lineStyle ?? this.lineStyle,
Expand All @@ -102,7 +101,7 @@ class LineDrawingToolConfigMobile extends DrawingToolConfig {
return null;
} else {
return MobileLineDrawingToolLabelPainter(
const LineDrawingToolConfig(),
const LineDrawingToolConfigMobile(),
startPoint: startPoint,
endPoint: endPoint,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:deriv_chart/src/add_ons/indicators_ui/widgets/color_selector.dar
import 'package:deriv_chart/src/deriv_chart/chart/data_visualization/drawing_tools/data_model/drawing_pattern.dart';
import 'package:deriv_chart/src/theme/painting_styles/line_style.dart';
import 'package:flutter/material.dart';
import 'line_drawing_tool_config.dart';
import '../callbacks.dart';

/// Line drawing tool item in the list of drawing tools
Expand Down Expand Up @@ -69,8 +68,8 @@ class LineDrawingToolItemMobileState
);

LineStyle get _currentLineStyle =>
_lineStyle ?? (widget.config as LineDrawingToolConfig).lineStyle;
_lineStyle ?? (widget.config as LineDrawingToolConfigMobile).lineStyle;

DrawingPatterns get _currentPattern =>
_pattern ?? (widget.config as LineDrawingToolConfig).pattern;
_pattern ?? (widget.config as LineDrawingToolConfigMobile).pattern;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ abstract class LineDrawingToolLabelPainter extends DrawingToolLabelPainter {
}) : super(lineDrawingToolConfig);

/// Line drawing tool config.
final LineDrawingToolConfig lineDrawingToolConfig;
late final dynamic lineDrawingToolConfig;

/// Start point.
final Point startPoint;
Expand Down

0 comments on commit d58bf98

Please sign in to comment.