refactor: Move constructor to the top of the Benefit class for improved readability
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user