refactor: Move constructor to the top of the Benefit class for improved readability

This commit is contained in:
Achintha Isuru
2026-03-03 21:26:48 -05:00
parent 65ac22953e
commit 6d9cb64487

View File

@@ -2,6 +2,13 @@ import 'package:equatable/equatable.dart';
/// Represents a staff member's benefit balance.
class Benefit extends Equatable {
/// Creates a [Benefit].
const Benefit({
required this.title,
required this.entitlementHours,
required this.usedHours,
});
/// The title of the benefit (e.g., Sick Leave, Holiday, Vacation).
final String title;
@@ -14,13 +21,6 @@ class Benefit extends Equatable {
/// The hours remaining.
double get remainingHours => entitlementHours - usedHours;
/// Creates a [Benefit].
const Benefit({
required this.title,
required this.entitlementHours,
required this.usedHours,
});
@override
List<Object?> get props => [title, entitlementHours, usedHours];
}