Skip to content

Commit

Permalink
Pulse compression
Browse files Browse the repository at this point in the history
  • Loading branch information
blopker committed Nov 3, 2024
1 parent e17a283 commit f771b51
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/log.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import 'package:logger/logger.dart';

final log = Logger();
final log = Logger(printer: SimplePrinter());
21 changes: 18 additions & 3 deletions lib/table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ class _FilesTableState extends State<FilesTable> with SignalsMixin {
int? _currentSortColumn;
bool _isSortAsc = true;
List<ImageFile> rows = [];
ColorTween compressIconTween =
ColorTween(begin: Colors.blue, end: Colors.amber);

@override
void initState() {
log.d('initState');
log.d('FilesTable initState');
super.initState();
createEffect(() {
setState(() {
Expand Down Expand Up @@ -51,12 +53,25 @@ class _FilesTableState extends State<FilesTable> with SignalsMixin {
child: Icon(Icons.pending, color: theme.disabledColor),
),
),
_ => Tooltip(
ImageFileStatus.compressing => Tooltip(
message: file.status.value,
child: SizedBox(
height: 20,
width: 20,
child: Icon(Icons.compress, color: theme.hintColor),
child: TweenAnimationBuilder<Color?>(
tween: compressIconTween,
duration: const Duration(seconds: 1),
onEnd: () {
setState(() {
compressIconTween = ColorTween(
begin: compressIconTween.end,
end: compressIconTween.begin,
);
}); // Trigger rebuild to restart animation
},
builder: (context, color, child) =>
Icon(Icons.compress, color: color),
),
),
),
};
Expand Down

0 comments on commit f771b51

Please sign in to comment.