refactor: Design polishment and better user viewer
This commit is contained in:
parent
9d0cefce18
commit
16cf4e5e6c
11 changed files with 134 additions and 152 deletions
|
|
@ -28,13 +28,6 @@ class SettingsView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
title: Text(L10n.of(context)!.settings),
|
||||
actions: [
|
||||
TextButton.icon(
|
||||
onPressed: controller.logoutAction,
|
||||
label: Text(L10n.of(context)!.logout),
|
||||
icon: const Icon(Icons.logout_outlined),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: ListTileTheme(
|
||||
iconColor: Theme.of(context).colorScheme.onSurface,
|
||||
|
|
@ -55,32 +48,17 @@ class SettingsView extends StatelessWidget {
|
|||
padding: const EdgeInsets.all(32.0),
|
||||
child: Stack(
|
||||
children: [
|
||||
Material(
|
||||
elevation: Theme.of(context)
|
||||
.appBarTheme
|
||||
.scrolledUnderElevation ??
|
||||
4,
|
||||
shadowColor:
|
||||
Theme.of(context).appBarTheme.shadowColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
Avatar.defaultSize * 2.5,
|
||||
),
|
||||
),
|
||||
child: Avatar(
|
||||
mxContent: profile?.avatarUrl,
|
||||
name: displayname,
|
||||
size: Avatar.defaultSize * 2.5,
|
||||
),
|
||||
Avatar(
|
||||
mxContent: profile?.avatarUrl,
|
||||
name: displayname,
|
||||
size: Avatar.defaultSize * 2.5,
|
||||
),
|
||||
if (profile != null)
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: FloatingActionButton.small(
|
||||
elevation: 2,
|
||||
onPressed: controller.setAvatarAction,
|
||||
heroTag: null,
|
||||
child: const Icon(Icons.camera_alt_outlined),
|
||||
|
|
@ -108,7 +86,9 @@ class SettingsView extends StatelessWidget {
|
|||
displayname,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
// style: const TextStyle(fontSize: 18),
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton.icon(
|
||||
|
|
@ -135,10 +115,7 @@ class SettingsView extends StatelessWidget {
|
|||
);
|
||||
},
|
||||
),
|
||||
Divider(
|
||||
height: 1,
|
||||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
Divider(color: Theme.of(context).dividerColor),
|
||||
if (showChatBackupBanner == null)
|
||||
ListTile(
|
||||
leading: const Icon(Icons.backup_outlined),
|
||||
|
|
@ -154,60 +131,54 @@ class SettingsView extends StatelessWidget {
|
|||
onChanged: controller.firstRunBootstrapAction,
|
||||
),
|
||||
Divider(
|
||||
height: 1,
|
||||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.format_paint_outlined),
|
||||
title: Text(L10n.of(context)!.changeTheme),
|
||||
onTap: () => context.go('/rooms/settings/style'),
|
||||
trailing: const Icon(Icons.chevron_right_outlined),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.notifications_outlined),
|
||||
title: Text(L10n.of(context)!.notifications),
|
||||
onTap: () => context.go('/rooms/settings/notifications'),
|
||||
trailing: const Icon(Icons.chevron_right_outlined),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.devices_outlined),
|
||||
title: Text(L10n.of(context)!.devices),
|
||||
onTap: () => context.go('/rooms/settings/devices'),
|
||||
trailing: const Icon(Icons.chevron_right_outlined),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.forum_outlined),
|
||||
title: Text(L10n.of(context)!.chat),
|
||||
onTap: () => context.go('/rooms/settings/chat'),
|
||||
trailing: const Icon(Icons.chevron_right_outlined),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.shield_outlined),
|
||||
title: Text(L10n.of(context)!.security),
|
||||
onTap: () => context.go('/rooms/settings/security'),
|
||||
trailing: const Icon(Icons.chevron_right_outlined),
|
||||
),
|
||||
Divider(
|
||||
height: 1,
|
||||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
Divider(color: Theme.of(context).dividerColor),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.help_outline_outlined),
|
||||
title: Text(L10n.of(context)!.help),
|
||||
onTap: () => launchUrlString(AppConfig.supportUrl),
|
||||
trailing: const Icon(Icons.open_in_new_outlined),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.shield_sharp),
|
||||
title: Text(L10n.of(context)!.privacy),
|
||||
onTap: () => launchUrlString(AppConfig.privacyUrl),
|
||||
trailing: const Icon(Icons.open_in_new_outlined),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.info_outline_rounded),
|
||||
title: Text(L10n.of(context)!.about),
|
||||
onTap: () => PlatformInfos.showDialog(context),
|
||||
trailing: const Icon(Icons.chevron_right_outlined),
|
||||
),
|
||||
Divider(color: Theme.of(context).dividerColor),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.logout_outlined),
|
||||
title: Text(L10n.of(context)!.logout),
|
||||
onTap: controller.logoutAction,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue