AC devices page implemented

AC Cubit Add
New Devices Cubit Arch will be used
Devices Cubit (for devices categories, and devices page)
{
AC cubit,
Lights cubit.
... }
Replaced AssetsManager with Assets Class (auto generated)
This commit is contained in:
Mohammad Salameh
2024-02-26 15:55:22 +03:00
parent c95a9c7817
commit abe7072f2d
72 changed files with 1535 additions and 634 deletions

View File

@ -0,0 +1,83 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/devices/model/ac_model.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class DevicesDefaultSwitch extends StatefulWidget {
const DevicesDefaultSwitch({
super.key,
required this.model,
});
final ACModel model;
@override
State<DevicesDefaultSwitch> createState() => _DevicesDefaultSwitchState();
}
class _DevicesDefaultSwitchState extends State<DevicesDefaultSwitch> {
@override
Widget build(BuildContext context) {
return Row(
children: <Widget>[
Expanded(
child: InkWell(
onTap: () {
setState(() {
// isOn = !isOn;
widget.model.status = !widget.model.status;
});
},
child: Container(
height: 60,
decoration: BoxDecoration(
color: widget.model.status
? ColorsManager.primaryColor
: Colors.white,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(15),
bottomLeft: Radius.circular(15),
),
),
child: Center(
child: BodyMedium(
text: "ON",
fontColor: widget.model.status ? Colors.white : null,
fontWeight: FontWeight.bold,
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
widget.model.status = !widget.model.status;
});
},
child: Container(
height: 60,
decoration: BoxDecoration(
color: widget.model.status
? Colors.white
: ColorsManager.primaryColor,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(15),
bottomRight: Radius.circular(15),
),
),
child: Center(
child: BodyMedium(
text: "OFF",
fontColor: widget.model.status ? null : Colors.white,
fontWeight: FontWeight.bold,
),
),
),
),
),
],
);
}
}