mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-27 05:49:21 +00:00
33 lines
718 B
Dart
33 lines
718 B
Dart
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
class Breathing extends StatefulWidget {
|
||
|
const Breathing({super.key, required this.child});
|
||
|
|
||
|
final Widget child;
|
||
|
|
||
|
@override
|
||
|
State<Breathing> createState() => _BreathingState();
|
||
|
}
|
||
|
|
||
|
class _BreathingState extends State<Breathing> {
|
||
|
bool _hovering = false;
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return MouseRegion(
|
||
|
onEnter: (_) => setState(
|
||
|
() => _hovering = true,
|
||
|
),
|
||
|
onExit: (_) => setState(
|
||
|
() => _hovering = false,
|
||
|
),
|
||
|
child: AnimatedScale(
|
||
|
scale: _hovering ? 1.00 : 0.98,
|
||
|
duration: const Duration(
|
||
|
milliseconds: 200,
|
||
|
),
|
||
|
child: widget.child,
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|