Files
GroundedHelper/frontend/lib/Grounded/designs/input/CountStepper.dart
alvocool d3431ca5de Switch to Inter, round the corners softly and make the nav switch tabs
Inter replaces General Sans (Inter Display for titles and big numbers).
Corners come back from before the squaring commit, scaled to a soft set
(16 cards, 14 buttons, 12 rows, 8 chips) and applied to the screens built
since. The nav is now a cluster of round frosted buttons that switches
Today, Routines, Goals, Groups and Progress in place inside Home: no
pushed pages, no back arrows, and Android back returns to Today.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KhQh614DMeYoQEH9SoMRUw
2026-11-09 07:08:46 +03:00

64 lines
1.8 KiB
Dart

import 'package:flutter/cupertino.dart';
import '../../about/internal/application/TextType.dart';
import '../../utils/Colors.dart';
import '../text/Text.dart';
/// A labelled minus / value / plus control for sets, reps and seconds.
/// Numbers are stepped, not typed — nobody wants a keyboard mid-routine-edit.
Widget countStepper(
String label,
String value, {
required VoidCallback onMinus,
required VoidCallback onPlus,
bool canMinus = true,
}) {
return Container(
padding: const EdgeInsets.fromLTRB(14, 10, 8, 10),
decoration: BoxDecoration(
color: colorWhite,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: colorBorder, width: 1),
),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
text(label.toUpperCase(), 9, TextType.Bold,
color: colorGrey2, letterSpacing: 1.0),
const SizedBox(height: 4),
text(value, 17, TextType.Medium, color: colorPrimaryDark),
],
),
),
_stepButton(CupertinoIcons.minus, canMinus ? onMinus : null),
const SizedBox(width: 6),
_stepButton(CupertinoIcons.plus, onPlus),
],
),
);
}
Widget _stepButton(IconData icon, VoidCallback? onTap) {
final bool enabled = onTap != null;
return GestureDetector(
onTap: onTap,
behavior: HitTestBehavior.opaque,
child: Container(
width: 34,
height: 34,
alignment: Alignment.center,
decoration: BoxDecoration(
color: enabled ? colorSecondary : colorInset,
borderRadius: BorderRadius.circular(10),
),
child: Icon(icon,
size: 14, color: enabled ? colorPrimaryDark : colorGrey),
),
);
}