import 'package:car_for_her/config/palette.dart'; import 'package:car_for_her/models/Client/services.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; class ServicesWidget extends StatefulWidget { final int index; final bool isActive; ServicesWidget(this.index, this.isActive); @override _ServicesWidgetState createState() => _ServicesWidgetState(); } class _ServicesWidgetState extends State { @override Widget build(BuildContext context) { return Container( margin: EdgeInsets.only(right: 15), child: Padding( padding: const EdgeInsets.only(left: 5, right: 5, top: 10, bottom: 10), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ SvgPicture.asset( serviceList[this.widget.index].imageLink, color: this.widget.isActive ? Colors.white : Colors.black, ), SizedBox( height: 10, ), Text( serviceList[this.widget.index].name, textAlign: TextAlign.center, style: TextStyle( fontFamily: 'MontHeavy', fontSize: 12, color: this.widget.isActive ? Colors.white : Colors.black, ), ) ], ), ), width: 100, height: 90, decoration: BoxDecoration( color: this.widget.isActive ? Palette.primary : Colors.white, border: this.widget.isActive ? Border.all(color: Colors.pink) : Border.all(color: Colors.grey)), ); } }