TF-694 Fix continuous flashing effect when hovering avatar icon
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:core/core.dart';
|
import 'package:core/core.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -30,8 +29,6 @@ class EmailTileBuilder {
|
|||||||
|
|
||||||
bool isHoverItem = false;
|
bool isHoverItem = false;
|
||||||
bool isHoverIcon = false;
|
bool isHoverIcon = false;
|
||||||
Timer? _debounceTimeIcon;
|
|
||||||
Timer? _debounceTimeItem;
|
|
||||||
|
|
||||||
EmailTileBuilder(
|
EmailTileBuilder(
|
||||||
this._context,
|
this._context,
|
||||||
@@ -51,34 +48,19 @@ class EmailTileBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _onHoverIconChanged(bool isHover, StateSetter setState) {
|
void _onHoverIconChanged(bool isHover, StateSetter setState) {
|
||||||
if (_debounceTimeIcon?.isActive ?? false) _debounceTimeIcon?.cancel();
|
setState(() => isHoverIcon = isHover);
|
||||||
_debounceTimeIcon = Timer(const Duration(milliseconds: 100), () {
|
|
||||||
setState(() {
|
|
||||||
isHoverIcon = isHover;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onHoverItemChanged(bool isHover, StateSetter setState) {
|
void _onHoverItemChanged(bool isHover, StateSetter setState) {
|
||||||
if (_debounceTimeItem?.isActive ?? false) _debounceTimeItem?.cancel();
|
setState(() => isHoverItem = isHover);
|
||||||
_debounceTimeItem = Timer(const Duration(milliseconds: 200), () {
|
|
||||||
setState(() {
|
|
||||||
isHoverItem = isHover;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget build() {
|
Widget build() {
|
||||||
return Theme(
|
return ResponsiveWidget(
|
||||||
key: const Key('thread_tile'),
|
responsiveUtils: _responsiveUtils,
|
||||||
data: ThemeData(splashColor: Colors.transparent, highlightColor: Colors.transparent),
|
mobile: _wrapContainerForTile(_buildListTile()),
|
||||||
child: ResponsiveWidget(
|
tablet: _wrapContainerForTile(_buildListTileTablet()),
|
||||||
responsiveUtils: _responsiveUtils,
|
desktop: _wrapContainerForTile(_buildListTileForDesktop()),
|
||||||
mobile: _wrapContainerForTile(_buildListTile()),
|
|
||||||
tablet: _wrapContainerForTile(_buildListTileTablet()),
|
|
||||||
tabletLarge: _wrapContainerForTile(_buildListTileTablet()),
|
|
||||||
desktop: _wrapContainerForTile(_buildListTileForDesktop()),
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,6 +584,9 @@ class EmailTileBuilder {
|
|||||||
|| (_responsiveUtils.isMobile(_context) && _selectModeAll == SelectMode.ACTIVE)) {
|
|| (_responsiveUtils.isMobile(_context) && _selectModeAll == SelectMode.ACTIVE)) {
|
||||||
return Container(
|
return Container(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
|
width: iconSize ?? 48,
|
||||||
|
height: iconSize ?? 48,
|
||||||
|
alignment: Alignment.center,
|
||||||
padding: _responsiveUtils.isDesktop(_context)
|
padding: _responsiveUtils.isDesktop(_context)
|
||||||
? const EdgeInsets.symmetric(horizontal: 4)
|
? const EdgeInsets.symmetric(horizontal: 4)
|
||||||
: const EdgeInsets.all(12),
|
: const EdgeInsets.all(12),
|
||||||
@@ -634,7 +619,6 @@ class EmailTileBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FontWeight _buildFontForReadEmail() {
|
FontWeight _buildFontForReadEmail() {
|
||||||
return !_presentationEmail.hasRead ? FontWeight.w600 : FontWeight.normal;
|
return !_presentationEmail.hasRead ? FontWeight.w600 : FontWeight.normal;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user