1import 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3import 'package:go_router/go_router.dart';
4import 'dart:math' as math;
20class _DashboardCardState
extends State<DashboardCard>
21 with SingleTickerProviderStateMixin {
30 duration:
const Duration(milliseconds: 150),
36 curve: Curves.easeInOut,
48 if (widget.item.isEnabled ??
true) {
55 if (widget.item.isEnabled ??
true) {
59 if (widget.item.onTap != null) {
61 }
else if (widget.item.path != null) {
62 context.push(widget.item.path!);
73 Widget
build(BuildContext context) {
74 final size = widget.
size ?? 170.sp;
76 return AnimatedBuilder(
78 builder: (context,
child) => Transform.scale(
82 child: GestureDetector(
89 decoration: BoxDecoration(
90 color: (widget.item.isEnabled ??
true) ? Colors.white : Colors.grey.withValues(alpha: 0.3),
91 shape: BoxShape.circle,
94 color: Colors.black.withValues(alpha: 0.08),
96 offset:
const Offset(0, 8),
105 size: Size(size, size),
106 painter: CircularProgressPainter(
108 progressColor: widget.item.color,
115 padding: EdgeInsets.all(20.sp),
117 crossAxisAlignment: CrossAxisAlignment.center,
118 mainAxisSize: MainAxisSize.min,
121 padding: EdgeInsets.all(12.sp),
122 decoration: BoxDecoration(
123 color: widget.item.color.withValues(alpha: 0.1),
124 borderRadius: BorderRadius.circular(16),
128 color: (widget.item.isEnabled ??
true)
130 : widget.item.color.withValues(alpha: 0.5),
137 textAlign: TextAlign.center,
138 style: Theme.of(context)
143 fontWeight: FontWeight.w500,
144 color: (widget.item.isEnabled ??
true)
145 ? Theme.of(context).colorScheme.onSurface
146 : Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.5),
149 if (widget.item.subtitle != null) ...[
152 widget.item.subtitle!,
153 textAlign: TextAlign.center,
155 Theme.of(context).textTheme.bodyMedium?.copyWith(
156 color: (widget.item.isEnabled ??
true)
160 .withValues(alpha: 0.6)
164 .withValues(alpha: 0.3),
176 decoration: BoxDecoration(
177 color: widget.item.color.withValues(alpha: 0.05),
178 shape: BoxShape.circle,
196 required this.progress,
197 required this.progressColor,
198 this.strokeWidth = 2.0,
202 void paint(Canvas canvas, Size size) {
203 final center = Offset(size.width / 2, size.height / 2);
207 final progressPaint = Paint()
209 ..style = PaintingStyle.stroke
211 ..strokeCap = StrokeCap.round;
214 Rect.fromCircle(center: center, radius: radius),
override void initState()
class App extends StatefulWidget build(BuildContext context)
final Color progressColor
override void paint(Canvas canvas, Size size)
CircularProgressPainter({ required this.progress, required this.progressColor, this.strokeWidth=2.0, })
override bool shouldRepaint(CustomPainter oldDelegate)
void _handleTapUp(TapUpDetails details)
late Animation< double > _scaleAnimation
void _handleTapDown(TapDownDetails details)
List< DashboardItem > get DashboardItem(title:'home.transactions'.tr(), icon:FluentIcons.arrow_swap_16_regular, color:ColorPalette.lightGreen, path:Routes.transactionsHistoryScreen.route,)
class LanguageSelector extends StatefulWidget _controller
style Text( '${ 'scheduling.reference'.tr()}:${collection.internalCode}', style:Theme.of(context).textTheme.bodySmall,)
style SizedBox(height:2.h)
style Column(crossAxisAlignment:CrossAxisAlignment.end, children:[Container(padding:EdgeInsets.symmetric(horizontal:8.w, vertical:4.h), decoration:BoxDecoration(color:ColorPalette.tiffanyBlue.withValues(alpha:0.1), borderRadius:BorderRadius.circular(12),), child:Text(collection.type ?? '', style:Theme.of(context).textTheme.bodySmall?.copyWith(color:ColorPalette.tiffanyBlue, fontWeight:FontWeight.bold,),),),],)