Commit Graph

94 Commits

Author SHA1 Message Date
6dfce18703 Refactor UI structure in curtain and light widgets
Simplify UI structure in curtain_view.dart and light_interface.dart by
rearranging the widget tree for better readability and maintainability.
2024-04-07 12:50:12 +03:00
af7b497cdb apend 2024-04-04 15:51:58 +03:00
8c80283f9c Update DefaultNavBar widget and ServerFailure class
Refactor DefaultNavBar widget to update page index on item tap.
Update ServerFailure class to handle 400 status code with list of errors.
2024-04-04 15:51:41 +03:00
81242c69cb Update CustomSwitch widget to handle device status and control
Refactored CustomSwitch widget to properly handle device status and control
based on the device's status values. Added necessary checks and updated UI
accordingly.
2024-04-04 01:35:30 +03:00
65112976b2 Update device control logic for three gang interface
Refactor onTap functions in ThreeGangInterfaceBody to control all three switches
simultaneously based on the user interaction. Split the logic for turning on and
off the switches into separate functions for better readability and maintenance.
2024-04-04 01:18:02 +03:00
245ab82208 Refactor GangSwitch widget and ThreeGangInterfaceBody
Refactor GangSwitch widget and ThreeGangInterfaceBody for better readability
and maintainability. Update widget structure and logic for improved
functionality and code organization.
2024-04-04 01:14:55 +03:00
1f4fb940bc apend 2024-04-04 00:50:27 +03:00
20ded336d3 Refactor AC interface temp unit control logic
Refactor the control logic in the AC interface temp unit widget to handle
device control actions more efficiently and improve code readability.
2024-04-04 00:45:54 +03:00
13bfcdfb4d Update device icons and refactor AC interface widget
- Update device icons to match new design requirements
- Refactor AC interface widget to use a more descriptive variable name
- Implement temperature control functionality in AC interface widget
2024-04-04 00:38:27 +03:00
37d2c1b53f apend 2024-04-04 00:01:02 +03:00
8d02eb2f40 Refactor DefaultNavBar widget build method
Remove unnecessary BlocProvider and DevicesCubit logic from DefaultNavBar widget
build method, simplify code structure.
2024-04-04 00:00:48 +03:00
bff4b9493c Refactor device control logic and add temperature and fan speed enums
- Refactor device control logic in the app to improve readability and maintainability.
- Add temperature modes (hot, cold, wind) and fan speeds (auto, low, middle, high) enums.
- Update icon mappings and utility functions for temperature modes and fan speeds.
2024-04-03 18:54:21 +03:00
6577652702 Refactor AC mode control unit widget
Move fan speed and temperature mode logic to the DevicesCubit for better
separation of concerns and improved code readability. Update widget to use
BlocBuilder for state management and simplify control logic.
2024-04-03 18:53:54 +03:00
e49627d3e1 Add status model and fetch device statuses
Added a new StatusModel class to represent device statuses and implemented
functionality to fetch and update device statuses in the DevicesCubit and
DeviceModel classes. Also updated UI components to display device status
information.
2024-04-03 11:07:55 +03:00
5ff5f65549 Refactor emit calls to use emitSafe method
Replace direct calls to emit with emitSafe method to ensure emitting
states only when the cubit is not closed. This helps prevent errors
when emitting states after the cubit is closed.
2024-04-03 02:12:35 +03:00
313912a941 Fixed conditional rendering logic for app bar in AppLayout widget
Update the condition to check for the presence of spaces in HomeCubit
instance before displaying the DefaultAppBar component. This improves
readability and maintainability of the code.
2024-04-03 02:00:46 +03:00
127d3a0295 Refactor code structure and update dependencies
Clean up code structure, remove unused imports, and update dependencies.
No functional changes made, only code organization improvements.
2024-04-03 01:55:50 +03:00
9cc479ba17 Refactor email and password validation logic in LoginForm widget
Update email and password validation logic in the LoginForm widget to only
perform validation when the state is not AuthTokenError. This ensures that
validation is skipped when there is an authentication token error.
2024-04-02 18:09:23 +03:00
ef41940333 Add support for different device types in RoomPageSwitch
-Update the navigation approch to be device type orianted to the corresponding interface when tapped.
-Add three gang switch interface and related components
2024-04-02 15:45:21 +03:00
81625cd50e Add device icons based on device type and update network exception handling
- Add logic to set device icons based on device type in DeviceModel.fromJson method
- Update network exception handling to parse HTML response in ServerFailure class
- Add html package as a dependency for parsing HTML responses
-Added Devices Icons by updateing device types mapping
2024-04-02 15:11:20 +03:00
5dc4f96a71 Add functionality to fetch devices by room ID
Added a new method in DevicesCubit to fetch devices by room ID and updated
related classes and API calls to support this functionality.
2024-04-02 12:12:54 +03:00
1397778123 Refacorted imports 2024-04-01 12:17:18 +03:00
d1bc973b38 Refactor HomeCubit class for better instance management
Create a private static instance variable and refactor methods for better instance management in the HomeCubit class.
2024-04-01 12:09:01 +03:00
a20dfa3709 Refactor device status handling and update UI components
- Update device status handling from 'status' to 'isOnline' for consistency
- Remove unused imports and redundant code related to light switches
- Refactor UI components to use 'isOnline' instead of 'status' for device status
2024-04-01 09:58:51 +03:00
3031d19836 Add three gang widgets for controlling three different switches
- Added ThreeGangBody, ThreeGangSwitch, and ThreeGangSwitchesView widgets
  for controlling three different switches in the UI.
- Updated constants file with functions for ThreeGang device type.
2024-04-01 09:56:55 +03:00
9368575154 Add AC cubit and state classes
Add AC cubit and state classes with initial state for managing air conditioning
related functionality in the devices feature bloc.
2024-03-31 12:08:53 +03:00
ee095d0fdc bug_fixing 2 2024-03-24 14:59:29 +03:00
58bf70ea1a Update DefaultAppBar leading widget to show 'Create Home' when spaces is empty 2024-03-24 14:58:20 +03:00
e17c0af144 Add HomeCubit and HomeState classes
This commit adds the HomeCubit class along with its corresponding HomeState
class. It also includes necessary imports and updates references to the
previously used SpacesCubit to the new HomeCubit in various files.
handled the multible onCreate -- HomeCubit
2024-03-24 14:43:13 +03:00
c0bfd24751 Refactor device-related views and add error handling
Refactor device-related views to improve code structure and readability.
Add error handling for authentication token in the splash view.
Remove unnecessary NavCubit from the app initialization.
2024-03-21 13:58:20 +03:00
a52f2c0b5a Add close method override in DevicesCubit
Add override for close method in DevicesCubit to set _isClosed flag and call super.close(). This prevents further operations after closing.
2024-03-19 15:17:40 +03:00
d4a9cfb7ab Refactor error handling in AuthCubit and ServerFailure
Update error handling in AuthCubit to use toString() method and mdified
handling of badResponse in ServerFailure class.
2024-03-19 15:13:00 +03:00
cb913cd784 Refactor navigation in SplashView and add CustomPageRoute
Introduce CustomPageRoute for smoother navigation transitions in SplashView.
Update navigation in SplashView to use CustomPageRoute for login redirection.
2024-03-19 15:06:10 +03:00
3cbc3d7fa9 Add autovalidate mode to LoginForm
Set autovalidate mode to onUserInteraction in the LoginForm widget to improve
user experience.
2024-03-19 14:58:33 +03:00
42051bb977 Fixed the overflow in the login screen, the page is scrollable.
- Fixed Scrolling wasent working in login screen
- Changed Home page to indexed based view instead of PageView
2024-03-19 13:29:12 +03:00
79279180df Refactor code for better readability and maintainability
- Add method to get token and validate in AuthCubit
- Update AuthState with loading, success, and error states for token
- Use BlocBuilder in SplashView for token validation and navigation

This commit refactors the code in AuthCubit to include a method to get the token and validate it. It also updates the AuthState with loading, success, and error states for token handling. In SplashView, BlocBuilder is now used to handle token validation and navigation based on the token status.
2024-03-19 11:15:45 +03:00
13e80fbad7 fetch groups 2024-03-18 11:46:27 +03:00
65cbf10485 temp 2024-03-17 09:38:26 +03:00
8ac164f0c5 fixed AppBar null check 2024-03-15 22:23:34 +03:00
c5f1b8d090 switch functionality initial implantation 2024-03-14 01:14:54 +03:00
00d1ad50f1 built 3 gang switch View 2024-03-14 00:38:00 +03:00
024f15728b getting spaces and rooms from api {null checks} 2024-03-13 13:52:22 +03:00
0f3cc453ce Semi-implemented getting spaces feature 2024-03-12 11:14:31 +03:00
d3bd10730c Modified Devices Pages 2024-03-11 12:04:26 +03:00
f11b6d8d32 Added page swipe for navigation 2024-03-10 16:57:12 +03:00
c03b2b248d Fixed navigation bug 2024-03-10 15:57:43 +03:00
37187acdf4 Merged Auth branch & Curtains branch 2024-03-10 15:09:06 +03:00
39a3f97181 Merged Auth branch & Curtains branch 2024-03-10 15:06:04 +03:00
a6018b282e Redesigned Splash Screen and Login Screen 2024-03-10 14:49:17 +03:00
ce34933738 Added loading and success icons to login button 2024-03-10 10:58:45 +03:00