Strengthen active chat marker and fade identity tint across selection
This commit is contained in:
@@ -76,7 +76,7 @@ class ChatCompactSidebar extends StatelessWidget {
|
||||
duration: MediaQuery.disableAnimationsOf(context)
|
||||
? Duration.zero
|
||||
: const Duration(milliseconds: 200),
|
||||
color: color.withValues(alpha: selected ? .24 : .07),
|
||||
color: selected ? Colors.transparent : color.withValues(alpha: .07),
|
||||
child: _button(
|
||||
context,
|
||||
chatSessionTitle(row),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'chat_color_palette.dart';
|
||||
|
||||
/// A chat's colour identifies it; this animated edge identifies where it is
|
||||
/// visible. The active chat has a stronger edge in both list presentations.
|
||||
@@ -20,7 +21,7 @@ class ChatVisibilityMarker extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Semantics(
|
||||
label: active
|
||||
label: visible && active
|
||||
? 'Active chat'
|
||||
: visible
|
||||
? 'Visible chat'
|
||||
@@ -29,12 +30,24 @@ class ChatVisibilityMarker extends StatelessWidget {
|
||||
key: ValueKey('chat-visibility-$sessionId'),
|
||||
duration: MediaQuery.disableAnimationsOf(context)
|
||||
? Duration.zero
|
||||
: const Duration(milliseconds: 200),
|
||||
: const Duration(milliseconds: 220),
|
||||
curve: Curves.easeInOut,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: AlignmentDirectional.centerStart,
|
||||
end: AlignmentDirectional.centerEnd,
|
||||
colors: [
|
||||
color.withValues(
|
||||
alpha: active ? (chatColorDarkSurface(context) ? .30 : .22) : 0,
|
||||
),
|
||||
color.withValues(alpha: active ? .06 : 0),
|
||||
],
|
||||
),
|
||||
),
|
||||
foregroundDecoration: BoxDecoration(
|
||||
border: BorderDirectional(
|
||||
start: visible
|
||||
? BorderSide(color: color, width: active ? 7 : 3)
|
||||
? BorderSide(color: color, width: active ? 10 : 3)
|
||||
: BorderSide.none,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -78,6 +78,7 @@ class ChatSessionRow extends StatelessWidget {
|
||||
key: Key('chat-row-$id'),
|
||||
cupertino: cupertino,
|
||||
selected: selected,
|
||||
selectedFill: Colors.transparent,
|
||||
emphasized: unread,
|
||||
divider: divider,
|
||||
onTap: () => onOpen(session),
|
||||
|
||||
@@ -69,6 +69,7 @@ class AppListRow extends StatelessWidget {
|
||||
this.selectionControl,
|
||||
this.tapKey,
|
||||
this.selected = false,
|
||||
this.selectedFill,
|
||||
this.emphasized = false,
|
||||
this.divider = true,
|
||||
this.compactWidth = kAppListRowCompactWidth,
|
||||
@@ -82,6 +83,9 @@ class AppListRow extends StatelessWidget {
|
||||
/// marks the open row, so the two never read as one another.
|
||||
final Color? accent;
|
||||
|
||||
/// Optional feature-specific selection surface, retaining selection semantics.
|
||||
final Color? selectedFill;
|
||||
|
||||
/// Retain identity tint while a feature supplies its own visibility marker.
|
||||
final bool showAccentBorder;
|
||||
|
||||
@@ -179,12 +183,13 @@ class AppListRow extends StatelessWidget {
|
||||
onLongPress: onLongPress,
|
||||
selected: selected,
|
||||
tint: tint,
|
||||
selectedFill: selectedFill,
|
||||
child: content,
|
||||
)
|
||||
: Material(
|
||||
key: appListRowSurfaceKey,
|
||||
color: selected
|
||||
? selectedColor(context, cupertino: false)
|
||||
? selectedFill ?? selectedColor(context, cupertino: false)
|
||||
: tint ?? Colors.transparent,
|
||||
child: InkWell(
|
||||
key: tapKey,
|
||||
@@ -395,11 +400,13 @@ class _CupertinoRowSurface extends StatefulWidget {
|
||||
required this.selected,
|
||||
this.onLongPress,
|
||||
this.tint,
|
||||
this.selectedFill,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
/// The unselected row's tint, transparent when null.
|
||||
final Color? tint;
|
||||
final Color? selectedFill;
|
||||
|
||||
final Key? tapKey;
|
||||
final VoidCallback? onTap;
|
||||
@@ -423,7 +430,8 @@ class _CupertinoRowSurfaceState extends State<_CupertinoRowSurface> {
|
||||
final color = _pressed
|
||||
? CupertinoColors.systemGrey4.resolveFrom(context)
|
||||
: widget.selected
|
||||
? AppListRow.selectedColor(context, cupertino: true)
|
||||
? widget.selectedFill ??
|
||||
AppListRow.selectedColor(context, cupertino: true)
|
||||
: widget.tint ?? const Color(0x00000000);
|
||||
final enabled = widget.onTap != null;
|
||||
return GestureDetector(
|
||||
|
||||
Reference in New Issue
Block a user