forked from Nexus/nexus
rename FlashWrapper to HighlightWrapper
This commit is contained in:
parent
562ce5d4ff
commit
e15d947fac
2 changed files with 13 additions and 13 deletions
20
lib/widgets/highlight_wrapper.dart
Normal file
20
lib/widgets/highlight_wrapper.dart
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import "package:flutter/material.dart";
|
||||
|
||||
class HighlightWrapper extends StatelessWidget {
|
||||
final Widget child;
|
||||
final bool isHighlighted;
|
||||
const HighlightWrapper(this.child, {this.isHighlighted = false, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => ClipRRect(
|
||||
borderRadius: .all(.circular(12)),
|
||||
child: AnimatedContainer(
|
||||
padding: isHighlighted ? .all(8) : .all(0),
|
||||
color: isHighlighted
|
||||
? Theme.of(context).colorScheme.onSurface.withAlpha(50)
|
||||
: Colors.transparent,
|
||||
duration: .new(milliseconds: 250),
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue