ProfileView Screen

The ProfileView screen in SailPilot is dedicated to displaying and updating the user’s profile information. It provides a form with various fields for users to edit their personal details.

Layout and Widgets

  • Profile Image Card: Displays the user’s profile picture and includes an option for the user to change it.

  • Input Fields: The screen consists of multiple AuthField widgets for editing information such as first name, last name, phone number, address, city, area, postcode, and country.

  • PrimaryButton: A button for submitting updated profile information. It incorporates a ShakeWidget for providing visual feedback in certain scenarios, like an error in updating.

Data Initialization

  • On initialization, the screen fetches the current user’s data from the User model and populates the input fields with existing information.

Update Process

  • When the update button is tapped, the screen calls the _updateProfileData method, which updates the user’s data in both the User and UserProfile models.

  • The method handles the synchronization of these changes with the server, ensuring that the user profile is consistently updated both locally and remotely.

User Feedback

  • Provides immediate visual feedback through snackbar messages for successful updates or errors.

  • Includes a dark mode support where the screen’s color scheme adapts based on the current theme.

Note

The ProfileView screen is a crucial component of SailPilot, allowing users to manage their personal information effectively. It demonstrates the app’s commitment to providing a customizable and responsive user experience.