google preperation 1

This commit is contained in:
2026-10-26 20:48:16 +01:00
parent 9a65ff7ad4
commit 3b50cb0fe9
47 changed files with 4969 additions and 4580 deletions
+73
View File
@@ -0,0 +1,73 @@
import 'package:flutter/material.dart';
import '../theme/app_theme.dart';
class BarTab {
final String label;
final IconData icon;
const BarTab(this.label, this.icon);
}
/// Tab strip that continues the dark app bar (Koledar/Stiki, Knjiga filters).
/// The selected tab is a white pill; [trailing] sits at the right end.
class BarTabs extends StatelessWidget {
final List<BarTab> tabs;
final int selected;
final ValueChanged<int> onSelect;
final Widget? trailing;
const BarTabs({
super.key,
required this.tabs,
required this.selected,
required this.onSelect,
this.trailing,
});
@override
Widget build(BuildContext context) {
return Container(
color: AppTheme.bar,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
child: Row(
children: [
for (int i = 0; i < tabs.length; i++) ...[
if (i > 0) const SizedBox(width: 6),
Expanded(child: _tab(tabs[i], i == selected, () => onSelect(i))),
],
if (trailing != null) trailing!,
],
),
);
}
Widget _tab(BarTab tab, bool active, VoidCallback onTap) {
final color = active ? Colors.black : Colors.grey[400];
return GestureDetector(
onTap: onTap,
child: Container(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 8),
decoration: BoxDecoration(
color: active ? Colors.white : Colors.transparent,
borderRadius: BorderRadius.circular(10),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Icon(tab.icon, color: color, size: 18),
const SizedBox(width: 6),
Flexible(
child: Text(
tab.label,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: color),
),
),
],
),
),
);
}
}