mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 10:06:16 +00:00
64 lines
1.9 KiB
Dart
64 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_bloc.dart';
|
|
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_state.dart';
|
|
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
|
import 'package:syncrow_app/features/devices/view/widgets/ACs/ac_interface_controls.dart';
|
|
import 'package:syncrow_app/features/devices/view/widgets/ACs/ac_interface_temp_unit.dart';
|
|
|
|
class AcInterface extends StatelessWidget {
|
|
const AcInterface({super.key, required this.ac});
|
|
|
|
final DeviceModel ac;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocConsumer<ACsBloc, AcsState>(
|
|
listener: (context, state) {
|
|
if (state is AcsFailedState) {
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
SnackBar(
|
|
content: Text(state.error),
|
|
),
|
|
);
|
|
}
|
|
},
|
|
builder: (context, state) {
|
|
return
|
|
// Scaffold(
|
|
// backgroundColor: ColorsManager.backgroundColor,
|
|
// extendBodyBehindAppBar: true,
|
|
// extendBody: true,
|
|
// body:
|
|
SingleChildScrollView(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
ConstrainedBox(
|
|
constraints: const BoxConstraints(
|
|
maxHeight: 380,
|
|
),
|
|
child: AcInterfaceTempUnit(
|
|
acDevice: ac,
|
|
),
|
|
),
|
|
const SizedBox(
|
|
height: 10,
|
|
),
|
|
ConstrainedBox(
|
|
constraints: const BoxConstraints(
|
|
maxHeight: 130,
|
|
),
|
|
child: AcInterfaceControls(
|
|
deviceModel: ac,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
// );
|
|
},
|
|
);
|
|
}
|
|
}
|