36 lines
971 B
Dart
36 lines
971 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class VideoMascot extends StatelessWidget {
|
|
final double size;
|
|
final double zoom;
|
|
|
|
const VideoMascot({super.key, this.size = 108, this.zoom = 5.5});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: size,
|
|
height: size,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: Colors.white.withValues(alpha: 0.1),
|
|
),
|
|
clipBehavior: Clip.hardEdge,
|
|
// Cargamos el archivo como GIF
|
|
child: Transform.scale(
|
|
scale: zoom,
|
|
child: Image.asset(
|
|
'assets/animations/blink_saludo.gif',
|
|
fit: BoxFit.cover,
|
|
errorBuilder: (context, error, stackTrace) {
|
|
// Plan B: si el archivo no existe o hay error, mostramos el bote
|
|
return const Center(
|
|
child: Icon(Icons.delete_outline, color: Colors.white, size: 48),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|