Skip to content

aksi-w/Autotests

Repository files navigation

Profile

Combining Elementary and Bloc.

This example shows how a profile can be filled out, saved on a server (a mock server), and, if necessary, edited once filled out.

Bloc is used to track profile state (loaded, edited, saved). State interfaces are added to declare which events are applicable to which states.

A profile can be in one of the following states:

  • InitProfileState - the profile is initialized with no actions yet taken.

  • ProfileLoadingState - the profile is loading.

  • ErrorProfileLoadingState - the profile failed to load from server.

  • ProfileState - the profile is loaded successfully.

  • PendingProfileState - the profile contains pending changes.

  • SavingProfileState - the profile is being saved on server.

  • ProfileSavedSuccessfullyState - the profile is successfully saved on server.

  • ProfileSaveFailedState - the profile failed to be saved on server.

Bloc diagram

Bloc diagram

PersonalDataScreen, PlaceResidenceScreen, InterestsScreen, and AboutMeScreen contain presentation logic, therefore they are written with Elementary. Thanks to that, we can separate presentation from presentation logic and business logic.

CancelButton is made into a separate widget because it has its own logic regardless of where it is used.

Widget FieldWithSuggestions has extensive presentation logic and separate business logic that shows suggestions from the repository when users enter the name of their city.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published