Rebuild Home around a forest header with streak, score and water
Home now opens on a deep green header: greeting, a Today / Weekly toggle, a seven-day streak with a leaf on every kept day, minutes held with a + ring, plan thumbnails, the report-card letter as the score, and one bar per commitment class (weekly view swaps in per-day bars and class rates). The + opens an "Add to today" sheet over the blurred day. A water tracker sits below the header, kept on the device. The nav marks the selected tab as a filled block and drops the side action button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KhQh614DMeYoQEH9SoMRUw
This commit is contained in:
@@ -7,22 +7,23 @@ import 'text/Text.dart';
|
||||
|
||||
typedef NavEntry = ({IconData icon, String label, VoidCallback onTap});
|
||||
|
||||
/// The floating glass tab bar with the dark round action button beside it.
|
||||
/// The floating tab bar: the selected tab is a filled night block, the rest
|
||||
/// sit quietly on white. An optional dark action button can sit beside it.
|
||||
class FloatingNav extends StatelessWidget {
|
||||
final List<NavEntry> entries;
|
||||
|
||||
final int selected;
|
||||
|
||||
final IconData actionIcon;
|
||||
final IconData? actionIcon;
|
||||
|
||||
final VoidCallback onAction;
|
||||
final VoidCallback? onAction;
|
||||
|
||||
const FloatingNav({
|
||||
super.key,
|
||||
required this.entries,
|
||||
required this.selected,
|
||||
required this.actionIcon,
|
||||
required this.onAction,
|
||||
this.actionIcon,
|
||||
this.onAction,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -58,6 +59,7 @@ class FloatingNav extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (onAction != null) ...[
|
||||
const SizedBox(width: 10),
|
||||
GestureDetector(
|
||||
onTap: onAction,
|
||||
@@ -81,6 +83,7 @@ class FloatingNav extends StatelessWidget {
|
||||
child: Icon(actionIcon, size: 24, color: colorLime),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -94,9 +97,9 @@ class FloatingNav extends StatelessWidget {
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 220),
|
||||
curve: Curves.easeOutCubic,
|
||||
padding: const EdgeInsets.symmetric(vertical: 9),
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: active ? colorWhite : colorWhite.withValues(alpha: 0.0),
|
||||
color: active ? colorHeaderBottom : colorWhite.withValues(alpha: 0.0),
|
||||
borderRadius: BorderRadius.zero,
|
||||
boxShadow: active
|
||||
? const [
|
||||
@@ -112,10 +115,10 @@ class FloatingNav extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(entry.icon,
|
||||
size: 23, color: active ? colorInk : colorInkSoft),
|
||||
size: 23, color: active ? colorWhite : colorInkSoft),
|
||||
const SizedBox(height: 4),
|
||||
text(entry.label, 10, active ? TextType.Medium : TextType.Regular,
|
||||
color: active ? colorInk : colorInkSoft, maxLines: 1),
|
||||
color: active ? colorWhite : colorInkSoft, maxLines: 1),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -85,10 +85,12 @@ Widget inputField(
|
||||
Widget quickAddField(
|
||||
TextEditingController controller,
|
||||
String hint,
|
||||
ValueChanged<String> onSubmitted,
|
||||
) {
|
||||
ValueChanged<String> onSubmitted, {
|
||||
FocusNode? focusNode,
|
||||
}) {
|
||||
return TextField(
|
||||
controller: controller,
|
||||
focusNode: focusNode,
|
||||
onSubmitted: onSubmitted,
|
||||
textInputAction: TextInputAction.done,
|
||||
style: TextStyle(
|
||||
|
||||
Reference in New Issue
Block a user