Adds sleep/energy/positivity/self-worth tracking columns to the database (schema v2 migration), a new 5-option StepScale widget, per-answer chips at the top of the screen, a 2×2 activity grid chip, and a full step-by-step wizard flow: mood → sleep (first entry today only) → energy → positivity → self-worth → activities → review+save.
49 lines
1.2 KiB
Dart
49 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// A single 60 px circular answer chip showing either an emoji or short text.
|
|
class AnswerChip extends StatelessWidget {
|
|
final String label;
|
|
final Color backgroundColor;
|
|
final VoidCallback? onTap;
|
|
|
|
const AnswerChip({
|
|
super.key,
|
|
required this.label,
|
|
required this.backgroundColor,
|
|
this.onTap,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: onTap,
|
|
child: AnimatedContainer(
|
|
duration: const Duration(milliseconds: 250),
|
|
curve: Curves.easeOut,
|
|
width: 60,
|
|
height: 60,
|
|
decoration: BoxDecoration(
|
|
color: backgroundColor,
|
|
shape: BoxShape.circle,
|
|
boxShadow: onTap != null
|
|
? [
|
|
BoxShadow(
|
|
color: backgroundColor.withValues(alpha: 0.4),
|
|
blurRadius: 8,
|
|
offset: const Offset(0, 2),
|
|
)
|
|
]
|
|
: null,
|
|
),
|
|
child: Center(
|
|
child: Text(
|
|
label,
|
|
style: const TextStyle(fontSize: 22),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|