fix(studyset): an empty tab says so in its middle, as empty paths do

With no flashcards, notes or files yet, the tab said so in an outlined
box at its top, the icon at its start, while the study plan with no
paths says it in the middle of what is left, the icon above. Every
empty tab now says it the way the paths do.

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:45:00 +02:00
commit db4b4df200
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -15,7 +15,9 @@ import 'package:halkyon_learn_flutter/src/core/theme/theme_extras.dart';
import 'package:halkyon_learn_flutter/src/core/widget/app_loading_indicator.dart';
import 'package:halkyon_learn_flutter/src/core/widget/collapsing_row.dart';
import 'package:halkyon_learn_flutter/src/core/widget/count_badge.dart';
import 'package:halkyon_learn_flutter/src/core/widget/empty_list_message.dart';
import 'package:halkyon_learn_flutter/src/core/widget/reorder_toggle.dart';
import 'package:halkyon_learn_flutter/src/core/widget/sliver_centered.dart';
import 'package:halkyon_learn_flutter/src/feature/card/bloc/card_list_bloc.dart';
import 'package:halkyon_learn_flutter/src/feature/card/widget/card_list.dart';
import 'package:halkyon_learn_flutter/src/feature/learning_path/bloc/path_list_bloc.dart';
@ -510,53 +512,17 @@ class const _SliverSectionLoading() extends StatelessWidget {
);
}
/// A section with nothing in it yet: what it would hold, and how to add
/// it, in an outlined box.
/// A tab with nothing in it yet: what it would hold, and how to add it,
/// in the middle of what is left, as an empty list of paths says it.
class const _SliverEmptySection({
required final IconData icon,
required final String title,
required final String hint,
}) extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colors = theme.colorScheme;
return SliverToBoxAdapter(
child: Padding(
padding: const EdgeInsets.fromLTRB(12, 4, 12, 4),
child: DecoratedBox(
decoration: BoxDecoration(
border: Border.all(color: colors.outlineVariant),
borderRadius: BorderRadius.circular(12),
),
child: Padding(
padding: const EdgeInsets.all(16),
child: Row(
children: [
Icon(icon, size: 28, color: colors.onSurfaceVariant),
const SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title, style: theme.textTheme.titleSmall),
const SizedBox(height: 2),
Text(
hint,
style: theme.textTheme.bodySmall?.copyWith(
color: colors.onSurfaceVariant,
),
),
],
),
),
],
),
),
),
),
);
}
Widget build(BuildContext context) => SliverCentered(
child: EmptyListMessage(icon: icon, title: title, hint: hint),
);
}
/// The studyset [studysetId]'s progress, with everything inside it: how much