TimeProvider class
This provider manages all the time variables in the test. Its fields are:
start time and date the test was started
end time and date the test was finished
testTimer timer used to measure the test timing
limitMilliseconds duration of the test in milliseconds
isTestRunning boolean variable that determines if the test is being taken at the moment
startTime time and date the test was started. It is used for the timer and not for saving test data as start
partialTimes list of integers that saves the time taken every by the user to press a key for every symbol displayed
isTimeStarted boolean that determines if the timer has been started in the test
- Inheritance
-
- Object
- ChangeNotifier
- TimeProvider
Constructors
Properties
- elapsedMilliseconds → int
-
This getter returns the milliseconds elapsed since the beginning of the test
no setter
- end ↔ DateTime
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isTestRunning ↔ bool
-
getter/setter pair
- isTimeStarted ↔ bool
-
getter/setter pair
- limitMilliseconds ↔ int
-
getter/setter pair
-
partialTimes
↔ List<
int> -
getter/setter pair
- remaining → int
-
This getter returns the milliseconds remaining as a difference between
the duration and the elapsed time
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- start ↔ DateTime
-
getter/setter pair
- startTime ↔ DateTime
-
getter/setter pair
- testTimer ↔ Timer?
-
getter/setter pair
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
addPartialTime(
int i) → void -
Adds the argument
ito the partialTimes list and calls notifyListeners -
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
getAveragedDuration(
) → double - Returns the average of the partialTimes list
-
getStdDeviation(
) → double - Return the standard deviation of the partialTimes list
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
resetPartialTimes(
) → void - Resets partialTimes by assigning it an empty list and calls notifyListeners
-
setEndTime(
) → void - Assigns the current time and date to end and calls notifyListeners
-
setIsTimeStarted(
bool b) → void -
Assigns the argument
bto isTimeStarted and calls notifyListeners -
setStartTime(
) → void - Assigns the current time and date to start and calls notifyListeners
-
startTimer(
{required int timeLimit, required VoidCallback onFinish, required ProgressProvider pp}) → void - This function is called to start the timer when the test starts.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited