utils\homeFunctions library

Functions

codeIdButton(dynamic context) → void
This function is triggered when the button next to the reference code text field is pressed This button is used to edit the code (when in read only mode) or to validate the code (when not in read only mode) using checkCodeid Depending on the result that the check returns, one of the following functions is called: correctCodeId, wrongCodeId, usedCodeId The only argument is context to access the providers
correctCodeId(ButtonsProvider bp) → void
This function is called when the reference code validated is valid and has not been used.
createProfile(BuildContext context) → void
This function is executed when the "Create a new profile" button is pressed Its only argument is context in order to access the providers. The function sets PersonalDataProvider.editingMode to false and resets the text controllers and PersonalDataProvider.tempUser before navigating to the new profile screen
deleteProfile(BuildContext context) → void
When in editing mode, this function is called to delete the active user.
editProfile(BuildContext context) → void
This function is executed when the "View my profile" button is pressed Its only argument is context in order to access the providers. The function sets PersonalDataProvider.editingMode to true and assigns the active user to PersonalDataProvider.tempUser before navigating to the new profile screen
saveProfile(BuildContext context) → void
This function is called when the save button is pressed in the new profile screen.
startTest(BuildContext context) → void
This function is called when the trial test is to be started. The only argument is the context so that the function can access the providers. When the function is executed, it navigates to the CountdownScreen, to whom it passes a series of instructions to execute when the countdown finishes. These instructions reset a series of control variables, shuffle the symbols, start the timer and pops the TestScreen.
usedCodeId(ButtonsProvider bp, BuildContext context) → void
This function is called when the reference code is correct but has already been used.
wrongCodeId(ButtonsProvider bp, BuildContext context) → void
This function is called when the validated reference code is not valid.