intervalButton function

Widget intervalButton({
  1. required Coin coinData,
  2. required String title,
  3. required Color? intervalSelectedTextColor,
  4. required Color? intervalUnselectedTextColor,
  5. required double? intervalTextSize,
})

Implementation

Widget intervalButton({
  required Coin coinData,
  required String title,
  required Color? intervalSelectedTextColor,
  required Color? intervalUnselectedTextColor,
  required double? intervalTextSize,
}) {
  return Padding(
    padding: const EdgeInsets.only(right: 3),
    child: InkWell(
      onTap: () async {
        await ChartController.to.getCandles(
          coinData: coinData,
          interval: title,
        );
        ChartController.to.interval = title;
      },
      child: Padding(
        padding: const EdgeInsets.all(3),
        child: Text(
          title,
          style: TextStyle(
            color: title == ChartController.to.interval
                ? intervalSelectedTextColor ?? Colors.green
                : intervalUnselectedTextColor ?? Colors.white,
            fontWeight: FontWeight.w600,
            fontSize: intervalTextSize ?? 10,
          ),
        ),
      ),
    ),
  );
}