54 lines
1.5 KiB
Dart
54 lines
1.5 KiB
Dart
|
|
import 'package:enaklo_pos/core/components/spaces.dart';
|
||
|
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
class RefundReasonTile extends StatelessWidget {
|
||
|
|
final bool isSelected;
|
||
|
|
final Map<String, dynamic> reason;
|
||
|
|
final Function() onTap;
|
||
|
|
const RefundReasonTile({
|
||
|
|
super.key,
|
||
|
|
required this.isSelected,
|
||
|
|
required this.reason,
|
||
|
|
required this.onTap,
|
||
|
|
});
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return GestureDetector(
|
||
|
|
onTap: onTap,
|
||
|
|
child: AnimatedContainer(
|
||
|
|
duration: Duration(milliseconds: 300),
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
color:
|
||
|
|
isSelected ? reason['color'].withOpacity(0.2) : Colors.grey[100],
|
||
|
|
borderRadius: BorderRadius.circular(16),
|
||
|
|
border: Border.all(
|
||
|
|
color: isSelected ? reason['color'] : Colors.transparent,
|
||
|
|
width: 2,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
child: Column(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
||
|
|
children: [
|
||
|
|
Icon(
|
||
|
|
reason['icon'],
|
||
|
|
color: isSelected ? reason['color'] : Colors.grey[600],
|
||
|
|
size: 20,
|
||
|
|
),
|
||
|
|
SpaceHeight(4),
|
||
|
|
Text(
|
||
|
|
reason['value'],
|
||
|
|
style: TextStyle(
|
||
|
|
fontSize: 10,
|
||
|
|
fontWeight: FontWeight.w600,
|
||
|
|
color: isSelected ? reason['color'] : Colors.grey[600],
|
||
|
|
),
|
||
|
|
textAlign: TextAlign.center,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|