Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed May 19, 2024
2 parents 8d4a37a + aa52e41 commit 9b3ab7a
Show file tree
Hide file tree
Showing 17 changed files with 564 additions and 331 deletions.
36 changes: 23 additions & 13 deletions lib/data/models/company_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1456,23 +1456,21 @@ abstract class RegistrationFieldEntity
abstract class DashboardField
implements Built<DashboardField, DashboardFieldBuilder> {
factory DashboardField({
String? field,
String? period,
String? type,
required String field,
required String period,
String? calculate,
String? format,
}) {
return _$DashboardField._(
field: field ?? '',
period: period ?? '',
type: type ?? TYPE_SUM,
field: field,
period: period,
calculate: calculate ?? DashboardUISettings.CALCULATE_SUM,
format: format ?? DashboardUISettings.FORMAT_MONEY,
);
}

DashboardField._();

static const TYPE_SUM = 'sum';
static const TYPE_COUNT = 'count';
static const TYPE_AVERAGE = 'average';

@override
@memoized
int get hashCode;
Expand All @@ -1481,11 +1479,23 @@ abstract class DashboardField

String get period;

String get type;
String get format;

String get calculate;

bool get isTimeFormat => format == DashboardUISettings.FORMAT_TIME;

bool get isSumCalculate => calculate == DashboardUISettings.CALCULATE_SUM;

bool get isAverageCalculate =>
calculate == DashboardUISettings.CALCULATE_AVERAGE;

bool get isCountCalculate => calculate == DashboardUISettings.CALCULATE_COUNT;

// ignore: unused_element
static void _initializeBuilder(DashboardFieldBuilder builder) =>
builder..type = TYPE_SUM;
static void _initializeBuilder(DashboardFieldBuilder builder) => builder
..format = DashboardUISettings.FORMAT_MONEY
..calculate = DashboardUISettings.CALCULATE_SUM;

static Serializer<DashboardField> get serializer =>
_$dashboardFieldSerializer;
Expand Down
57 changes: 41 additions & 16 deletions lib/data/models/company_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions lib/redux/app/app_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ class UpdateLastHistory implements PersistUI {
final int page;
}

class DismissFlutterWebWarning implements PersistUI {}

class DismissFlutterWebWarningPermanently implements PersistUI, PersistPrefs {}

class DismissGatewayWarningPermanently implements PersistUI, PersistPrefs {}

class DismissReviewAppPermanently implements PersistUI, PersistPrefs {}
Expand Down
4 changes: 4 additions & 0 deletions lib/redux/app/app_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
bool get showTwoYearReviewApp =>
!prefState.hideTwoYearReviewApp && company.daysActive > 730;

Color get greyColor => prefState.enableDarkMode
? convertHexStringToColor('#AAAAAA')!
: convertHexStringToColor('#666666')!;

Color? get linkColor => prefState.enableDarkMode
? convertHexStringToColor('#FFFFFF')
: accentColor;
Expand Down
Loading

0 comments on commit 9b3ab7a

Please sign in to comment.