use of com.vaadin.flow.component.avatar.Avatar in project flow by vaadin.
the class MainView method createHeaderContent.
private Component createHeaderContent() {
HorizontalLayout layout = new HorizontalLayout();
layout.addClassName("header");
layout.getThemeList().set("dark", true);
layout.setWidthFull();
layout.setSpacing(false);
layout.setAlignItems(FlexComponent.Alignment.CENTER);
layout.add(new DrawerToggle());
viewTitle = new H1();
layout.add(viewTitle);
Avatar avatar = new Avatar();
if (userInfo != null) {
avatar.setName(userInfo.getFullName());
avatar.setImage(userInfo.getImageUrl());
}
layout.add(avatar);
return layout;
}
Aggregations