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( body: Observer(
builder: (ctx) => ListView( builder: (ctx) => ListView(
children: [ children: [
Center( _SectionHeading('Theme'),
child: Text(
'Theme',
style: theme.textTheme.headline6,
),
),
for (final theme in ThemeMode.values) for (final theme in ThemeMode.values)
RadioListTile<ThemeMode>( RadioListTile<ThemeMode>(
value: theme, value: theme,
@ -103,24 +98,21 @@ class _AccountsConfig extends StatelessWidget {
return ListView( return ListView(
children: [ children: [
for (var entry in accountsStore.users.entries) ...[ for (var entry in accountsStore.users.entries) ...[
Center( _SectionHeading(entry.key),
child: Text(
entry.key,
style: theme.textTheme.subtitle2,
),
),
for (var username in entry.value.keys) ...[ for (var username in entry.value.keys) ...[
ListTile( ListTile(
trailing: trailing:
username == accountsStore.defaultUserFor(entry.key).name username == accountsStore.defaultUserFor(entry.key).name
? Icon(Icons.check_circle_outline) ? Icon(
Icons.check_circle_outline,
color: theme.accentColor,
)
: null, : null,
selected: username ==
accountsStore.defaultUserFor(entry.key).name,
title: Text(username), title: Text(username),
onLongPress: () { onLongPress: () {
accountsStore.setDefaultAccountFor(entry.key, username); accountsStore.setDefaultAccountFor(entry.key, username);
}, },
onTap: () {}, // TODO: go to managing account 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),
);
}
}