Skip to content

Instantly share code, notes, and snippets.

@josue1dario2
Created January 2, 2023 02:51
Show Gist options
  • Save josue1dario2/6ea936c7841f7c08dcc5301d23d1d8ca to your computer and use it in GitHub Desktop.
Save josue1dario2/6ea936c7841f7c08dcc5301d23d1d8ca to your computer and use it in GitHub Desktop.
5. ActiveIndicatorRefactor
class ActiveIndicator extends StatelessWidget {
const ActiveIndicator(
{super.key,
required this.value,
required this.color,
required this.sizeIcon,
required this.sizeText});
final double sizeIcon;
final double sizeText;
final int value;
final Color color;
@override
Widget build(BuildContext context) {
return Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image(
width: sizeIcon,
image: const AssetImage('assets/img/Dot.png'),
color: (Service.isActive(value))
? const Color(0xFF4BE1A0)
: const Color(0xFFDADADA)),
const SizedBox(
width: 10,
),
CustomText(
text: Service.text(value),
//25
size: sizeText,
weight: FontWeight.w800,
color: color)
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment