Answers for "expansion tile flutter"

C
1

langauge tile widget flutter

class MyRadioListTile<T> extends StatelessWidget {
  final T value;
  final T groupValue;
  final String leading;
  final String lengtext;
  final ValueChanged<T> onChanged;
  final String letter;

  const MyRadioListTile(
      {@required this.value,
      @required this.groupValue,
      @required this.onChanged,
      @required this.leading,
      @required this.lengtext,
      @required this.letter});

  @override
  Widget build(BuildContext context) {
    final isSelected = value == groupValue;
    Size size = MediaQuery.of(context).size;
    return InkWell(
      onTap: () => onChanged(value),
      child: Container(
          width: (size.width - 80) / 2,
          height: (size.width - 80) / 2,
          decoration: BoxDecoration(
            shape: BoxShape.rectangle,
            //color: isSelected ? Colors.greenAccent[400] : Colors.white,
            border: Border.all(
                color: isSelected ? HexColor("#5B02FF") : Colors.white70,
                width: 2),
            borderRadius: BorderRadius.only(
              topLeft: Radius.circular(10.0),
              topRight: Radius.circular(10.0),
              bottomLeft: Radius.circular(10.0),
              bottomRight: Radius.circular(10.0),
            ),
          ),
          padding: EdgeInsets.all(20),
          child: Column(
            children: [
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Padding(
                    padding: const EdgeInsets.all(7.0),
                    child: Text(
                      leading,
                      style: TextStyle(
                          color: Colors.white,
                          fontSize: 18,
                          fontWeight: FontWeight.bold),
                    ),
                  ),
                  if (isSelected)
                    Icon(
                      Icons.arrow_forward_rounded,
                      color: HexColor("#5B02FF"),
                      size: 30,
                    )
                ],
              ),
              Row(
                children: [
                  Padding(
                    padding: const EdgeInsets.all(7.0),
                    child: Text(
                      lengtext,
                      style: TextStyle(color: Colors.white70, fontSize: 18),
                    ),
                  ),
                ],
              ),
              Row(
                children: [
                  Padding(
                    padding: const EdgeInsets.all(7.0),
                    child: Text(
                      letter,
                      style: TextStyle(
                          color:
                              isSelected ? HexColor("#5B02FF") : Colors.white70,
                          fontSize: 18,
                          fontWeight: FontWeight.bold),
                    ),
                  ),
                ],
              ),
            ],
          )),
    );
  }
}
Posted by: Guest on September-22-2021

Code answers related to "C"

Browse Popular Code Answers by Language