mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00
69 lines
2.4 KiB
Dart
69 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_bloc.dart';
|
|
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_event.dart';
|
|
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_state.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/devices/view/widgets/ACs/ac_mode_control_unit.dart';
|
|
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
|
import 'package:syncrow_app/generated/assets.dart';
|
|
|
|
class AcInterfaceControls extends StatelessWidget {
|
|
const AcInterfaceControls({super.key, required this.deviceModel, required this.deviceStatus});
|
|
|
|
final DeviceModel deviceModel;
|
|
final AcStatusModel deviceStatus;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocBuilder<ACsBloc, AcsState>(
|
|
builder: (context, state) {
|
|
String lockIconName =
|
|
deviceStatus.childLock ? Assets.assetsIconsLock : Assets.assetsIconsUnLock;
|
|
|
|
return Column(
|
|
children: [
|
|
ACModeControlUnit(
|
|
acStatus: deviceStatus,
|
|
deviceId: deviceModel.uuid ?? '',
|
|
),
|
|
const SizedBox(height: 10),
|
|
Row(
|
|
children: [
|
|
Flexible(
|
|
child: GestureDetector(
|
|
onTap: () {},
|
|
child: DefaultContainer(
|
|
height: 55,
|
|
child: Center(
|
|
child: SvgPicture.asset(Assets.assetsIconsAutomatedClock),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(width: 10),
|
|
Flexible(
|
|
child: GestureDetector(
|
|
onTap: () {
|
|
BlocProvider.of<ACsBloc>(context)
|
|
.add(ChangeLock(lockBool: deviceStatus.childLock));
|
|
},
|
|
child: DefaultContainer(
|
|
height: 55,
|
|
child: Center(
|
|
child: SvgPicture.asset(lockIconName),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
)
|
|
],
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|