Skip to content

Commit

Permalink
ramin/fix_worm_chart (#284)
Browse files Browse the repository at this point in the history
* fix: set initial rightIndex to point to the end of the ticks

* format files
  • Loading branch information
ramin-deriv authored Dec 14, 2023
1 parent 8397dea commit f7f96bc
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,11 @@ class MACDIndicatorItemState extends IndicatorItemState<MACDIndicatorConfig> {

// TODO(Ramin): Add generic type to avoid casting.
int get _currentSlowMAPeriod =>
_slowMAPeriod ??
(widget.config as MACDIndicatorConfig).slowMAPeriod;
_slowMAPeriod ?? (widget.config as MACDIndicatorConfig).slowMAPeriod;

int get _currentFastMAPeriod =>
_fastMAPeriod ??
(widget.config as MACDIndicatorConfig).fastMAPeriod;
_fastMAPeriod ?? (widget.config as MACDIndicatorConfig).fastMAPeriod;

int get _currentSignalPeriod =>
_signalPeriod ??
(widget.config as MACDIndicatorConfig).signalPeriod;
_signalPeriod ?? (widget.config as MACDIndicatorConfig).signalPeriod;
}
2 changes: 1 addition & 1 deletion lib/src/add_ons/indicators_ui/roc/roc_indicator_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ROCIndicatorItem extends IndicatorItem {
required UpdateIndicator updateIndicator,
required VoidCallback deleteIndicator,
Key? key,
ROCIndicatorConfig config=const ROCIndicatorConfig(),
ROCIndicatorConfig config = const ROCIndicatorConfig(),
}) : super(
key: key,
title: 'ROC',
Expand Down
28 changes: 14 additions & 14 deletions lib/src/add_ons/indicators_ui/widgets/field_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ class FieldWidget extends StatelessWidget {

@override
Widget build(BuildContext context) => Row(
children: <Widget>[
Text(label, style: const TextStyle(fontSize: 10)),
const SizedBox(width: 4),
SizedBox(
width: 20,
child: TextFormField(
style: const TextStyle(fontSize: 10),
initialValue: initialValue,
keyboardType: TextInputType.number,
onChanged: onValueChanged,
),
),
],
);
children: <Widget>[
Text(label, style: const TextStyle(fontSize: 10)),
const SizedBox(width: 4),
SizedBox(
width: 20,
child: TextFormField(
style: const TextStyle(fontSize: 10),
initialValue: initialValue,
keyboardType: TextInputType.number,
onChanged: onValueChanged,
),
),
],
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class AlligatorOptions extends IndicatorOptions {
this.jawPeriod = 13,
this.teethPeriod = 8,
this.lipsPeriod = 5,
this.showLines=true,
this.showFractal=false,
this.showLines = true,
this.showFractal = false,
}) : super();

/// Smoothing period for jaw series
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ class MAEnvOptions extends MAOptions {
final ShiftType shiftType;

@override
List<Object> get props => super.props..add(shift)..add(shiftType);
List<Object> get props => super.props
..add(shift)
..add(shiftType);
}
2 changes: 1 addition & 1 deletion lib/src/deriv_chart/chart/worm_chart/worm_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class _WormChartState extends State<WormChart>
_rightIndexAnimationController = AnimationController.unbounded(
vsync: this,
duration: widget.updateAnimationDuration,
value: 1,
value: widget.ticks.length.toDouble() + 1,
);
}

Expand Down
3 changes: 1 addition & 2 deletions lib/src/theme/chart_default_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ abstract class ChartDefaultTheme implements ChartTheme {
);

@override
EntrySpotStyle get entrySpotStyle =>
const EntrySpotStyle();
EntrySpotStyle get entrySpotStyle => const EntrySpotStyle();

@override
HorizontalBarrierStyle get horizontalBarrierStyle => HorizontalBarrierStyle(
Expand Down
1 change: 1 addition & 0 deletions test/benchmark/benchmark.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit f7f96bc

Please sign in to comment.