finished AC

This commit is contained in:
ashrafzarkanisala
2024-08-26 19:32:11 +03:00
parent afee0eb5b1
commit 2777dc1a5f
14 changed files with 445 additions and 446 deletions

View File

@ -24,20 +24,18 @@ class IncrementDecrementWidget extends StatelessWidget {
children: [
Material(
type: MaterialType.transparency,
child: Flexible(
child: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: InkWell(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: onDecrement,
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
Icons.remove,
color: ColorsManager.greyColor,
size: 28,
),
child: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: InkWell(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: onDecrement,
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
Icons.remove,
color: ColorsManager.greyColor,
size: 28,
),
),
),
@ -73,20 +71,18 @@ class IncrementDecrementWidget extends StatelessWidget {
),
Material(
type: MaterialType.transparency,
child: Flexible(
child: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: InkWell(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: onIncrement,
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
Icons.add,
color: ColorsManager.greyColor,
size: 28,
),
child: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: InkWell(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: onIncrement,
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
Icons.add,
color: ColorsManager.greyColor,
size: 28,
),
),
),

View File

@ -13,38 +13,36 @@ class PresenceDisplayValue extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DeviceControlsContainer(
child: Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
value,
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
color: ColorsManager.dialogBlueTitle,
fontSize: 40,
fontWeight: FontWeight.w700),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
value,
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
color: ColorsManager.dialogBlueTitle,
fontSize: 40,
fontWeight: FontWeight.w700),
),
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Text(
postfix,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: ColorsManager.blackColor, fontSize: 16, fontWeight: FontWeight.w700),
),
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Text(
postfix,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: ColorsManager.blackColor, fontSize: 16, fontWeight: FontWeight.w700),
),
),
],
),
Text(
description,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: ColorsManager.blackColor, fontWeight: FontWeight.w400, fontSize: 16),
),
],
),
),
],
),
Text(
description,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: ColorsManager.blackColor, fontWeight: FontWeight.w400, fontSize: 16),
),
],
),
);
}

View File

@ -11,23 +11,21 @@ class PresenceStaticWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DeviceControlsContainer(
child: Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SvgPicture.asset(
icon,
width: 60,
height: 60,
),
Text(
description,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: ColorsManager.blackColor, fontWeight: FontWeight.w400, fontSize: 16),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SvgPicture.asset(
icon,
width: 60,
height: 60,
),
Text(
description,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: ColorsManager.blackColor, fontWeight: FontWeight.w400, fontSize: 16),
),
],
),
);
}

View File

@ -15,37 +15,35 @@ class PresenceState extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DeviceControlsContainer(
child: Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'Status:',
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: ColorsManager.blackColor, fontWeight: FontWeight.w400, fontSize: 10),
),
],
),
SvgPicture.asset(
value.toLowerCase() == 'motion'
? Assets.sensorMotionIcon
: value.toLowerCase() == 'presence'
? Assets.sensorPresenceIcon
: Assets.sensorVacantIcon,
width: 60,
height: 60,
),
Text(
value,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: ColorsManager.blackColor, fontWeight: FontWeight.w400, fontSize: 16),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'Status:',
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: ColorsManager.blackColor, fontWeight: FontWeight.w400, fontSize: 10),
),
],
),
SvgPicture.asset(
value.toLowerCase() == 'motion'
? Assets.sensorMotionIcon
: value.toLowerCase() == 'presence'
? Assets.sensorPresenceIcon
: Assets.sensorVacantIcon,
width: 60,
height: 60,
),
Text(
value,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: ColorsManager.blackColor, fontWeight: FontWeight.w400, fontSize: 16),
),
],
),
);
}

View File

@ -56,38 +56,36 @@ class _CurrentTempState extends State<PresenceUpdateData> {
@override
Widget build(BuildContext context) {
return DeviceControlsContainer(
child: Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.title,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: ColorsManager.blackColor, fontWeight: FontWeight.w400, fontSize: 10),
),
IncrementDecrementWidget(
value: widget.value.toString(),
description: widget.description ?? '',
descriptionColor: ColorsManager.blackColor,
onIncrement: () {
if (_adjustedValue < widget.maxValue) {
setState(() {
_adjustedValue = _adjustedValue + widget.steps;
});
_onValueChanged(_adjustedValue);
}
},
onDecrement: () {
if (_adjustedValue > widget.minValue) {
setState(() {
_adjustedValue = _adjustedValue - widget.steps;
});
_onValueChanged(_adjustedValue);
}
}),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.title,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: ColorsManager.blackColor, fontWeight: FontWeight.w400, fontSize: 10),
),
IncrementDecrementWidget(
value: widget.value.toString(),
description: widget.description ?? '',
descriptionColor: ColorsManager.blackColor,
onIncrement: () {
if (_adjustedValue < widget.maxValue) {
setState(() {
_adjustedValue = _adjustedValue + widget.steps;
});
_onValueChanged(_adjustedValue);
}
},
onDecrement: () {
if (_adjustedValue > widget.minValue) {
setState(() {
_adjustedValue = _adjustedValue - widget.steps;
});
_onValueChanged(_adjustedValue);
}
}),
],
),
);
}