Line data Source code
1 : import 'package:amadeus_proto/utils/glowing_widget.dart';
2 : import 'package:flutter/material.dart';
3 : import 'package:flutter_svg/flutter_svg.dart';
4 :
5 : class StreakContainer extends StatelessWidget {
6 12 : const StreakContainer(
7 : {super.key,
8 : this.padding,
9 : this.size,
10 : this.streaked = true,
11 : this.nonStreakWidget,
12 : this.opacity,
13 : this.replaced = true});
14 :
15 : final EdgeInsetsGeometry? padding;
16 : final double? size;
17 : final bool streaked;
18 : final Widget? nonStreakWidget;
19 : final double? opacity;
20 : final bool replaced;
21 :
22 0 : @override
23 : Widget build(BuildContext context) {
24 0 : return Container(
25 0 : width: (size != null) ? (size! + (padding?.horizontal ?? 0)) : null,
26 0 : height: (size != null) ? (size! + (padding?.vertical ?? 0)) : null,
27 0 : padding: padding ?? const EdgeInsets.all(8.0),
28 : decoration: const BoxDecoration(
29 : color: Color.fromARGB(255, 101, 96, 255), shape: BoxShape.circle),
30 0 : child: Stack(
31 0 : children: [
32 0 : if (streaked)
33 0 : Center(
34 0 : child: Opacity(
35 0 : opacity: opacity ?? 1,
36 0 : child: GlowingWidget(
37 : minRadius: 0,
38 0 : maxRadius: (size ?? 0) / 10,
39 : glowColor: Colors.orange,
40 0 : child: SvgPicture.asset(
41 : "assets/FigmaDesign/Asset/SVG/Streak.svg",
42 0 : width: size,
43 0 : height: size,
44 : ),
45 : ),
46 : ),
47 : ),
48 0 : if ((replaced && !streaked) || !replaced)
49 0 : nonStreakWidget ?? const SizedBox.shrink(),
50 : ],
51 : ));
52 : }
53 : }
|