mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
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.
This commit is contained in:
@ -14,7 +14,7 @@ class DefaultNavBar extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => DevicesCubit(),
|
||||
create: (context) => DevicesCubit.getInstance(),
|
||||
child: BlocBuilder<DevicesCubit, DevicesState>(
|
||||
builder: (context, state) {
|
||||
return BlocBuilder<HomeCubit, HomeState>(
|
||||
@ -26,8 +26,8 @@ class DefaultNavBar extends StatelessWidget {
|
||||
backgroundColor: Colors.transparent,
|
||||
onTap: (int index) {
|
||||
cubit.updatePageIndex(index);
|
||||
if (DevicesCubit.get(context).chosenCategoryView != null) {
|
||||
DevicesCubit.get(context)
|
||||
if (DevicesCubit.getInstance().chosenCategoryView != null) {
|
||||
DevicesCubit.getInstance()
|
||||
.clearCategoriesSelection(context);
|
||||
}
|
||||
if (HomeCubit.getInstance().selectedRoom != null) {
|
||||
|
Reference in New Issue
Block a user