Converted all the devices models to extends from DeviceModel for the purpose of unifying.

Initialized Lights feature.
This commit is contained in:
Mohammad Salameh
2024-03-02 21:57:11 +03:00
parent 8203836332
commit bcaed7a4b8
17 changed files with 229 additions and 67 deletions

View File

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/devices/bloc/ac_cubit.dart';
import 'package:syncrow_app/features/devices/bloc/AC/ac_cubit.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';
@ -27,7 +27,7 @@ class DevicesDefaultSwitch extends StatelessWidget {
child: Container(
height: 60,
decoration: BoxDecoration(
color: model.status
color: model.status ?? false
? ColorsManager.primaryColor
: Colors.white,
borderRadius: const BorderRadius.only(
@ -38,7 +38,7 @@ class DevicesDefaultSwitch extends StatelessWidget {
child: Center(
child: BodyMedium(
text: "ON",
fontColor: model.status ? Colors.white : null,
fontColor: model.status ?? false ? Colors.white : null,
fontWeight: FontWeight.bold,
),
),
@ -53,7 +53,7 @@ class DevicesDefaultSwitch extends StatelessWidget {
child: Container(
height: 60,
decoration: BoxDecoration(
color: model.status
color: model.status ?? false
? Colors.white
: ColorsManager.primaryColor,
borderRadius: const BorderRadius.only(
@ -64,7 +64,7 @@ class DevicesDefaultSwitch extends StatelessWidget {
child: Center(
child: BodyMedium(
text: "OFF",
fontColor: model.status ? null : Colors.white,
fontColor: model.status ?? false ? null : Colors.white,
fontWeight: FontWeight.bold,
),
),