small updates

This commit is contained in:
2026-10-27 14:03:31 +01:00
parent 3b50cb0fe9
commit 9d9e0c77f2
8 changed files with 391 additions and 356 deletions
+57
View File
@@ -0,0 +1,57 @@
import 'package:flutter/material.dart';
/// Help bottom sheet: one icon + sentence per control, close button at the end.
/// Shared by Knjiga, camera and stream so their info buttons look the same.
void showHelpSheet(
BuildContext context, {
required List<(IconData, String)> items,
required Color accent,
required String Function(String) t,
}) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (sheet) => SafeArea(
child: SingleChildScrollView(
padding: const EdgeInsets.fromLTRB(24, 8, 24, 16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(t('Help'),
style: const TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold)),
const SizedBox(height: 16),
for (final (icon, text) in items)
Padding(
padding: const EdgeInsets.only(bottom: 14),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(icon, color: accent, size: 20),
const SizedBox(width: 12),
Expanded(
child: Text(t(text),
style: const TextStyle(
color: Colors.white, fontSize: 14, height: 1.3)),
),
],
),
),
const SizedBox(height: 4),
SizedBox(
width: double.infinity,
child: FilledButton(
style: FilledButton.styleFrom(backgroundColor: accent),
onPressed: () => Navigator.pop(sheet),
child: Text(t('Close')),
),
),
],
),
),
),
);
}