fix(profile): its parts in cards, as Settings groups its own

The Profile ran the account, the inbox and the public profile together
in one list with lines between. Each is now a card of its own on the
lightly tinted background, as Settings groups its parts, and the
statistics' boxes are the same cards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-12 22:50:27 +02:00
commit ccab43d825
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
2 changed files with 67 additions and 59 deletions

View file

@ -8,6 +8,7 @@ import 'package:halkyon_learn_flutter/src/core/router/route_paths.dart';
import 'package:halkyon_learn_flutter/src/core/router/tab_visibility.dart';
import 'package:halkyon_learn_flutter/src/core/sync/widget/sync_trouble_badge.dart';
import 'package:halkyon_learn_flutter/src/core/theme/brand.dart';
import 'package:halkyon_learn_flutter/src/core/widget/section_card.dart';
import 'package:halkyon_learn_flutter/src/core/widget/top_gradient.dart';
import 'package:halkyon_learn_flutter/src/feature/auth/bloc/github_sign_in_bloc.dart';
import 'package:halkyon_learn_flutter/src/feature/auth/bloc/session_bloc.dart';
@ -32,7 +33,7 @@ class const ProfileScreen({super.key}) extends StatelessWidget {
)..add(const GitHubSignInEventStarted()),
child: TopGradient(
color: Brand.primary,
background: Theme.of(context).colorScheme.surface,
background: Theme.of(context).colorScheme.surfaceContainerLow,
child: DefaultTabController(
length: 2,
child: Scaffold(
@ -123,36 +124,48 @@ class const _Account() extends StatelessWidget {
child: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: readableContentMaxWidth),
// A card for each part, as Settings groups its own.
child: ListView(
// Room at the end for the navigation bar floating over the foot.
padding: EdgeInsets.fromLTRB(
16,
16,
16,
16 + MediaQuery.paddingOf(context).bottom,
12,
12,
12,
12 + MediaQuery.paddingOf(context).bottom,
),
children: [
Text(
isIdentified ? l10n.profileIdentified : l10n.profileAnonymous,
),
if (!isIdentified) ...[
const _GitHubSignIn(),
const SizedBox(height: 24),
Text(
l10n.publicProfileAnonymousHint,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
SectionCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
l10n.settingsAccount,
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(height: 4),
Text(
isIdentified
? l10n.profileIdentified
: l10n.profileAnonymous,
),
if (!isIdentified) ...[
const _GitHubSignIn(),
const SizedBox(height: 16),
Text(
l10n.publicProfileAnonymousHint,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
],
],
),
] else ...[
const SizedBox(height: 24),
const Divider(height: 1),
const SizedBox(height: 24),
const InboxSection(),
const SizedBox(height: 24),
const Divider(height: 1),
const SizedBox(height: 24),
const PublicProfileSection(),
),
if (isIdentified) ...[
const SizedBox(height: 12),
const SectionCard(child: InboxSection()),
const SizedBox(height: 12),
const SectionCard(child: PublicProfileSection()),
],
],
),

View file

@ -4,6 +4,7 @@ import 'package:halkyon_learn_flutter/l10n/app_localizations.dart';
import 'package:halkyon_learn_flutter/src/core/dependencies/person_scope.dart';
import 'package:halkyon_learn_flutter/src/core/l10n/study_time.dart';
import 'package:halkyon_learn_flutter/src/core/widget/app_loading_indicator.dart';
import 'package:halkyon_learn_flutter/src/core/widget/section_card.dart';
import 'package:halkyon_learn_flutter/src/feature/home/model/study_activity.dart';
import 'package:halkyon_learn_flutter/src/feature/statistics/bloc/statistics_cubit.dart';
import 'package:halkyon_learn_flutter/src/feature/statistics/model/study_statistics.dart';
@ -156,20 +157,17 @@ class const _Totals({required final StudyStatistics statistics})
Widget total(String label, Duration time) => Expanded(
child: _Total(label: label, value: studyTimeText(l10n, time)),
);
return Card(
margin: EdgeInsets.zero,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 16),
child: IntrinsicHeight(
child: Row(
children: [
total(l10n.statisticsTotal, statistics.total),
const VerticalDivider(width: 1),
total(l10n.statisticsPerDay, statistics.perDay),
const VerticalDivider(width: 1),
total(l10n.statisticsRecord, statistics.record),
],
),
return SectionCard(
padding: const EdgeInsets.symmetric(vertical: 16),
child: IntrinsicHeight(
child: Row(
children: [
total(l10n.statisticsTotal, statistics.total),
const VerticalDivider(width: 1),
total(l10n.statisticsPerDay, statistics.perDay),
const VerticalDivider(width: 1),
total(l10n.statisticsRecord, statistics.record),
],
),
),
);
@ -226,26 +224,23 @@ class const _ChartCard({
final muted = theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.onSurfaceVariant,
);
return Card(
margin: EdgeInsets.zero,
child: Padding(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title, style: theme.textTheme.titleMedium),
const SizedBox(height: 2),
Text(info, style: muted),
const SizedBox(height: 12),
Text(picked, style: theme.textTheme.labelLarge),
if (legend case final legend?) ...[
const SizedBox(height: 8),
legend,
],
const SizedBox(height: 12),
chart,
return SectionCard(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title, style: theme.textTheme.titleMedium),
const SizedBox(height: 2),
Text(info, style: muted),
const SizedBox(height: 12),
Text(picked, style: theme.textTheme.labelLarge),
if (legend case final legend?) ...[
const SizedBox(height: 8),
legend,
],
),
const SizedBox(height: 12),
chart,
],
),
);
}