Frequency class Null safety

this module would ideally be used in healthcare apps context as it was built with that in mind this class is the central class of the module, user is advised to interact only with it. user objective is to successfully instantiate an instance of this class for the frequency desired, then user can call instance method getNextFreq() to get a string represents the next date time occurrence of this frequency. you can use it in two ways: 1- build from FHIR resource according to the guideline defined here http://www.hl7.org/fhir/datatypes.html#Timing passing a fhir Timing.repeat Map to the static class method Frequency.BuildFromFHIRRepeat(Map<String, dynamic> fhirMap, String fallback_text) 2- create custom frequencies using this class constructors:

  • once frequency constructor: creates a once only occurence frequency Frequency My_frequncy=Frequency.Once("my frequency name");
  • dynamic frequency constructor: creates a frequency with occureances dynamically set taking DateTime.now() time as starting point. Frequency My_frequncy=Frequency.Dynamic("my frequency name","Day" ,3); will yield a frequency of 3 occureances every day with now time as starting point
  • static frequency constructor: creates a frequency with occureances statically set by user. Frequency My_frequncy=Frequency.Static("my frequency name","Day", "02:00","10:00", "18:00");

supported intervals for both dynamic and static frequencies are "Day", "Week", "Month", "Year"

Constructors

Frequency(String pName, bool pIsOnce, bool pIsDynamic, int pTimesPerDay, int pTimesPerWeek, int pTimesPerMonth, int pTimesPerYear, List<String> pHoursAtDay, List<String> pDaysAtWeek, List<String> pDaysAtMonth, List<String> pDaysAtYear)
Frequency.Dynamic(String pName, String pInterval, int pTimesPerInterval)
dynamic occureance frequency constructor
Frequency.Once(String pName)
single occureance frequency constructor
Frequency.Static(String pName, String pPeriod, List<String> pListOfTimesAtPeriod)
static occureance frequency constructor
Frequency.Text(String pName)
frequency as Text notion

Properties

daysAtMonth List<String>?
read / write
daysAtWeek List<String>?
read / write
daysAtYear List<String>?
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
hoursAtDay List<String>?
static timings
read / write
isDynamic bool
dynamic calculation -- no specific timing
read / write
isOnce bool
read / write
isStatic bool
read-only
isText bool
read / write
name String?
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
timesPerDay int?
read / write
timesPerMonth int?
read / write
timesPerWeek int?
read / write
timesPerYear int?
read / write

Methods

getNextFreq(DateTime zerPoint) String
will return a string of the next date time of the frequency occureance
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Methods

BuildFromFHIRRepeat(Map<String, dynamic> fhirTiming, String fhirFreqText) Frequency
build a Frequency object from a FHIR Timing.repeat Map