import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart'; import '../../../../../utils/resource_manager/color_manager.dart'; import '../../../../shared_widgets/text_widgets/body_medium.dart'; import '../../../bloc/AC/ac_cubit.dart'; class UniversalACSwitch extends StatelessWidget { const UniversalACSwitch({ super.key, }); @override Widget build(BuildContext context) { //TODO: Move these to String Manager "ON" and "OFF" return BlocBuilder( builder: (context, state) { return Row( children: [ Expanded( child: InkWell( onTap: () { AcCubit.get(context).turnAllACsOn(); }, child: Container( height: 60, decoration: BoxDecoration( color: DevicesCubit.categories[0].devicesStatus ? ColorsManager.primaryColor : Colors.white, borderRadius: const BorderRadius.only( topLeft: Radius.circular(15), bottomLeft: Radius.circular(15), ), ), child: Center( child: BodyMedium( text: "ON", fontColor: DevicesCubit.categories[0].devicesStatus ? Colors.white : null, fontWeight: FontWeight.bold, ), ), ), ), ), Expanded( child: InkWell( onTap: () { AcCubit.get(context).turnAllACsOff(); }, child: Container( height: 60, decoration: BoxDecoration( color: DevicesCubit.categories[0].devicesStatus ? Colors.white : ColorsManager.primaryColor, borderRadius: const BorderRadius.only( topRight: Radius.circular(15), bottomRight: Radius.circular(15), ), ), child: Center( child: BodyMedium( text: "OFF", fontColor: DevicesCubit.categories[0].devicesStatus ? null : Colors.white, fontWeight: FontWeight.bold, ), ), ), ), ), ], ); }, ); } }