Skip to content

Commit

Permalink
msglist [nfc]: Move DesignVariables.editedMovedMarkerCollapsed to here
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed Jul 27, 2024
1 parent 0089ab6 commit ddff65d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lib/widgets/edit_state_marker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:flutter/material.dart';

import '../api/model/model.dart';
import 'icons.dart';
import 'message_list.dart';
import 'text.dart';
import 'theme.dart';

class EditStateMarker extends StatelessWidget {
const EditStateMarker({
Expand Down Expand Up @@ -44,7 +44,7 @@ class _EditStateMarkerPill extends StatelessWidget {

@override
Widget build(BuildContext context) {
final designVariables = DesignVariables.of(context);
final messageListTheme = MessageListTheme.of(context);

final IconData icon;
final Offset offset;
Expand All @@ -69,6 +69,6 @@ class _EditStateMarkerPill extends StatelessWidget {
child: Transform.translate(
offset: offset,
child: Icon(
icon, size: 16, color: designVariables.editedMovedMarkerCollapsed)));
icon, size: 16, color: messageListTheme.editedMovedMarkerCollapsed)));
}
}
8 changes: 8 additions & 0 deletions lib/widgets/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
dateSeparator: Colors.black,
dateSeparatorText: const HSLColor.fromAHSL(0.75, 0, 0, 0.15).toColor(),
dmRecipientHeaderBg: const HSLColor.fromAHSL(1, 46, 0.35, 0.93).toColor(),
editedMovedMarkerCollapsed: const Color.fromARGB(128, 146, 167, 182),
messageTimestamp: const HSLColor.fromAHSL(0.8, 0, 0, 0.2).toColor(),
recipientHeaderText: const HSLColor.fromAHSL(1, 0, 0, 0.15).toColor(),
senderBotIcon: const HSLColor.fromAHSL(1, 180, 0.08, 0.65).toColor(),
Expand All @@ -57,6 +58,8 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
dateSeparator: Colors.white,
dateSeparatorText: const HSLColor.fromAHSL(0.75, 0, 0, 1).toColor(),
dmRecipientHeaderBg: const HSLColor.fromAHSL(1, 46, 0.15, 0.2).toColor(),
// TODO(#95) need dark-theme color
editedMovedMarkerCollapsed: const Color.fromARGB(128, 146, 167, 182),
messageTimestamp: const HSLColor.fromAHSL(0.6, 0, 0, 1).toColor(),
recipientHeaderText: const HSLColor.fromAHSL(0.8, 0, 0, 1).toColor(),
senderBotIcon: const HSLColor.fromAHSL(1, 180, 0.05, 0.5).toColor(),
Expand All @@ -81,6 +84,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
required this.dateSeparator,
required this.dateSeparatorText,
required this.dmRecipientHeaderBg,
required this.editedMovedMarkerCollapsed,
required this.messageTimestamp,
required this.recipientHeaderText,
required this.senderBotIcon,
Expand All @@ -105,6 +109,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
final Color dateSeparator;
final Color dateSeparatorText;
final Color dmRecipientHeaderBg;
final Color editedMovedMarkerCollapsed;
final Color messageTimestamp;
final Color recipientHeaderText;
final Color senderBotIcon;
Expand All @@ -120,6 +125,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
Color? dateSeparator,
Color? dateSeparatorText,
Color? dmRecipientHeaderBg,
Color? editedMovedMarkerCollapsed,
Color? messageTimestamp,
Color? recipientHeaderText,
Color? senderBotIcon,
Expand All @@ -134,6 +140,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
dateSeparator: dateSeparator ?? this.dateSeparator,
dateSeparatorText: dateSeparatorText ?? this.dateSeparatorText,
dmRecipientHeaderBg: dmRecipientHeaderBg ?? this.dmRecipientHeaderBg,
editedMovedMarkerCollapsed: editedMovedMarkerCollapsed ?? this.editedMovedMarkerCollapsed,
messageTimestamp: messageTimestamp ?? this.messageTimestamp,
recipientHeaderText: recipientHeaderText ?? this.recipientHeaderText,
senderBotIcon: senderBotIcon ?? this.senderBotIcon,
Expand All @@ -155,6 +162,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
dateSeparator: Color.lerp(dateSeparator, other.dateSeparator, t)!,
dateSeparatorText: Color.lerp(dateSeparatorText, other.dateSeparatorText, t)!,
dmRecipientHeaderBg: Color.lerp(streamMessageBgDefault, other.dmRecipientHeaderBg, t)!,
editedMovedMarkerCollapsed: Color.lerp(editedMovedMarkerCollapsed, other.editedMovedMarkerCollapsed, t)!,
messageTimestamp: Color.lerp(messageTimestamp, other.messageTimestamp, t)!,
recipientHeaderText: Color.lerp(recipientHeaderText, other.recipientHeaderText, t)!,
senderBotIcon: Color.lerp(senderBotIcon, other.senderBotIcon, t)!,
Expand Down
8 changes: 0 additions & 8 deletions lib/widgets/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
title: const Color(0xff1a1a1a),
streamColorSwatches: StreamColorSwatches.light,
star: const HSLColor.fromAHSL(0.5, 47, 1, 0.41).toColor(),
editedMovedMarkerCollapsed: const Color.fromARGB(128, 146, 167, 182),
);

DesignVariables.dark() :
Expand All @@ -149,8 +148,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
streamColorSwatches: StreamColorSwatches.dark,
// TODO(#95) unchanged in dark theme?
star: const HSLColor.fromAHSL(0.5, 47, 1, 0.41).toColor(),
// TODO(#95) need dark-theme color
editedMovedMarkerCollapsed: const Color.fromARGB(128, 146, 167, 182),
);

DesignVariables._({
Expand All @@ -161,7 +158,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
required this.title,
required this.streamColorSwatches,
required this.star,
required this.editedMovedMarkerCollapsed,
});

/// The [DesignVariables] from the context's active theme.
Expand All @@ -185,7 +181,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {

// Not named variables in Figma; taken from older Figma drafts, or elsewhere.
final Color star;
final Color editedMovedMarkerCollapsed;

@override
DesignVariables copyWith({
Expand All @@ -196,7 +191,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
Color? title,
StreamColorSwatches? streamColorSwatches,
Color? star,
Color? editedMovedMarkerCollapsed,
}) {
return DesignVariables._(
bgTopBar: bgTopBar ?? this.bgTopBar,
Expand All @@ -206,7 +200,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
title: title ?? this.title,
streamColorSwatches: streamColorSwatches ?? this.streamColorSwatches,
star: star ?? this.star,
editedMovedMarkerCollapsed: editedMovedMarkerCollapsed ?? this.editedMovedMarkerCollapsed,
);
}

Expand All @@ -223,7 +216,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
title: Color.lerp(title, other.title, t)!,
streamColorSwatches: StreamColorSwatches.lerp(streamColorSwatches, other.streamColorSwatches, t),
star: Color.lerp(star, other.star, t)!,
editedMovedMarkerCollapsed: Color.lerp(editedMovedMarkerCollapsed, other.editedMovedMarkerCollapsed, t)!,
);
}
}
Expand Down

0 comments on commit ddff65d

Please sign in to comment.