mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 09:45:22 +00:00
built Lights List
This commit is contained in:
@ -1,28 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/AC/ac_cubit.dart';
|
||||
import 'package:syncrow_app/features/devices/model/ac_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
import '../devices/bloc/devices_cubit.dart';
|
||||
|
||||
class DevicesDefaultSwitch extends StatelessWidget {
|
||||
const DevicesDefaultSwitch({
|
||||
super.key,
|
||||
required this.model,
|
||||
});
|
||||
|
||||
final ACModel model;
|
||||
final DeviceModel model;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<AcCubit, AcState>(
|
||||
return BlocBuilder<DevicesCubit, DevicesState>(
|
||||
builder: (context, state) {
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
AcCubit.get(context).turnACOn(model);
|
||||
DevicesCubit.get(context).turnOnOffDevice(model);
|
||||
},
|
||||
child: Container(
|
||||
height: 60,
|
||||
@ -48,7 +49,7 @@ class DevicesDefaultSwitch extends StatelessWidget {
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
AcCubit.get(context).turnACOff(model);
|
||||
DevicesCubit.get(context).turnOnOffDevice(model);
|
||||
},
|
||||
child: Container(
|
||||
height: 60,
|
||||
|
Reference in New Issue
Block a user