Change section heading

This commit is contained in:
krawieck 2020-09-03 23:14:26 +02:00
parent b704502c7d
commit 73a079bfca
1 changed files with 23 additions and 15 deletions

View File

@ -60,12 +60,7 @@ class _AppearanceConfig extends StatelessWidget {
body: Observer(
builder: (ctx) => ListView(
children: [
Center(
child: Text(
'Theme',
style: theme.textTheme.headline6,
),
),
_SectionHeading('Theme'),
for (final theme in ThemeMode.values)
RadioListTile<ThemeMode>(
value: theme,
@ -103,24 +98,21 @@ class _AccountsConfig extends StatelessWidget {
return ListView(
children: [
for (var entry in accountsStore.users.entries) ...[
Center(
child: Text(
entry.key,
style: theme.textTheme.subtitle2,
),
),
_SectionHeading(entry.key),
for (var username in entry.value.keys) ...[
ListTile(
trailing:
username == accountsStore.defaultUserFor(entry.key).name
? Icon(Icons.check_circle_outline)
? Icon(
Icons.check_circle_outline,
color: theme.accentColor,
)
: null,
selected: username ==
accountsStore.defaultUserFor(entry.key).name,
title: Text(username),
onLongPress: () {
accountsStore.setDefaultAccountFor(entry.key, username);
},
onTap: () {}, // TODO: go to managing account
),
],
@ -133,3 +125,19 @@ class _AccountsConfig extends StatelessWidget {
);
}
}
class _SectionHeading extends StatelessWidget {
final String text;
const _SectionHeading(this.text);
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Padding(
child: Text(text.toUpperCase(),
style: theme.textTheme.subtitle2.copyWith(color: theme.accentColor)),
padding: EdgeInsets.only(left: 20, top: 40),
);
}
}