Files
GroundedHelper/frontend/lib/Grounded/designs/text/Text.dart
alvocool 4cd3f6c038 Add Coach, take the reference's colours and copy its nav and motion
Coach is the centre tab: questions about routines, slips, streak, today,
active time and debt, answered on the device from the user's own data,
with a target bar chart and buttons that start routines or open the right
screen. The palette moves to neutral grey, near-black and one orange
accent, and Home's header becomes a light panel. The nav is now
overlapping frosted circles whose active disc pops forward, and tabs fade
and rise in on switch. Goals leaves the nav for Coach and stays one tap
away in Home's category row.

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

71 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
import '../../about/internal/application/TextType.dart';
import '../../utils/Colors.dart';
import '../Component.dart';
/// The only way display copy is rendered. Raw Text/TextStyle is never used for
/// user-facing copy.
Widget text(
String text,
double textSize,
TextType type, {
Color? color,
TextAlign? align,
int? maxLines,
TextOverflow? overflow,
double? letterSpacing,
double? height,
double? wordSpacing,
TextDecoration? decoration,
FontWeight? weight,
}) {
return Text(
text,
textAlign: align ?? TextAlign.left,
maxLines: maxLines,
overflow: overflow,
style: TextStyle(
decoration: decoration ?? TextDecoration.none,
color: color ?? colorPrimaryDark,
fontSize: textSize,
fontFamily: getTextType(type),
letterSpacing: letterSpacing,
height: height,
wordSpacing: wordSpacing,
fontWeight: weight,
),
);
}
/// Copy with **bold** phrases marked inline, for answers that need to stress
/// a number. Regular for the body, Medium for the marked parts.
Widget markedText(
String marked,
double textSize, {
Color? color,
double? height,
}) {
final List<String> parts = marked.split("**");
return Text.rich(
TextSpan(
children: <InlineSpan>[
for (int index = 0; index < parts.length; index++)
TextSpan(
text: parts[index],
style: TextStyle(
fontFamily: getTextType(
index.isOdd ? TextType.Medium : TextType.Regular),
),
),
],
),
style: TextStyle(
color: color ?? colorPrimaryDark,
fontSize: textSize,
height: height,
),
);
}