Remove Cupertino chat transcript branches
Keep the existing Material transcript path while preserving public Cupertino parameters for callers. Narrow transcript tests to the Material-only behavior and remove Cupertino-only fixtures.
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../sessions/chat_adaptive.dart';
|
||||
|
||||
/// The small, non-selectable metadata line for a recorded chat message time.
|
||||
/// The visible value includes a local date so messages from different days are
|
||||
/// not ambiguous; the tooltip and semantics expose the full localized value.
|
||||
@@ -21,38 +18,18 @@ class ChatMessageTimestamp extends StatelessWidget {
|
||||
).toLocal();
|
||||
if (instant == null) return const SizedBox.shrink();
|
||||
|
||||
final cupertino =
|
||||
chatControlsStyleOf(context) == ChatControlsStyle.cupertino;
|
||||
final material = Localizations.of<MaterialLocalizations>(
|
||||
context,
|
||||
MaterialLocalizations,
|
||||
final material = MaterialLocalizations.of(context);
|
||||
final time = material.formatTimeOfDay(
|
||||
TimeOfDay.fromDateTime(instant),
|
||||
alwaysUse24HourFormat: true,
|
||||
);
|
||||
final String date, time, full;
|
||||
if (material != null) {
|
||||
time = material.formatTimeOfDay(
|
||||
TimeOfDay.fromDateTime(instant),
|
||||
alwaysUse24HourFormat: true,
|
||||
);
|
||||
date = '${instant.day} ${material.formatMonthYear(instant)}';
|
||||
full = '$date, $time';
|
||||
} else {
|
||||
final local = CupertinoLocalizations.of(context);
|
||||
time =
|
||||
'${local.datePickerHour(instant.hour).padLeft(2, '0')}:${local.datePickerMinute(instant.minute)}';
|
||||
date =
|
||||
'${local.datePickerDayOfMonth(instant.day)} ${local.datePickerMonth(instant.month)} ${local.datePickerYear(instant.year)}';
|
||||
full = '$date, $time';
|
||||
}
|
||||
final style =
|
||||
(cupertino
|
||||
? CupertinoTheme.of(context).textTheme.textStyle
|
||||
: (Theme.of(context).textTheme.bodySmall ?? const TextStyle()))
|
||||
.copyWith(
|
||||
color: cupertino
|
||||
? CupertinoColors.secondaryLabel.resolveFrom(context)
|
||||
: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
fontSize: 12,
|
||||
);
|
||||
final date = '${instant.day} ${material.formatMonthYear(instant)}';
|
||||
final full = '$date, $time';
|
||||
final style = (Theme.of(context).textTheme.bodySmall ?? const TextStyle())
|
||||
.copyWith(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
fontSize: 12,
|
||||
);
|
||||
final label = 'Sent $full';
|
||||
final text = Text('$date · $time', style: style);
|
||||
return SelectionContainer.disabled(
|
||||
|
||||
Reference in New Issue
Block a user