import 'package:flutter/material.dart';

class WifiBarIcon extends StatelessWidget {
  const WifiBarIcon({required this.strength, this.size, this.color, super.key});

  final int strength;
  final double? size;
  final Color? color;

  @override
  Widget build(BuildContext context) {
    switch (strength) {
      case >= 75:
        return Icon(
          Icons.network_wifi,
          size: size,
          color: color,
        );
      case >= 45:
        return Icon(
          Icons.network_wifi_3_bar,
          size: size,
          color: color,
        );
      case >= 25:
        return Icon(
          Icons.network_wifi_2_bar,
          size: size,
          color: color,
        );
      case >= 1:
        return Icon(
          Icons.network_wifi_1_bar,
          size: size,
          color: color,
        );
      default:
        return Icon(
          Icons.wifi_off,
          size: size,
          color: color,
        );
    }
  }
}
