-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a51b632
commit 6719136
Showing
3 changed files
with
79 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 38 additions & 7 deletions
45
packages/deriv_mobile_chart_wrapper/lib/src/models/indicator_tab_label.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,40 @@ | ||
/// A class to define label of indicators chip. | ||
class IndicatorTabLabel { | ||
import 'package:deriv_mobile_chart_wrapper/src/enums.dart'; | ||
|
||
/// An enum to define label of indicators chip. | ||
enum IndicatorTabLabel { | ||
active, | ||
all, | ||
momentum, | ||
volatility, | ||
movingAverages; | ||
|
||
static String activeCount(int count) => 'Active ($count)'; | ||
static const String active = 'Active'; | ||
static const String all = 'All'; | ||
static const String momentum = 'Momentum'; | ||
static const String volatility = 'Volatility'; | ||
static const String movingAverages = 'Moving averages'; | ||
|
||
String get title { | ||
switch (this) { | ||
case IndicatorTabLabel.active: | ||
return 'Active'; | ||
case IndicatorTabLabel.all: | ||
return 'All'; | ||
case IndicatorTabLabel.momentum: | ||
return 'Momentum'; | ||
case IndicatorTabLabel.volatility: | ||
return 'Volatility'; | ||
case IndicatorTabLabel.movingAverages: | ||
return 'Moving averages'; | ||
} | ||
} | ||
|
||
IndicatorCategory? get toIndicatorCategory { | ||
switch (this) { | ||
case IndicatorTabLabel.momentum: | ||
return IndicatorCategory.momentum; | ||
case IndicatorTabLabel.volatility: | ||
return IndicatorCategory.volatility; | ||
case IndicatorTabLabel.movingAverages: | ||
return IndicatorCategory.movingAverages; | ||
default: | ||
return null; | ||
} | ||
} | ||
} |