From 9d8a5e66854a4fd81fdd8d3eb00a0b5c1110d877 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 6 Feb 2025 11:50:23 -0700 Subject: [PATCH] Add more frequencies. --- lib/models/frequency.dart | 53 ++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/lib/models/frequency.dart b/lib/models/frequency.dart index d80de09..7585b8c 100644 --- a/lib/models/frequency.dart +++ b/lib/models/frequency.dart @@ -1,12 +1,53 @@ // https://www.tutorialspoint.com/dart_programming/dart_programming_enumeration.htm enum Frequency { - daily(title: "Daily"), - weekly(title: "Weekly"), - biweekly(title: "Biweekly"), - montly(title: "Monthly"), - yearly(title: "Yearly"); + daily( + title: "Daily", + hint: "Once Per Day", + timesPerYear: 364.25, + ), + weekly( + title: "Weekly", + hint: "Once Per Week", + timesPerYear: (364.25/7), + ), + biweekly( + title: "Biweekly", + hint: "Every Other Week", + timesPerYear: (364.25/7/2), + ), + bimonthly( + title: "Bimonthly", + hint: "Twice Per Month", + timesPerYear: 24, + ), + montly( + title: "Monthly", + hint: "Once Per Month", + timesPerYear: 12, + ), + quarterly( + title: "Quarterly", + hint: "Every Three Months", + timesPerYear: 4, + ), + biannual( + title: "Biannual", + hint: "Twice Per Year", + timesPerYear: 2, + ), + yearly( + title: "Yearly", + hint: "Once Per Year", + timesPerYear: 1, + ); - const Frequency({required this.title}); + const Frequency({ + required this.title, + required this.hint, + required this.timesPerYear, + }); final String title; + final String hint; + final double timesPerYear; }