Your avatar is your photo, picked from the device by tapping it on Home or from a new Profile photo row in Settings, shrunk to 256 px and kept on the phone (there is no upload endpoint yet). Group members show the photo the server sends in a new `photo` field, everywhere avatars appear. Without a photo, an initial on a neutral disc. Mock mode bundles free Unsplash portraits for the sample people. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KhQh614DMeYoQEH9SoMRUw
71 lines
1.7 KiB
Dart
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,
|
|
),
|
|
);
|
|
}
|