Files
syncrow-app/lib/features/devices/view/widgets/devices_temp_widget.dart
Mohammad Salameh 3fabd41e72 Stabilized UI elements across multiple devices
Synchronized ACs Status functionality
2024-02-28 12:22:45 +03:00

63 lines
1.8 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/devices/bloc/ac_cubit.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
import '../../../../generated/assets.dart';
class DevicesTempWidget extends StatelessWidget {
const DevicesTempWidget(
this.index, {
super.key,
});
final int index;
// double temp = widget.model.temperature;
@override
Widget build(BuildContext context) {
return DefaultContainer(
height: 60,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
SizedBox.square(
dimension: 24,
child: InkWell(
onTap: () {
AcCubit.get(context).decreaseACTemp(index);
},
child: SvgPicture.asset(
Assets.iconsMinus,
),
),
),
BodyLarge(
text: "${AcCubit.get(context).getTemp(index)}° C",
style: context.bodyLarge.copyWith(
color: ColorsManager.primaryColor.withOpacity(0.6),
fontSize: 23,
),
),
SizedBox.square(
dimension: 24,
child: InkWell(
onTap: () {
AcCubit.get(context).increaseACTemp(index);
},
child: SvgPicture.asset(
Assets.iconsPlus,
height: 24,
width: 24,
),
),
),
],
),
);
}
}