The Trainer's Stopwatch app leverages the Flutter framework and the Bloc (Business Logic Component) pattern to manage the stopwatch's state and facilitate the implementation of complex functionalities. The structure based on events and states allows for robust control logic, which is essential for ensuring the stopwatch's accuracy under various conditions.
The app's architecture is divided into different layers to separate concerns and improve code maintainability. Below is a breakdown of the key implementations and their respective functionalities:
-
stopwatch_bloc.dart: This file contains the main stopwatch logic, implemented using the Bloc pattern. It manages different events such as starting, pausing, resetting, logging a lap or a split, and stopping the stopwatch. The Bloc uses a Timer to periodically update the training time, ensuring precision even if there are delays in the graphical interface. The use of ValueNotifier allows efficient UI updates when the time or counters change.
-
stopwatch_events.dart: Defines the various events that the stopwatch can receive. Each event corresponds to a specific user action, such as starting or pausing the stopwatch.
-
stopwatch_state.dart: Defines the different states of the stopwatch. Using states like StopwatchStateInitial, StopwatchStateRunning, StopwatchStatePaused, and StopwatchStateReset facilitates UI management by activating only the relevant buttons based on the current state.
-
precise_stopwatch_controller.dart: This class acts as a controller for the precise stopwatch logic. It integrates with the StopwatchBloc and manages training sessions and history, using models such as UserModel, TrainingModel, and HistoryModel. The class provides methods to start, pause, reset, log laps and splits, and stop the stopwatch. It also handles creating and inserting training sessions and managing the time history.
-
The controller also implements methods to send messages and log records to the user, using a ValueNotifier to notify the UI about changes in the action state.
-
precise_stopwatch.dart: This widget implements an instance of the PreciseStopwatch, utilizing the PreciseStopwatchController to handle stopwatch actions and control logic.
-
Custom Widgets: The
widgets
folder contains custom UI components such as counter_row.dart, lap_split_counters.dart, stopwatch_button_bar.dart, stopwatch_display.dart, and user_image_name.dart, which provide a user-friendly and responsive interface for the end-user.
The app utilizes a combination of State Management with Bloc, Value Notifiers, and Timers to ensure stopwatch accuracy and a smooth user experience. The modular design and separation of responsibilities between logic control, user interface, and data handling make the app easy to maintain and expand.
The Trainer's Stopwatch not only allows the timing of multiple athletes simultaneously on a single device but also stores performance data for future analysis, making it a valuable tool for trainers and coaches looking to optimize training regimens and improve athlete performance.
Transitioned entire project to GPLv3 license and applied code updates.
This commit includes the following changes:
-
LICENSE
- Added new
LICENSE
file with GNU General Public License v3 details.
- Added new
-
Source Files
- Added GPLv3 license header to all source files.
-
lib/features/settings/settings_page.dart
- Replaced deprecated
onPopInvoked
withonPopInvokedWithResult
.
- Replaced deprecated
-
lib/features/stopwatch_page/stopwatch_overlay.dart
- Replaced
ButtonBar
withOverflowBar
to handle button alignment more effectively.
- Replaced
-
lib/features/trainings_page/trainings_page.dart
- Updated from
ButtonBar
toOverflowBar
for improved button handling.
- Updated from
-
lib/features/users_page/users_page.dart
- Replaced deprecated
onPopInvoked
withonPopInvokedWithResult
.
- Replaced deprecated
-
lib/features/widgets/edit_training_dialog/edit_training_dialog.dart
- Updated
ButtonBar
toOverflowBar
.
- Updated
-
lib/features/widgets/precise_stopwatch/widgets/stopwatch_button_bar.dart
- Changed multiple instances of
ButtonBar
toOverflowBar
for better UI management.
- Changed multiple instances of
These changes not only transition the project to the GPLv3 license but also include minor code updates for improved functionality and compatibility with Flutter's latest practices.
Simplified code and updated image handling logic after evaluating the necessity of adding a provider.
Details:
-
AndroidManifest.xml
:- Enabled
OnBackInvokedCallback
by settingandroid:enableOnBackInvokedCallback="true"
in the application tag.
- Enabled
-
app_settings.dart
:- Added a blank line for code readability.
-
stopwatch_page.dart
:- Renamed
_controller.stopwatchList
to_controller.stopwatchs
for consistency. - Updated the usage of
stopwatchs
instead ofstopwatchList
.
- Renamed
-
stopwatch_page_controller.dart
:- Renamed
_stopwatchList
to_stopwatchs
. - Removed
_stopwatchControllers
as they were not needed. - Updated the logic to use
stopwatchs
instead ofstopwatchList
.
- Renamed
This commit refines the codebase by removing unnecessary elements and renaming variables for consistency. It includes enabling a new Android feature and incrementing the application version to reflect these changes.
Bug fix: Corrected image path handling and incremented app version.
Details:
-
File
app_info.dart
:- Incremented app version from
1.0.0+33
to1.0.2+35
.
- Incremented app version from
-
File
constants.dart
:- Added a new constant
usersImages
to centralize the image directory name.
- Added a new constant
-
File
app_settings.dart
:- Updated the
_imagePath
initialization to use the newusersImages
constant for directory naming.
- Updated the
-
File
users_page_controller.dart
:- Refactored image directory path to use the
usersImages
constant for consistency.
- Refactored image directory path to use the
-
File
pubspec.yaml
:- Updated the version from
1.0.1+34
to1.0.2+35
.
- Updated the version from
This commit fixes a bug related to the handling of image paths by centralizing the image directory name into a constant and updates the application version to reflect the changes.
Updated app version and refactored image path constants for better maintainability.
Details:
-
File
app_info.dart
:- Incremented app version from
1.0.0+33
to1.0.2+35
.
- Incremented app version from
-
File
constants.dart
:- Added a new constant
usersImages
to centralize the image directory name.
- Added a new constant
-
File
app_settings.dart
:- Updated the
_imagePath
initialization to use the newusersImages
constant for directory naming.
- Updated the
-
File
users_page_controller.dart
:- Refactored image directory path to use the
usersImages
constant for consistency.
- Refactored image directory path to use the
-
File
pubspec.yaml
:- Updated the version from
1.0.1+34
to1.0.2+35
.
- Updated the version from
This commit improves the maintainability of the codebase by centralizing the image directory name in a constant and increments the application version to reflect the changes.
Added keystore properties, signing configuration, storage permissions, and new image management functionalities to the project.
Details:
-
File
build.gradle
:- Introduced a new section to load keystore properties from the
key.properties
file. - Implemented logic to check for the existence of the
key.properties
file and load the properties. - Added signing configuration for release builds using keystore properties.
- Included comments to guide future release signing configurations.
- Added NDK configuration for full debug symbol level.
- Introduced a new section to load keystore properties from the
-
File
AndroidManifest.xml
:- Added
WRITE_EXTERNAL_STORAGE
andREAD_EXTERNAL_STORAGE
permissions.
- Added
-
New file
assets/icons/stopwatch_512x512.png
:- Added a new icon for the stopwatch.
-
File
app_info.dart
:- Incremented app version from
1.0.0+32
to1.0.0+33
.
- Incremented app version from
-
File
users_page.dart
:- Added
resizeAndSaveImage
method to the user dialog. - Called
removeUnusedImages
method after updating a user.
- Added
-
File
users_page_controller.dart
:- Implemented the
resizeAndSaveImage
method to resize and save images. - Implemented the
removeUnusedImages
method to remove unused images.
- Implemented the
-
File
user_dialog.dart
:- Added
resizeAndSaveImage
parameter to the user dialog constructor. - Modified
_photoImageOnTap
method to useresizeAndSaveImage
.
- Added
-
File
main.dart
:- Removed unnecessary calls to
AppSettings
.
- Removed unnecessary calls to
-
File
user_manager.dart
:- Implemented the
getImagesList
method to obtain the list of images.
- Implemented the
-
File
abstract_user_repository.dart
:- Added definition for the
getImagesList
method.
- Added definition for the
-
File
user_repository.dart
:- Implemented the
getImagesList
method.
- Implemented the
-
File
table_attributes.dart
:- Changed the database name to
stopwatch.db
.
- Changed the database name to
-
File
table_sql_scripts.dart
:- Added query to get the list of user images.
-
File
database_manager.dart
:- Added log for the database path.
- Additional log to indicate successful database opening.
-
File
database_provider.dart
:- Fixed call to
app.init()
method.
- Fixed call to
-
File
user_store.dart
:- Implemented the
getImagesList
method.
- Implemented the
-
Files
pubspec.lock
andpubspec.yaml
:- Added
flutter_image_compress
dependency.
- Added
This commit enhances security and release management by adding support for keystore and signing configuration. It also adds new storage permissions, updates icons, increments the app version, introduces functionalities for resizing and cleaning up unused images, and includes general code improvements.
refactor: Update HistoryModel usage and refactor history management
- Refactored
updateHistory
method across various controllers to useHistoryModel
instead ofint historyId
. - Updated
MessagesModel
to includehistoryId
intoString()
method. - Commented out unused
isSplit
case inMessagesModel
. - Adjusted
StopwatchDrawer
to align the text at the bottom center. - Renamed
managerUpdate
toeditHistory
inDismissibleHistory
and related calls. - Added
editHistory
method toHistoryListView
to handle history edits through a dialog. - Commented out the unused
_cleanUserLog
method inPreciseStopwatch
. - Updated
PreciseStopwatchController
to useHistoryModel
for updating history. - Added
getById
method toHistoryManager
for fetching a history by ID. - Refactored
update
method inHistoryManager
to useHistoryModel
directly. - Renamed
query
togetById
inAbstractHistoryRepository
andHistoryRepository
for consistency.
-
History Management Refactor:
- Changed the signature of the
updateHistory
method in various controllers (HistoryPageController
,PersonalTrainingController
,PreciseStopwatchController
) to acceptHistoryModel
instead of an integer ID. This change ensures that the entire history object is passed, allowing for more detailed updates and better type safety.
- Changed the signature of the
-
Model Updates:
- Updated
MessagesModel
to includehistoryId
in thetoString()
method for better debugging and logging. - Commented out the
isSplit
case in theMessagesModel
class, indicating that it is currently not in use.
- Updated
-
UI Adjustments:
- Modified
StopwatchDrawer
to align the text at the bottom center, enhancing the UI layout and readability.
- Modified
-
Dismissible History:
- Renamed the
managerUpdate
function toeditHistory
in theDismissibleHistory
widget and ensured that related calls in the widget tree were updated accordingly. - Added
editHistory
method inHistoryListView
to handle the editing of history entries through a dialog interface, providing a more interactive user experience.
- Renamed the
-
Precise Stopwatch:
- Commented out the
_cleanUserLog
method inPreciseStopwatch
, indicating it is not in use and simplifying the codebase.
- Commented out the
-
HistoryManager and Repository:
- Introduced the
getById
method inHistoryManager
to fetch a history record by its ID, improving data retrieval capabilities. - Refactored the
update
method inHistoryManager
to acceptHistoryModel
directly, simplifying the update logic and ensuring consistency. - Renamed the
query
method togetById
in bothAbstractHistoryRepository
andHistoryRepository
for better clarity and consistency in naming conventions.
- Introduced the
These changes collectively improve the structure, readability, and maintainability of the codebase, ensuring that history management is more robust and that UI components are better aligned.
feat: Implementation of WhatsApp data sending button and enhancements in training management interface
- Added "WhatsApp" button for sending data through the app.
- Included green-colored WhatsApp icon.
- Added
IconButton
for removing selected trainings, with updated focus and tooltip. - Adjusted logic for selecting and deselecting all trainings.
- Removed
lap
andsplit
columns from thehistoryTable
. - Updated SQL scripts for creating and handling the
historyTable
. - Updated
pubspec.yaml
file to version1.0.0+32
.
Detailed Description:
This commit introduces several significant enhancements to the Trainer’s Stopwatch application, aimed at improving user experience and functionality. The primary focus is on integrating a new feature for sending data via WhatsApp and refining the training management interface. These changes ensure that trainers and athletes can efficiently manage and share their training data, leading to a more streamlined and user-friendly experience.
WhatsApp Data Sending Functionality:
- New Button Implementation:
- A "WhatsApp" button has been added to the application interface, enabling users to send their training data directly through WhatsApp.
- This button features a green-colored WhatsApp icon followed by the text "WhatsApp" for clear identification.
Enhancements in Training Management Interface:
-
Removal Button for Selected Trainings:
- An
IconButton
has been introduced to allow users to remove selected trainings. This button is equipped with a tooltip 'GenericRemove' and only activates when there are selected trainings. - The button has updated focus management to improve accessibility.
- An
-
Selection and Deselection Logic:
- The logic for selecting and deselecting all trainings has been refined. The button for selecting/deselecting all trainings now correctly handles states based on whether trainings are present and selected.
Database Schema Updates:
-
Column Removal:
- The
lap
andsplit
columns have been removed from thehistoryTable
. This change simplifies the database schema and aligns with the streamlined data management approach.
- The
-
SQL Script Adjustments:
- Corresponding SQL scripts for creating and managing the
historyTable
have been updated to reflect the removal of thelap
andsplit
columns.
- Corresponding SQL scripts for creating and managing the
Project Version Update:
- Version Increment:
- The project's version has been updated from
0.9.10+31
to1.0.0+32
in thepubspec.yaml
file, indicating a significant update with new features and enhancements.
- The project's version has been updated from
These updates enhance the functionality and usability of the Trainer’s Stopwatch application, making it more efficient for managing and sharing training data.
Release First Beta Version with Comprehensive Enhancements and Optimizations
Detailed Changes:
-
Build PDF Functionality:
- Added
makeReport
method to generate detailed training reports for users, including metrics like total length, total time, medium speed, lap length, split length, and number of laps. - Enhanced PDF formatting with the inclusion of user details and training logs.
- Added
-
Share Functionality:
- Updated
sendWhatsApp
andsendEmail
methods to utilize the newmakeReport
method for generating comprehensive PDF reports. - Included user details in shared reports for better personalization.
- Updated
-
Stopwatch Functions:
- Introduced
SpeedValue
class to encapsulate speed and its unit, ensuring consistent handling and display of speed metrics across the application. - Enhanced
formatDuration
method to handle durations exceeding one hour, ensuring accurate time representation.
- Introduced
-
Training Report Enhancements:
- Streamlined
TrainingReport
class by removing redundant methods and focusing on generating message models with detailed training information. - Improved message creation methods to include user names and formatted speed values, providing clearer and more informative messages.
- Streamlined
-
Messages Model:
- Added new fields (
userName
,label
,speed
,duration
,comments
) to theMessagesModel
class for detailed message representation. - Implemented methods to generate formatted titles and subtitles for message logs, ensuring clarity in the displayed and logged messages.
- Added new fields (
-
History Page Controller:
- Updated state management to handle the new speed calculation and message generation functionalities.
- Ensured proper logging and error handling during history retrieval and updates.
-
Trainings Page:
- Enhanced sharing functionality to include user details in shared training logs.
- Removed redundant report generation code, focusing on streamlined sharing methods.
-
Dismissible History Widget:
- Improved display of history messages with detailed subtitles, including speed values and formatted durations.
- Added handling for finish messages with appropriate icons and labels.
-
Precise Stopwatch Controller:
- Updated message generation methods to include detailed labels, speed values, and durations for split and lap messages.
- Enhanced finish message generation with formatted timestamps and clear labels.
-
Project Configuration:
- Updated project version to
0.9.9+30
inpubspec.yaml
to reflect the transition to the first beta release.
- Updated project version to
These enhancements mark the completion of all planned features and improvements for the application, moving it into the beta testing phase for final bug fixes and optimizations before the first official release.
Enhance PersonalTrainingController and HistoryListView with Improved State Management and Message Handling
Detailed Changes:
-
PersonalTrainingController:
- Improved
getHistory
method to handle errors and update the state accordingly. - Added
trainingReport.createMessages()
ingetHistory
,updateHistory
, anddeleteHistory
methods to keep the messages updated based on the latest history changes. - Ensured state changes are correctly reflected in case of errors with appropriate logging.
- Improved
-
TrainingsPageController:
- Added
_removeFromSelection
method to remove a training from the selection list upon deletion. - Integrated
_removeFromSelection
call withinremoveTraining
to keep the selection list updated.
- Added
-
HistoryListView:
- Refactored to use messages model import for consistency.
- Updated the
build
method to handle reversed message lists, ensuring correct display order. - Adjusted ListView builder to display the correct set of messages, taking into account the
reversed
flag for proper order presentation.
These changes aim to provide a more robust and user-friendly experience by ensuring state and message consistency across various parts of the application.
This commit enhances the project with various improvements and new features that provide a more robust and efficient user experience.
Changes:
-
Android Manifest Update:
- Enabled
android.intent.action.PROCESS_TEXT
intent filter to support text processing within the application.
- Enabled
-
History Controller Enhancements:
- Added
TrainingReport
integration to theHistoryController
. - Updated the
init
method to initializeTrainingReport
with user and training data, including histories. - Ensured that
getHistory
updates the training report messages upon fetching history data.
- Added
-
New Training Report Class:
- Created
TrainingReport
to handle the generation of training reports. - The class includes methods for creating split and lap messages, calculating speeds, and formatting durations.
- Provides a structured way to log and retrieve training history details.
- Created
-
Messages Model Updates:
- Introduced
MessageType
enum to classify message types (Lap, Split, Starting). - Added
historyId
toMessagesModel
to link messages with specific history records.
- Introduced
-
History Page Updates:
- Modified
init
method to accept user, training, and history data. - Initialized
TrainingReport
with the necessary data within the controller. - Updated
HistoryListView
to work with new messages fromTrainingReport
.
- Modified
-
Personal Training Page Enhancements:
- Updated
PersonalTrainingController
to use the enhancedHistoryController
withTrainingReport
. - Initialized the controller with user, training, and history data.
- Updated
-
Trainings Page Updates:
- Added functionality to generate detailed training reports.
- Introduced a new icon in the action bar to trigger report generation.
- Refactored the
SelectUserPopupMenu
into a separate widget for better code organization.
-
Widgets and UI Improvements:
- Refactored
DismissibleHistory
to work with the newMessagesModel
. - Updated
HistoryListView
to display messages instead of direct history data. - Enhanced
PreciseStopwatch
UI for better alignment and presentation.
- Refactored
-
History Manager Enhancements:
- Added a
newInstance
method toHistoryManager
for better initialization and fetching of history data.
- Added a
This commit ensures a more structured approach to handling training data, improves user experience with new reporting capabilities, and enhances the overall maintainability and readability of the codebase.
Enhanced app initialization, sharing features, and UI improvements
-
flutter_native_splash Configuration:
- Added
flutter_native_splash.yaml
to configure splash screens with primary and dark colors. - Set Android 12 splash screen image.
- Added
-
Icon Path Update:
- Changed icon path in
build_pdf.dart
fromassets/icon/stopwatch.png
toassets/icons/stopwatch.png
.
- Changed icon path in
-
Sharing Enhancements:
- Added
share_plus
package for sharing capabilities. - Implemented
sendWhatsApp
function inshare_functions.dart
to share training PDFs via WhatsApp.
- Added
-
UI Improvements:
- Increased
maxFocusNode
to 28 inapp_settings.dart
. - Adjusted button styles to
FilledButton.tonal
for a more consistent look across:stopwatch_overlay.dart
stopwatch_page.dart
edit_training_dialog.dart
users_overlay.dart
user_dialog.dart
generic_dialog.dart
- Ensured splash screen removal after app initialization in
stopwatch_page.dart
usingFlutterNativeSplash.remove()
. - Enhanced
edit_training_dialog.dart
to include animated updates of split and lap distances with added validation.
- Increased
-
Refactoring and Cleanup:
- Renamed
TrainingsPage
toTrainingsOverlay
and updated related navigation routes and tutorial overlays. - Introduced
SelectUserPopupMenu
component for better user selection intrainings_page.dart
. - Enhanced
DismissibleHistory
to optionally disable delete functionality based on theenableDelete
flag. - Added
onChanged
callback inNumericField
for real-time updates.
- Renamed
-
Database Initialization Logging:
- Added logging statements in
database_manager.dart
to track table creation process.
- Added logging statements in
-
Dependency and Version Updates:
- Updated
pubspec.yaml
to include:flutter_native_splash: ^2.4.0
share_plus: ^9.0.0
- Incremented app version to
0.9.7+28
to reflect new features and enhancements.
- Updated
Refactor and enhance history management:
This commit introduces several improvements and refactorings to the history management features of the application. Key changes include the creation of abstract classes for better state management, updates to the history and training controllers, and various UI enhancements.
-
New Abstract Classes: Introduced
HistoryController
and related state classes to abstract history management logic.- Added
lib/common/abstract_classes/history_controller.dart
.
- Added
-
Version Update: Incremented app version to
0.9.6+27
.- Updated
lib/common/app_info.dart
andpubspec.yaml
.
- Updated
-
Refactored History Page:
- Moved history list view logic to a separate widget
HistoryListView
. - Moved training information display logic to a new widget
TrainingInformations
. - Updated
HistoryPage
to use the new abstract classes and widgets. - Deleted
lib/features/history_page/history_page_state.dart
.
- Moved history list view logic to a separate widget
-
Controller Enhancements:
- Refactored
HistoryPageController
to extend the newHistoryController
. - Created
PersonalTrainingController
to manage personal training sessions. - Updated
PersonalTrainingPage
to usePersonalTrainingController
.
- Refactored
-
UI Improvements:
- Enhanced
MessageRow
to correctly reverse the message list inStopWatchPage
.
- Enhanced
-
Removed Redundant Imports:
- Cleaned up imports in various files to remove unused dependencies.
These changes aim to streamline history management, improve code maintainability, and enhance the user interface for a better user experience.
Refactor and updates to the project:
This commit introduces significant refactoring and updates across various components of the project. It includes enhancements in translation files, UI improvements, new functionality in stopwatch functions, and code clean-up. The changes aim to improve the maintainability and user experience of the application.
-
Updated translation files:
- Added new translation keys in
en-US.json
,es.json
, andpt-BR.json
.
- Added new translation keys in
-
Updated constants:
- Added
primaryColor
constant inlib/common/constants.dart
.
- Added
-
Enhanced stopwatch functions:
- Added
formatDuration
function inlib/common/functions/stopwatch_functions.dart
.
- Added
-
Improved font styles:
- Added
roboto10
style inlib/common/theme/app_font_style.dart
.
- Added
-
Refactored history page:
- Replaced
CardHistory
withDismissibleHistory
inlib/features/history_page/history_page.dart
.
- Replaced
-
Updated controllers:
- Added
updateHistory
anddeleteHistory
methods toHistoryPageController
.
- Added
-
Improved trainings page:
- Adjusted
trainings_page.dart
to reflect new control logic and color management.
- Adjusted
-
Implemented new widget:
- Created
dismissible_history.dart
for managing history with edit and delete options.
- Created
-
Enhanced edit training dialog:
- Added color selection in
edit_training_dialog.dart
and createdcolor_dialog.dart
.
- Added color selection in
-
Updated models and repositories:
- Added a color field to
TrainingModel
. - Adjusted
history_repository.dart
to support updates without explicitly passing an ID.
- Added a color field to
-
Added new dependencies:
- Included
flutter_colorpicker
inpubspec.yaml
.
- Included
-
Other improvements:
- General adjustments in layouts and widget behaviors for better usability and visual consistency.
The files lib/features/history_page/widgets/card_history.dart
and lib/features/personal_training_page/widgets/dismissible_personal_training.dart
were removed and replaced with lib/features/widgets/common/dismissible_history.dart
.
Introduced new features and made several improvements to the application.
Refactor AndroidManifest and Update Application Assets
-
Updated
AndroidManifest.xml
:- Commented out
<intent>
element forandroid.intent.action.PROCESS_TEXT
. - Added
<intent>
element forandroid.intent.action.SENDTO
withmailto
scheme.
- Commented out
-
Replaced launcher icons in various resolutions:
mipmap-hdpi/ic_launcher.png
mipmap-mdpi/ic_launcher.png
mipmap-xhdpi/ic_launcher.png
mipmap-xxhdpi/ic_launcher.png
mipmap-xxxhdpi/ic_launcher.png
-
Added new asset icons:
assets/icons/stopwatch.png
assets/svgs/stopwatch2.svg
-
Updated translations to include "Share" feature:
assets/translations/en-US.json
assets/translations/es.json
assets/translations/pt-BR.json
-
Incremented app version from
0.9.3+22
to0.9.3+24
inlib/common/app_info.dart
. -
Added functionality to generate and share PDFs via email:
- Created
lib/common/functions/build_pdf.dart
to build PDFs from training data. - Created
lib/common/functions/share_functions.dart
to handle email sending with attachment.
- Created
-
Enhanced
history_page
to include training comments:- Modified
_cardHeader
inlib/features/history_page/history_page.dart
.
- Modified
-
Improved training selection and sharing functionality:
- Updated
lib/features/trainings_page/trainings_page.dart
to handle email sharing. - Enhanced
TrainingsPageController
to check if all trainings are selected.
- Updated
-
Improved UI components:
SimpleSpinBoxField
inlib/features/widgets/common/simple_spin_box_field.dart
to support nullable values.UserCard
inlib/features/widgets/common/user_card.dart
to handle text overflow.EditTrainingDialog
inlib/features/widgets/edit_training_dialog/edit_training_dialog.dart
to include comments.LapSplitCounters
inlib/features/widgets/precise_stopwatch/widgets/lap_split_counters.dart
to dynamically display lap count.
Replace Signal with ValueNotifier
Replaced the Signal package with ValueNotifier in several parts of the codebase to address issues encountered during development with hot-reload. It seems that Signal was masking dispose errors of some elements, causing interference with hot-reload. While not entirely certain, I decided to remove Signal and use ValueNotifier instead.
Changes Made:
- Updated lib/bloc/stopwatch_bloc.dart:
- Replaced Signal with ValueNotifier for attributes _lapCounter and _splitCounter.
- Updated lib/common/singletons/app_settings.dart:
- Replaced Signal with ValueNotifier for attributes _brightness and _contrast.
- Updated lib/features/personal_training_page/widgets/edit_history_dialog/widgets/distance_unit_row.dart:
- Replaced Signal with ValueNotifier for attributes selectedUnit and selectedSpeedUnit.
- Updated lib/features/personal_training_page/widgets/edit_history_dialog/widgets/speed_unit_row.dart:
- Replaced Signal with ValueNotifier for attributes selectedSpeedUnit and selectedDistUnit.
- Updated lib/features/users_page/widgets/dismissible_user_tile.dart:
- Replaced Signal with ValueNotifier for attribute isChecked.
- Updated lib/features/users_page/widgets/user_dialog/user_controller.dart:
- Replaced Signal with ValueNotifier for attribute image.
- Updated lib/features/widgets/edit_training_dialog/edit_training_dialog.dart:
- Replaced Signal with ValueNotifier for attributes splitFocusNode, lapFocusNode, selectedDistUnit, and selectedSpeedUnit.
- Updated lib/features/widgets/edit_training_dialog/widgets/distance_unit_row.dart:
- Replaced Signal with ValueNotifier for attributes selectedUnit and selectedSpeedUnit.
- Updated lib/features/widgets/edit_training_dialog/widgets/speed_unit_row.dart:
- Replaced Signal with ValueNotifier for attributes selectedSpeedUnit and selectedDistUnit.
- Updated lib/features/stopwatch_page/stopwatch_page_controller.dart:
- Replaced Signal with ValueNotifier for attributes _stopwatchLength and _historyMessage.
- Updated lib/features/widgets/precise_stopwatch/precise_stopwatch.dart:
- Replaced Signal with ValueNotifier for attribute maxLaps.
- Updated lib/features/widgets/precise_stopwatch/widgets/counter_row.dart:
- Replaced Signal with ValueNotifier for attribute counter.
- Updated lib/features/widgets/precise_stopwatch/widgets/lap_split_counters.dart:
- Replaced Signal with ValueNotifier for attribute maxLaps.
- Updated lib/features/widgets/precise_stopwatch/widgets/stopwatch_display.dart:
- Replaced Signal with ValueNotifier for attribute durationTraining.
- Removed Signal package from pubspec.yaml.
- lib/features/users_page/widgets/user_dialog/user_dialog.dart
- lib/features/settings/settings_page.dart:
- lib/features/stopwatch_page/stopwatch_page.dart:
- lib/features/widgets/common/custom_icon_button.dart
- lib/features/widgets/precise_stopwatch/precise_stopwatch_controller.dart:
- lib/features/widgets/precise_stopwatch/widgets/stopwatch_button_bar.dart:
- Adjusted for the replacement of Signal with ValueNotifier.
feat: Update app icons and improve tutorial content
This commit introduces the following changes:
- Updated application icons for various resolutions (hdpi, mdpi, xhdpi, xxhdpi, xxxhdpi).
- Added a new stopwatch icon in PNG and SVG formats.
- Enhanced tutorial content with detailed steps and messages.
- Updated translation files to include new tutorial messages in English, Spanish, and Portuguese.
- Added a new overlay for settings and users pages to provide a more comprehensive tutorial experience.
- Implemented a new class,
SettingsOverlay
, to manage tutorial steps for the settings page. - Fixed a bug in the tutorial step sequence on the stopwatch page.
- Integrated
flutter_launcher_icons
package to manage app icons. - Updated pubspec.yaml to include the new icon path and launcher icon configurations.
Changes in detail:
- Added new icon files:
assets/icons/stopwatch.png
assets/svgs/stopwatch.svg
- Updated application icons in:
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
- Added images for tutorial:
assets/images/dismissingLeft.png
assets/images/dismissingRight.png
app_settings.dart
:- Updated to handle tutorial state and added methods to disable tutorial.
settings_overlay.dart
:- Created to manage tutorial steps for settings page.
settings_page.dart
:- Integrated
OnboardingOverlay
for the settings page tutorial.
- Integrated
stopwatch_overlay.dart
:- Enhanced with new tutorial steps and localized messages.
users_overlay.dart
:- Added detailed tutorial steps and messages.
- Updated translation files:
en-US.json
es.json
pt-BR.json
- Updated dependencies to include
flutter_launcher_icons
and configuration for the new app icon.
This update enhances the user experience by providing detailed guidance through tutorials and updating visual elements to align with the app's branding.
refactor: Rename Athlete to User across the application
This commit includes comprehensive renaming of directories, files, variables, constants, classes, and functions to replace "Athlete" with "User". The term "User" aligns better with the application's purpose and scope.
Changes include:
-
Directory and file names:
- Renamed directories and files from
athlete*
touser*
.
- Renamed directories and files from
-
Variables and constants:
- Updated variable and constant names from
athlete*
touser*
.
- Updated variable and constant names from
-
Classes and functions:
- Renamed classes and functions from
Athlete*
toUser*
.
- Renamed classes and functions from
These changes enhance clarity and consistency throughout the codebase, ensuring the terminology aligns with the app's intended functionality.
feat: Add tutorial steps and enhance app settings
This commit introduces new tutorial steps using the onboarding_overlay package, adds a new image asset, and enhances app settings management. A bug fix in the settingsTable
creation script has been made, and the database will now be removed if an error occurs during its creation.
- assets/images/user_settings.png:
- Added new image asset for tutorial purposes.
- lib/common/singletons/app_settings.dart:
- Added
disableTutorial
method to turn off the tutorial and update settings. - Removed
copy
method to avoid redundant data copying. - Enhanced
update
method for better settings management.
- Added
- lib/features/users_page/users_overlay.dart:
- Added new onboarding steps for the Users page tutorial.
- Included an option to interrupt the tutorial with explanatory text and buttons.
- lib/features/stopwatch_page/stopwatch_overlay.dart:
- Added new onboarding steps for the Stopwatch page tutorial.
- Included an option to interrupt the tutorial with explanatory text and buttons.
- Improved the full-screen message layout for better user experience.
- lib/features/stopwatch_page/stopwatch_page.dart:
- Enabled tutorial overlay display based on app settings.
- Enhanced post-frame callback to manage tutorial states.
- lib/main.dart:
- Adjusted initialization sequence to ensure settings are loaded before database initialization.
- lib/models/settings_model.dart:
- Added
showTutorial
attribute to manage tutorial display. - Enhanced
copy
method to include the new attribute. - Updated
toMap
andfromMap
methods to handleshowTutorial
.
- Added
- lib/store/constants/migration_sql_scripts.dart:
- Added migration script for version 1005 to include
showTutorial
column.
- Added migration script for version 1005 to include
- lib/store/constants/table_attributes.dart:
- Added
settingsShowTutorial
attribute.
- Added
- lib/store/constants/table_sql_scripts.dart:
- Fixed bug in
createSettingsSQL
script and addedsettingsShowTutorial
column.
- Fixed bug in
- lib/store/database/database_provider.dart:
- Updated initialization to handle app settings and migrations correctly.
- pubspec.yaml:
- Updated version to
0.9.2+21
.
- Updated version to
This commit ensures better management of app settings, introduces a comprehensive onboarding tutorial, and fixes potential issues in database initialization and migration processes.
feat: Enhance stopwatch messaging and add onboarding tutorial
This commit introduces improvements to stopwatch messaging and adds support for the onboarding tutorial using the onboarding_overlay package. It also includes translations updates and several UI and backend adjustments. A bug fix in the settingsTable
creation script has been made, and the database will now be removed if an error occurs during its creation.
-
assets/translations/en-US.json:
- Updated
PSCStartedMessage
,PSCSplitMessage
,PSCLapMessage
, andPSCFinishMessage
to remove redundant placeholders.
- Updated
-
assets/translations/es.json:
- Updated
PSCStartedMessage
,PSCSplitMessage
,PSCLapMessage
, andPSCFinishMessage
to remove redundant placeholders.
- Updated
-
assets/translations/pt-BR.json:
- Updated
PSCStartedMessage
,PSCSplitMessage
,PSCLapMessage
, andPSCFinishMessage
to remove redundant placeholders.
- Updated
-
lib/features/stopwatch_page/stopwatch_page.dart:
- Added import for
MessagesModel
. - Changed
_messageList
to useMessagesModel
instead ofString
. - Updated logic to handle
MessagesModel
instances. - Modified
_removeUserFromLogs
to usemessage.title
for comparison.
- Added import for
-
lib/features/stopwatch_page/stopwatch_page_controller.dart:
- Changed
_historyMessage
to useMessagesModel
instead ofString
. - Updated
sendHistoryMessage
to acceptMessagesModel
.
- Changed
-
lib/features/stopwatch_page/widgets/message_row.dart:
- Changed
message
type toMessagesModel
. - Updated
_buildMessageRow
and_messageRow
to handleMessagesModel
attributes. - Improved UI styling for message rows using
Container
.
- Changed
- lib/features/trainings_page/trainings_page.dart:
- Added elevation to
AppBar
. - Enhanced dropdown styling with
Container
.
- Added elevation to
- lib/features/widgets/precise_stopwatch/precise_stopwatch_controller.dart:
- Changed messages to use
MessagesModel
. - Updated
_sendStartedMessage
,_sendSplitMessage
,_sendLapMessage
, and_sendFinishMessage
to createMessagesModel
instances.
- Changed messages to use
- lib/manager/settings_manager.dart:
- Added try-catch block to handle errors when querying settings.
- lib/store/database/database_manager.dart:
- Added logging and error handling for database creation.
- lib/models/messages_model.dart:
- Created new
MessagesModel
class to encapsulate message details.
- Created new
- lib/store/constants/table_sql_scripts.dart:
- Added missing comma in
createSettingsSQL
.
- Added missing comma in
feat: Add onboarding tutorial using onboarding_overlay package
This commit integrates the onboarding_overlay package to provide an introductory tutorial for the app on two pages. It includes necessary adjustments to routes, FocusNodes, and user interfaces to support the tutorial.
-
lib/common/singletons/app_settings.dart:
- Added constant
maxFocusNode
to limit the number of FocusNodes for the tutorial. - Added
List<FocusNode> focusNodes
to store FocusNodes for the tutorial. - Added
tutorialOn
attribute to indicate if the tutorial is active. - Added
tutorialId
attribute to track the tutorial test user's ID. - Added disposal of elements in
focusNodes
in thedispose
method.
- Added constant
-
lib/my_material_app.dart:
- Adjusted routes for
StopWatchPage
andUsersPage
to use tutorial overlaysStopwatchOverlay
andUsersOverlay
, respectively.
- Adjusted routes for
-
lib/screens/users_page/users_overlay.dart:
- Added
UsersOverlay
class to provide the tutorial for theUsersPage
.
- Added
-
lib/screens/users_page/users_page.dart:
- Added tutorial entries in
initState
,_addNewUser
. - Added a
PopupMenuButton
for tutorial entry. - Added
app.focusNode
for tutorial elements.
- Added tutorial entries in
-
lib/screens/users_page/users_page_controller.dart:
- Added an entry to store the user ID used in the tutorial.
-
lib/screens/users_page/widgets/user_dialog/user_dialog.dart:
- Corrected attribute name from
sueUser
toaddUser
.
- Corrected attribute name from
-
lib/screens/users_page/widgets/dismissible_user_tile.dart:
- Added a dialog for attempting to deselect an user when they have an active stopwatch on the main page.
-
lib/screens/widgets/common/generic_dialog.dart:
-
lib/screens/widgets/edit_training_dialog/edit_training_dialog.dart:
-
lib/screens/personal_training_page/widgets/edit_history_dialog/edit_history_dialog.dart:
-
lib/screens/trainings_page/widgets/edit_training_dialog.dart:
- Replaced
ElevatedButton
withFilledButton
.
- Replaced
-
lib/screens/stopwatch_page/stopwatch_overlay.dart:
- Added
StopwatchOverlay
class to provide the tutorial for theStopWatchPage
.
- Added
-
lib/screens/stopwatch_page/stopwatch_page.dart:
- Added tutorial entries in
initState
,_addNewUser
. - Added a
PopupMenuButton
for tutorial entry. - Added
app.focusNode
for tutorial elements. - Added a call to dispose
AppSettings.instance
in thedispose
method of the class.
- Added tutorial entries in
-
lib/screens/stopwatch_page/widgets/stopwatch_dismissible.dart:
-
lib/screens/stopwatch_page/widgets/stopwatch_drawer.dart:
-
lib/screens/widgets/common/custon_icon_button.dart:
-
lib/screens/widgets/precise_stopwatch/widgets/stopwatch_button_bar.dart:
- Added
app.focusNode
for tutorial elements.
- Added
-
lib/screens/widgets/precise_stopwatch/precise_stopwatch.dart:
PreciseStopwatch
now passesuser.id
to theStopwatchButtonBar
class.
feat: Update translations, theme settings, and database schema for improved functionality and Flutter 3.22 compliance
This commit includes extensive updates to the translations, theme settings, and database schema. It aligns with Flutter 3.22 guidelines, adds new features such as contrast control, and makes several UI and backend adjustments.
-
assets/translations/??.json:
- Various updates to translations.
-
lib/common/constants.dart:
- Transferred
distanceUnits
,speedUnits
, andspeedAllowedValues
to this constants file.
- Transferred
-
lib/common/singletons/app_settings.dart:
- Renamed variables
themeMode
and related ones tobrightness
, in accordance with Flutter 3.22 guidelines. - Added support for contrast control in the app.
- Renamed variables
-
lib/common/theme/color_schemes.g.dart:
-
lib/common/theme/theme.dart:
-
lib/common/theme/util.dart:
- Replaced
color_schemes.g.dart
withtheme.dart
andutils.dart
, following new Flutter 3.22 guidelines.
- Replaced
-
lib/models/settings_model.dart:
- Added
Contrast
enum with elements:{standard, medium, high}
. - Added attributes
lengthUnit
andcontrast
. - Renamed attribute
theme
tobrightness
.
- Added
-
lib/my_material_app.dart:
- Adjusted
MyMaterialApp
to use the new files generated by the Material Theme Builder (https://material-foundation.github.io/material-theme-builder/). - Updated to control theme brightness.
- Adjusted
-
lib/screens/about_page/about_page.dart:
- The about page now includes a link to the project page.
-
lib/screens/settings/settings_page.dart:
- Replaced
_themeModeIcon
method with_brightnessIcon
, now returning anIcon
widget. - Added control for theme contrast.
- Added editing of default lap and split lengths.
- Replaced
-
lib/screens/settings/widgets/length_line_edit.dart:
- Created
LengthLineEdit
class to manage lap and split length input lines.
- Created
-
lib/screens/stopwatch_page/widgets/stopwatch_drawer.dart:
- Changed the about page icon to
Icons.info_outline
.
- Changed the about page icon to
-
lib/screens/trainings_page/widgets/dismissible_training.dart:
- Replaced the card with a
Container
and implemented selection control via the container's background color.
- Replaced the card with a
-
lib/screens/widgets/common/user_card.dart:
- Replaced the user card with a
Container
, similar to above.
- Replaced the user card with a
-
lib/screens/trainings_page/widgets/dismissible_training.dart:
- Replaced card with a
Container
and implemented color control for selection. This was necessary as the dark theme currently lacks shadow onCard
widgets. It is unclear if this is a bug or new directive in the current Material Theme.
- Replaced card with a
-
lib/screens/widgets/edit_training_dialog/widgets/distance_unit_row.dart:
-
lib/screens/widgets/edit_training_dialog/widgets/speed_unit_row.dart:
- Adjusted dropdown background color for better visibility in dark theme, for the same reason as above.
-
lib/screens/widgets/precise_stopwatch/precise_stopwatch.dart:
- Further color adjustments.
-
lib/store/constants/migration_sql_scripts.dart:
- Added migrations for database schema versions 1.0.3 and 1.0.4, including new columns
settingsLengthUnit
andsettingsContrast
insettingsTable
.
- Added migrations for database schema versions 1.0.3 and 1.0.4, including new columns
-
lib/store/constants/table_attributes.dart:
-
lib/store/constants/table_sql_scripts.dart:
- Added new columns
settingsLengthUnit
andsettingsContrast
tosettingsTable
.
- Added new columns
Enhancing Localization, Functionality, and Code Organization
-
Localization Updates:
- Added new entries to the localization files (
en-US.json
,es.json
,pt-BR.json
) for handling blocked actions and specifying the number of laps, which enhances the application's user interaction by providing more specific feedback in three different languages.
- Added new entries to the localization files (
-
Functional Enhancements:
- Modified the
StopwatchBloc
to handle a maximum number of laps (maxLaps
). This introduces functionality where the stopwatch can automatically stop counting upon reaching a specified number of laps. - Updated the
TrainingModel
to changemaxlaps
from adouble?
to anint?
, aligning the data type more closely with its usage which typically involves whole numbers.
- Modified the
-
Code Refactoring:
- Moved
user_dialog
related files underusers_page/widgets
, improving project structure and modularity. - The
users_page
now incorporates logic to prevent the deletion of selected users, enhancing application stability and user experience.
- Moved
-
User Interface Improvements:
- Integrated a new widget,
SimpleSpinBoxField
, which provides a user-friendly interface for adjusting numerical values. This widget is utilized in theedit_training_dialog
to handle input for the maximum number of laps.
- Integrated a new widget,
-
Database and Version Management:
- Adjusted SQL scripts to accommodate the change in data type of
maxlaps
in the training table. - Implemented more robust database migration handling within
database_migration
by dynamically adjusting to the latest schema version, improving maintenance and scalability.
- Adjusted SQL scripts to accommodate the change in data type of
-
Version Update:
- Updated the application's version in
pubspec.yaml
to reflect the new features and fixes.
- Updated the application's version in
This commit provides significant improvements across multiple areas of the Stopwatch application, from user-facing features to backend enhancements, ensuring a more robust and user-friendly experience.
This commit enhances the multilingual support and updates the application's information management.
-
Enhanced Localization Support:
- Expanded translations for English (
en-US.json
), Spanish (es.json
), and Brazilian Portuguese (pt-BR.json
) to include new fields such as "Version", "Developer", and "Privacy Policy". This update aims to provide users with a richer, localized interface experience.
- Expanded translations for English (
-
Documentation Updates:
- Updated the
pending.txt
document to include a new item about adding a column to the training table to store the start and end times of training sessions, reflecting an ongoing effort to enhance data management and application functionality.
- Updated the
-
Codebase Enhancements:
- Introduced the
AppInfo
class inapp_info.dart
, centralizing application-related information like version, developer contact, and privacy policy URLs. This class provides methods to launch URLs and compose emails, facilitating user interaction with app developers and legal information. - Updated the
AppFontStyle
inapp_font_style.dart
to include additional predefined text styles, improving consistency and ease of use across the application. - Adjusted
TrainingModel
intraining_model.dart
to include an optionalmaxlaps
property, accommodating future features that may require tracking the maximum laps in a training session.
- Introduced the
-
User Interface Updates:
- Added the
AboutPage
to provide users with application information, including version details, developer contact, and privacy policy access. - Enhanced the settings page (
settings_page.dart
) with refined localization keys, aligning with the new translations and ensuring that the interface remains consistent and user-friendly.
- Added the
-
Architectural Improvements:
- Updated database schema management scripts (
migration_sql_scripts.dart
and related SQL scripts) to handle new database migrations smoothly, ensuring that the application's underlying data structure supports the latest features without disrupting existing functionality.
- Updated database schema management scripts (
-
Integration of URL Launcher:
- Integrated the
url_launcher
package to handle external links effectively, enabling the application to interact with web browsers and external mail applications seamlessly.
- Integrated the
This set of enhancements not only broadens the application's international appeal but also improves its informational and configurational aspects, making it more accessible and user-friendly.
This commit introduces internationalization and settings management improvements to the Stopwatch application, enhancing user experience and language support.
-
Localization Files Addition:
- Added localization files for English (
en-US.json
), Spanish (es.json
), and Brazilian Portuguese (pt-BR.json
), located in theassets/translations
directory. These files include translations for various UI elements such as buttons and dialog messages, enhancing the app's accessibility for a broader audience.
- Added localization files for English (
-
Enhancements in Settings Management:
- Updated the
StopwatchBloc
to refer to the newmSecondRefresh
property inAppSettings
for timer periodicity, aligning variable names for better code readability and consistency. - Expanded the
AppSettings
class to include multiple settings like theme mode, refresh rates, and language preferences, supporting a more customized user experience. The class now inherits fromSettingsModel
, allowing for easier settings management and updates. - Introduced a new
SettingsManager
to handle settings retrieval and updates, ensuring settings are consistently managed and stored. - Implemented new classes for settings persistence including
SettingsStore
andSettingsRepository
, facilitating the storage and retrieval of user settings from a local database.
- Updated the
-
Infrastructure and Code Organization:
- Refined the database management structure by segregating database-related files into a
database
directory, which now includes files likeDatabaseManager
,DatabaseBackup
, andDatabaseMigration
. - Refactored various stores (
AccountStore
,BalanceStore
,CategoryStore
, etc.) by moving them into a newstores
directory to streamline the project structure.
- Refined the database management structure by segregating database-related files into a
-
User Interface and Interaction:
- Modified the
Info.plist
file in the iOS project to include new localizations, expanding the app's reach to Norwegian and English speakers. - Updated the
AppSettings
singleton initialization to sync with the new settings structure, ensuring that the app correctly loads and applies user preferences at startup. - Enhanced the main application entry (
main.dart
) to initialize and apply localization settings using theEasyLocalization
package, supporting dynamic language switching based on user preferences.
- Modified the
Overall, these changes make the Stopwatch app more versatile and user-friendly, catering to a global audience with multilingual support and customizable settings.
This release introduces a series of functionality improvements and interface updates to enhance user interaction and system efficiency within the Trainers Stopwatch app.
-
Stopwatch Bloc Enhancements:
- Added attributes
_endTime
,_lastLapTime
,_lastSplitTime
,_lapDuration
, and_splitDuration
to StopwatchBloc for better control over recorded times. This change allowed for the removal of some controls fromPreciseStopwatchController
directly into StopwatchBloc. - Events were reformulated to accommodate new responsibilities related to time management.
- Created methods
_updatePausedTimes
,_restartTimesAndCounters
,_updateLap
, and_updateSplit
to better separate responsibilities and facilitate code reusability.
- Added attributes
-
Utility Functions and Bug Fixes:
- Introduced
StopwatchFunctions
class to package common app functions, initially includingspeedCalc
. - Fixed a bug in
TrainingManager
that incorrectly handled zero-index checks, ensuring more robust data handling.
- Introduced
-
UI Components and Dialog Enhancements:
- Removed the Card from
DismissibleUserTile
and incorporated it into a newUserCard
class for better code reusability and streamlined design. - In
PersonalTrainingPage
and related widgets, speed calculation now utilizesStopwatchFunctions.speedCalc
for enhanced performance metrics. TrainingsPage
now includes new commands such as_editTraining
,_removeTraining
,_selectAllTraining
, and_deselectAllTraining
, with added widgets to facilitate these actions.- Separated
DismissibleTraining
class into its own file to clean up the codebase and improve maintainability. - Added
TrainingItem
class inTrainingsPageController
to simplify the management of training selections and operations. - Introduced
EditTrainingDialog
class for editing training details directly from the UI.
- Removed the Card from
-
Precise Stopwatch Controller Adjustments:
- Shifted the control of Laps and Splits from
PreciseStopwatchController
to StopwatchBloc, centralizing time control. - Added
_getSplit
method to return corrected split times, enhancing the accuracy of performance tracking.
- Shifted the control of Laps and Splits from
This update aims to streamline the app's operations and enhance the user experience with clearer controls and improved data management.
-
doc/pending.txt:
- Removed outdated tasks and streamlined the document with new priorities including user message editing and disposal checks.
- Added initialization of a default user on app start if none exists.
-
lib/common/singletons/app_settings.dart:
- Added a dispose method to clean up the theme mode listener.
-
lib/common/theme/app_font_style.dart:
- Updated font styles to include semi-bold instead of bold and added new size variants for better text clarity.
-
lib/manager/user_manager.dart:
- Converted UserManager into a singleton and added initialization checks to prevent multiple instances.
- Added methods to ensure that all users are loaded when the manager is first accessed.
-
lib/manager/training_manager.dart:
- Added a flag to prevent reinitialization of the training manager.
- Enabled creation of a training manager by user ID, which initializes training sessions specific to an user.
-
lib/my_material_app.dart:
- Expanded routing to include new pages for settings, training and about, enhancing navigation options within the app.
-
lib/screens/about_page/about_page.dart:
- Added a new About page with basic placeholder content.
-
lib/screens/user_dialog/user_dialog.dart:
- Adjusted the user dialog to reflect changes in font style from bold to semi-bold.
-
lib/screens/users_page/users_page.dart:
- Added initial loading logic to pre-select users who are already engaged in activities to prevent their deselection.
-
lib/screens/personal_training_page/personal_training_page.dart:
- Refactored to use a dedicated dismissible widget class for better modularity and maintenance.
-
lib/screens/personal_training_page/widgets/dismissible_personal_training.dart:
- Created a new stateful widget for dismissible elements in the personal training page to handle specific training session interactions like editing and deleting.
-
lib/screens/settings/settings_page.dart:
- Introduced a settings page to the application for better user configuration management.
-
lib/screens/stopwatch_page/stopwatch_page.dart:
- Refined message handling in the stopwatch page to prevent duplicate messages and improved UI updates through state management.
-
lib/screens/trainings_page/trainings_page.dart:
- Added a training page that handles the display and management of user-specific training sessions.
-
lib/screens/widgets/common/generic_dialog.dart:
- Renamed method from callDialog to open for clarity and consistency in usage.
-
lib/screens/widgets/common/set_distance_dialog.dart:
- Renamed SetDistanceDialog to EditTrainingDialog and expanded its functionality to include editing comments on training sessions.
This commit introduces several structural improvements, new features, and user interface enhancements to enhance the functionality and usability of the app.
This release focuses on improving functionality and user interface enhancements across various components of the Trainers Stopwatch app.
-
Stopwatch Bloc Enhancements:
- Renamed
_counter
to_lapCounter
to better reflect its purpose. - Introduced
_splitCounter
for counting splits. - Simplified the increment process for splits to fix a counting bug.
- Renamed
-
Model Updates:
- In
HistoryModel
, added anint split
attribute to directly record splits instead of calculating them.
- In
-
Users Page Enhancements:
- Introduced a list of pre-selected user IDs,
_preSelectedUserIds.addAll
, which locks the selected users from being deselected on theUsersPage
. This ensures users with active stopwatches are not accidentally deselected. - In
DismissibleUserTile
, user lock control is managed, and the checkbox for user selection has been replaced with a card elevation of 5, enhancing the aesthetic appeal.
- Introduced a list of pre-selected user IDs,
-
Personal Training Page Refactoring:
- Refactored to remove
Dismissible
into a dedicated classDismissiblePersonalTraining
.
- Refactored to remove
-
Stopwatch Page Improvements:
- Removed
SnackBar
fromStopwatchPage
. Currently testing aListView.builder
for displaying messages in a reserved area at the bottom of theStopwatchPage
. - Added an effect function (from
Signal
) to enhance reactivity for adding new messages to_messageList
as they are generated. - Implemented
setState
in_addStopwatches
and_removeStopwatch
due to changes in page update dynamics. - Extracted
listViewBuilder
construction into a dedicated function for improved code readability. - Simplified the presentation of stopwatch commands on
StopwatchPage
, removing several rows and columns for a cleaner layout.
- Removed
-
Additional Component Updates:
- Created
MessageRow
to construct log entries for the stopwatch. - Introduced
StopwatchDismissible
to isolateDismissible
behavior specifically for theStopwatchPage
. - Enhanced
NumericField
to allow only valid numbers. - Adjusted focus management in
SetDistanceDialog
to better navigate its elements. - Merged Split and Lap buttons in
PreciseStopwatch
since the end of a Lap also signifies the end of a Split. These buttons now share the same position, with the Lap button displayed at the end of a Lap and the Split button visible during other operations.
- Created
-
Precise Stopwatch Controller Adjustments:
- Added
isPaused
to manage stopwatch pauses. - Streamlined the injection of new Splits and Laps to a more simplistic model.
- Replaced the generic
_createMessage
method with specific methods:_sendSplitMessage
,_sendLapMessage
,_sendFinishMessage
, and_sendStartedMessage
. - Simplified
speedCalc
method to require fewer parameters.
- Added
-
Database Schema Updates:
- Added
historySplit
constant to name the split column in thehistoryTable
. - Modified SQL to include the
split
column in thehistoryTable
.
- Added
This update aims to streamline the app's functionality while enhancing the user experience with more intuitive controls and clearer information display.
This release introduces several enhancements and new features aimed at refining the functionality and user experience of the Trainers Stopwatch app.
-
App Settings:
- Default values for
splitLength
andlapLength
added toAppSettings
.
- Default values for
-
Training Model Updates:
splitLength
andlapLength
attributes are now non-nullable.- Introduced
distanceUnit
andspeedUnit
attributes to store units for distance and speed respectively. - Default values set for
splitLength
andlapLength
are 200 and 1000, respectively.
-
Navigation and Routing:
- Routing added for
PersonalTrainingPage
using the methodPersonalTrainingPage.fromContext(context)
.
- Routing added for
-
New Page: PersonalTrainingPage:
- This new page receives a clone of the selected stopwatch and displays current training records.
-
Stopwatch Page Enhancements:
- Implemented a temporary solution using
showSnackBar
to display ongoing training results; further refinement is needed. - Configured
DismissDirection.startToEnd
to launchPersonalTrainingPage
, identified a bug with stopwatch restart that needs assessment.
- Implemented a temporary solution using
-
Stopwatch Page Controller:
- Renamed
_selectedUsers
to_stopwatchList
and introduced_stopwatchControllers
. - Added method
sendSnackBarMessage
to relay messages viaSignal<String> snackBarMessage
.
- Renamed
-
Set Distance Dialog Enhancement:
- Enhanced
SetDistancesDialog
to enable editing ofdistanceUnit
andspeedUnit
.
- Enhanced
-
Precise Stopwatch Modifications:
PreciseStopwatch
now takesPreciseStopwatchController
as a parameter to facilitate cloning onPersonalTrainingPage
.- Added
isNotClone
attribute to determine if the instance is a clone, affecting initialization and disposal behaviors. - Removed the bottom message line, transitioning to use
SnackBar
for messages.
-
Precise Stopwatch Controller Enhancements:
- Introduced
splitLength
andlapLength
attributes. - Added
_actionOnPress
as aValueNotifier<bool>
(to be converted toSignal<bool>
after resolving pending issues). - Implemented disposal for
ValueNotifier
andSignal
objects:counter
,durationTraining
, and_actionOnPress
. - Added
_toggleActionOnPress
method to toggle the state of_actionOnPress
, used for activating the refresh of history onPersonalTrainingPage
. - Method added for updating
splitLength
andlapLength
. - Implemented
speedCalc
method to calculate speed in m/s and convert it to the unit selected by the user.
- Introduced
-
Database Schema Updates:
- Declared constants
trainingDistanceUnit
andtrainingSpeedUnit
for new columns in thetrainingsTable
. - Updated SQL script
createTrainingTableSQL
to maketrainingSplitLength
andtrainingLapLength
columns non-nullable and add new columnstrainingDistanceUnit
andtrainingSpeedUnit
(both CHAR(5)).
- Declared constants
-
Dependencies:
- Added
intl
package for date formatting.
- Added
This update aims to streamline the user experience by integrating more precise controls and settings, enhancing the training management capabilities of the app.
This update introduces a series of enhancements and structural changes across the Trainers Stopwatch app to improve functionality and user experience:
-
StopwatchBloc Updates:
- Removed time interval calculation elements from
StopwatchBloc
. These are now handled by a new controller designed to manage the Stopwatch widget, streamlining the bloc's responsibilities.
- Removed time interval calculation elements from
-
App Settings Enhancements:
- Introduced
millisecondRefresh
control within the app settings to allow for configuration adjustments. - Added theme mode controls for
ThemeMode.light
andThemeMode.dark
, enhancing user customization options.
- Introduced
-
Font Style Additions:
- New styles have been added to
AppFontStyle
to support diverse UI requirements.
- New styles have been added to
-
Manager Updates:
- Standardized error messages within
UserManager
. - Launched
HistoryManager
to oversee training history models. - Introduced
TrainingManager
to manage user training models.
- Standardized error messages within
-
Model Enhancements:
TrainingModel
now includes attributes to store the lengths of splits and laps, adding detailed tracking capabilities.
-
MyMaterialApp:
- Implemented theme selection support within the app for enhanced user personalization.
-
User Dialog Adjustments:
- Modified the user dialog for both adding and updating user details, improving usability.
-
Users Page Enhancements:
- Added editing and removal capabilities for users on the
UsersPage
, enhancing management efficiency.
- Added editing and removal capabilities for users on the
-
Users Page Controller:
- Integrated methods to update and delete users, supporting robust user management.
-
Dismissible User Tile:
- Introduced
editFunction
anddeleteFunction
callbacks to facilitate user management directly from the UI.
- Introduced
-
Stopwatch Page Updates:
- Added an
IconButton
for theme switching and another for setup (the latter is not yet implemented), improving accessibility and customization.
- Added an
-
CustomIconButton Enhancements:
CustomIconButton
is now theme-reactive, adjusting its color scheme to better highlight its features and align with Android standards.
-
Generic Dialog Introduction:
- Deployed a generic dialog with predefined properties for various dialog actions (yesNo, addCancel, close, none), simplifying UI interactions.
-
Numeric Field Widget:
- Introduced
NumericField
, a widget similar toTextField
but only accepts valid numbers, ensuring input accuracy.
- Introduced
-
Set Distance Dialog:
- Added a specialized dialog for setting distances for a split and lap, aiding in precise training setup.
-
Show User Image Updates:
- Modified to accept an optional window size parameter, enhancing flexibility in image presentation.
-
Precise Stopwatch Updates:
- Removed
StopwatchBloc
fromPreciseStopwatch
. The bloc is now instantiated in thePreciseStopwatchController
, centralizing all stopwatch control logic in the controller. - Adjusted layout to accommodate a text line displaying information on splits and laps when recorded.
- Removed
-
Precise Stopwatch Controller:
- Created
PreciseStopwatchController
to handle business logic forPreciseStopwatch
, encompassing all control logic previously inStopwatchBloc
and adding split and lap record management.
- Created
These updates significantly enhance the app's configurability, user interaction, and overall efficiency, providing a more tailored and professional experience for trainers managing multiple users.
Significant enhancements and refinements have been implemented in the Trainers Stopwatch app:
-
StopwatchBloc Enhancements:
- Transitioned from
ValueNotifier
toSignal
for a more streamlined and elegant approach. - Removed
splitDuration
andcounterDuration
as they were deemed unnecessary. - The
_stopEvent
method has been optimized and simplified, ensuring accurate stop timing and lap counter adjustments. - Updated the display time in the
_pauseEvent
method for a more precise presentation of the pause moment.
- Transitioned from
-
Font Style Consolidation:
- All font styles are now centralized within the
AppFontStyle
class, promoting consistency and ease of maintenance.
- All font styles are now centralized within the
-
User Dialog and Tile Updates:
- User images are now handled through
Signal
, enhancing the reactivity and update efficiency. - User images are displayed using the
ShowUserImage
class, standardizing image presentation. - Modified
DismissibleUserTile
to use aSignal
for user selection (isChecked
signal).
- User images are now handled through
-
Stopwatch Page and Controller Logic:
- Relocated PreciseTimer allocation logic for users to
StopwatchPageController
, streamlining the control mechanism.
- Relocated PreciseTimer allocation logic for users to
-
Dismissible Background Enhancements:
DismissibleContainers
now acceptcontext
,label
,iconData
, andcolor
parameters, offering customizable backgrounds.- Implemented an
enable
property for conditional rendering and interaction.
-
Precise Stopwatch Adjustments:
- Adapted the component to utilize
Signal
instead ofValueNotifier
, refining the reactive functionality. - Renamed
PreciseTimer
toPreciseStopwatch
, aligning the naming with its specific functionality.
- Adapted the component to utilize
These updates mark a significant improvement in the app’s functionality and user experience, introducing a more responsive and user-friendly interface, and refining the stopwatch logic for better performance and accuracy.
Significant updates and enhancements have been made in the Trainers Stopwatch app, moving closer to a comprehensive professional solution for trainers. Here's a rundown of the latest improvements:
-
StopwatchBloc and Events: The StopwatchBloc is now fully functional, implementing all events successfully. A few areas marked with FIXME need refinement for cleaner operation.
-
Common Constants: Introduced a
constants.dart
file for app-wide constants, includingphotoImageSize
for image sizing anddefaultPhotoImage
providing a default user image string. -
Custom Icons: Added a new set of custom icons specific to the app, enhancing the visual appeal and user experience.
-
App Settings Singleton: Implemented the
AppSettings
singleton class to store system-wide variables likeimagePath
, organizing internal storage for user images. -
Database and Settings Initialization: The main entry point now includes database and app settings initialization, laying a solid foundation for the app's data handling.
-
User Manager: The
UserManager
class is introduced for comprehensive management of user-related operations, handling the business logic for user actions such as registration, editing, and deletion. -
Data Models: Data models for users, training sessions, and history are fully integrated with the store and repository layers, though currently, only user models are worked on within the manager layer.
-
Page Routing: Routing for
StopWatchPage
andUsersPage
is set up, facilitating navigation within the app. -
Repository Layer: The repository layer is now fully implemented for users, history, and training, performing basic database operations and bridging app objects to database maps.
-
User Dialog UI: A new
UserDialog
class introduces a dialog for adding new users, complemented byUserController
for handling form UI elements andValidator
for input validation. A customTextField
widget is designed specifically for this dialog. -
Users Page for Management: The
UsersPage
allows for user management within the app, with current functionality for adding new users. Future updates will include editing and removal options. -
Dismissible User Tile: Customized Dismissible widget for user management in
UsersPage
. -
Stopwatch Page Adjustments: Adjusted to display stopwatches for selected users from
UsersPage
. -
Database Store and Management: Implemented insertion, update, deletion, and search methods across all app models. Additionally, constants for table names, attributes, and SQL creation scripts are defined, alongside static classes for database table creation and a
DatabaseManager
for overall database management. -
Dependencies Update: The
pubspec.yaml
file has been updated with packages for SQLite database (sqflite
), file path extraction (path_provider
andpath
), testing mocks (mockito
), Observer pattern implementation (signals
), and device camera access (image_picker
). Also, added the customStopwatchIcons
font.
This version marks a significant step towards realizing a robust, professional stopwatch application tailored for trainers managing multiple users, combining precise timing functionalities with comprehensive user management and history tracking capabilities.
- lib/bloc/stopwatch_bloc.dart & lib/bloc/stopwatch_events.dart:
- Introduced
StopwatchBloc
featuring:- A
ValueNotifier<Duration> _elapsed
initialized withconst Duration()
to log the stopwatch display refreshes. - A
ValueNotifier<int> _counter
initialized with0
to log the stopwatch snapshots. - A
static int millisecondRefresh
set to66
as a default value, managing the refresh rate of stopwatches at approximately 15FPS, enhancing the user experience with smoother transitions. - Implemented a
dispose
method to dispose of_elapsed
and_counter
, and to stop the_timer
, ensuring resource efficiency and app stability.
- A
- Implemented events for comprehensive stopwatch control:
StopwatchEventRun
StopwatchEventPause
StopwatchEventReset
StopwatchEventCounterIncrement
StopwatchEventCounterDecrement
StopwatchEventCounterReset
- Introduced
- lib/bloc/stopwatch_state.dart:
- Implemented states for precise stopwatch management, enhancing the user interface responsiveness and accuracy:
StopwatchStateInitial
StopwatchStateRunning
StopwatchStatePaused
StopwatchStateReset
StopwatchStateError
- Implemented states for precise stopwatch management, enhancing the user interface responsiveness and accuracy:
- lib/screens/stopwatch_page/stopwatch_page.dart:
- Each
PreciseTimer
is now integrated with an instance ofStopwatchBloc
, streamlining the stopwatch functionality and providing a more robust and flexible solution for timing needs.
- Each
- lib/screens/widgets/common/custom_icon_button.dart:
- Added
CustomIconButton
, similar to anIconButton
but with support foronLongPressed
, offering extended functionality for user interactions.
- Added
- lib/screens/widgets/precise_timer/precise_timer.dart:
- Business logic has been migrated to
StopwatchBloc
, centralizing the stopwatch's logic and facilitating easier maintenance and updates.
- Business logic has been migrated to
This update introduces a comprehensive overhaul of the stopwatch functionality within the Trainers Stopwatch app, aiming to provide coaches and trainers with a more precise and user-friendly timing tool. By optimizing the refresh rate and integrating robust state management, the app now offers enhanced performance and reliability, ensuring that timing is accurate and responsive to the trainers' needs.