Refactor code for consistency and readability

- Removed unused imports and commented-out code
- Updated class inheritance for AuthState subclasses
- Reorganized code structure for better readability
- Cleaned up debug print statements and replaced with dart:developer logs
This commit is contained in:
Mohammad Salameh
2024-04-15 12:03:25 +03:00
parent cfc395e210
commit 80d424f114
13 changed files with 162 additions and 77 deletions

View File

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
import 'package:syncrow_app/features/devices/model/device_category_model.dart';
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
@ -42,13 +41,10 @@ class CustomSwitch extends StatelessWidget {
width: 45.0,
height: 28.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24.0),
color: status != null
? status
? ColorsManager.primaryColor
: const Color(0xFFD9D9D9)
: const Color(0xFFD9D9D9),
),
borderRadius: BorderRadius.circular(24.0),
color: status
? ColorsManager.primaryColor
: const Color(0xFFD9D9D9)),
child: Center(
child: Container(
width: 40.0,
@ -60,20 +56,16 @@ class CustomSwitch extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.all(2.0),
child: Container(
alignment: status != null
? status
? Alignment.centerRight
: Alignment.centerLeft
alignment: status
? Alignment.centerRight
: Alignment.centerLeft,
child: Container(
width: 20.0,
height: 20.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: status != null
? status
? ColorsManager.primaryColor
: Colors.grey
color: status
? ColorsManager.primaryColor
: Colors.grey,
),
),