diff --git a/.vscode/launch.json b/.vscode/launch.json
index e64ae76..ea8d313 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -11,11 +11,17 @@
"type": "dart",
"deviceId": "0147FC23-3D6C-406A-BE2C-9E67BAF3DA9B"
},
+ {
+ "name": "Faris Iphone ",
+ "request": "launch",
+ "type": "dart",
+ "deviceId": "00008101-00050C1C02FA001E"
+ },
{
"name": "Iphone 15 Pro",
"request": "launch",
"type": "dart",
- "deviceId": "9C9E6EEF-0E9C-4FA9-B201-CBA8AFB0D1D8"
+ "deviceId": "B26AF31B-D38E-4485-9628-528E0DB29789"
},
{
"name": "Iphone SE",
diff --git a/assets/icons/curtainsIcon/closeCurtain.svg b/assets/icons/curtainsIcon/closeCurtain.svg
new file mode 100644
index 0000000..8fa548f
--- /dev/null
+++ b/assets/icons/curtainsIcon/closeCurtain.svg
@@ -0,0 +1,56 @@
+
diff --git a/assets/icons/curtainsIcon/curtainHolder.svg b/assets/icons/curtainsIcon/curtainHolder.svg
new file mode 100644
index 0000000..8ed2e91
--- /dev/null
+++ b/assets/icons/curtainsIcon/curtainHolder.svg
@@ -0,0 +1,34 @@
+
diff --git a/assets/icons/curtainsIcon/openCurtain.svg b/assets/icons/curtainsIcon/openCurtain.svg
new file mode 100644
index 0000000..67fd13c
--- /dev/null
+++ b/assets/icons/curtainsIcon/openCurtain.svg
@@ -0,0 +1,56 @@
+
diff --git a/assets/icons/curtainsIcon/verticalBlade.svg b/assets/icons/curtainsIcon/verticalBlade.svg
new file mode 100644
index 0000000..3089113
--- /dev/null
+++ b/assets/icons/curtainsIcon/verticalBlade.svg
@@ -0,0 +1,32 @@
+
diff --git a/assets/images/Down.png b/assets/images/Down.png
new file mode 100644
index 0000000..efd6460
Binary files /dev/null and b/assets/images/Down.png differ
diff --git a/assets/images/HorizintalBlade.png b/assets/images/HorizintalBlade.png
new file mode 100644
index 0000000..f4e939b
Binary files /dev/null and b/assets/images/HorizintalBlade.png differ
diff --git a/assets/images/Pause.png b/assets/images/Pause.png
new file mode 100644
index 0000000..b5659fc
Binary files /dev/null and b/assets/images/Pause.png differ
diff --git a/assets/images/Up.png b/assets/images/Up.png
new file mode 100644
index 0000000..f4b13a8
Binary files /dev/null and b/assets/images/Up.png differ
diff --git a/assets/images/Window.png b/assets/images/Window.png
new file mode 100644
index 0000000..be38a0b
Binary files /dev/null and b/assets/images/Window.png differ
diff --git a/ios/Podfile b/ios/Podfile
index d97f17e..3be4767 100644
--- a/ios/Podfile
+++ b/ios/Podfile
@@ -42,3 +42,4 @@ post_install do |installer|
flutter_additional_ios_build_settings(target)
end
end
+
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index f24671a..c74adc2 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -212,6 +212,6 @@ SPEC CHECKSUMS:
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812
-PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796
+PODFILE CHECKSUM: cf86fcba3fb3dbd505936bc190bb0b8fe3dd2498
COCOAPODS: 1.15.2
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 0bddadd..59c1cec 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -97,7 +97,6 @@
F323D632CA976B68DDB0E669 /* Pods-RunnerTests.release.xcconfig */,
AAC9129FD50E64509AD1B9AF /* Pods-RunnerTests.profile.xcconfig */,
);
- name = Pods;
path = Pods;
sourceTree = "";
};
@@ -230,7 +229,7 @@
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
- compatibilityVersion = "Xcode 9.3";
+ compatibilityVersion = "Xcode 15.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
@@ -416,6 +415,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@@ -435,6 +435,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -445,6 +446,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -467,16 +469,24 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
+ INFOPLIST_KEY_CFBundleDisplayName = Syncrow;
+ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
+ MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.syncrowApp;
PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
@@ -537,6 +547,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@@ -556,6 +567,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -566,6 +578,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@@ -592,6 +605,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@@ -611,6 +625,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -621,6 +636,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -645,16 +661,24 @@
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
+ INFOPLIST_KEY_CFBundleDisplayName = Syncrow;
+ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
+ MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.syncrowApp;
PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
@@ -667,16 +691,24 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
+ INFOPLIST_KEY_CFBundleDisplayName = Syncrow;
+ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
+ MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.syncrowApp;
PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 3bd6cb0..7abb2a9 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -2,6 +2,8 @@
+ CADisableMinimumFrameDurationOnPhone
+
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleDisplayName
@@ -24,26 +26,18 @@
$(FLUTTER_BUILD_NUMBER)
LSRequiresIPhoneOS
+ UIApplicationSupportsIndirectInputEvents
+
UILaunchStoryboardName
LaunchScreen
UIMainStoryboardFile
Main
UISupportedInterfaceOrientations
- UIInterfaceOrientationPortrait
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
-
- UISupportedInterfaceOrientations~ipad
-
UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
- CADisableMinimumFrameDurationOnPhone
-
- UIApplicationSupportsIndirectInputEvents
-
diff --git a/lib/features/app_layout/bloc/home_cubit.dart b/lib/features/app_layout/bloc/home_cubit.dart
index 04d2b81..0a88244 100644
--- a/lib/features/app_layout/bloc/home_cubit.dart
+++ b/lib/features/app_layout/bloc/home_cubit.dart
@@ -5,13 +5,20 @@ import 'package:syncrow_app/features/app_layout/model/space_model.dart';
import 'package:syncrow_app/features/app_layout/view/widgets/app_bar_home_dropdown.dart';
import 'package:syncrow_app/features/dashboard/view/dashboard_view.dart';
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
+import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/devices/model/room_model.dart';
+import 'package:syncrow_app/features/devices/model/status_model.dart';
+import 'package:syncrow_app/features/devices/view/widgets/curtains/blind_view.dart';
+import 'package:syncrow_app/features/devices/view/widgets/curtains/curtain_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/devices_view_body.dart';
import 'package:syncrow_app/features/menu/view/menu_view.dart';
import 'package:syncrow_app/features/scene/view/scene_view.dart';
import 'package:syncrow_app/generated/assets.dart';
+import 'package:syncrow_app/navigation/navigation_service.dart';
import 'package:syncrow_app/services/api/spaces_api.dart';
+import 'package:syncrow_app/utils/helpers/custom_page_route.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
+import 'package:syncrow_app/utils/resource_manager/constants.dart';
part 'home_state.dart';
@@ -168,7 +175,20 @@ class HomeCubit extends Cubit {
foregroundColor:
MaterialStateProperty.all(ColorsManager.textPrimaryColor),
),
- onPressed: () {},
+ onPressed: () {
+ Navigator.push(
+ NavigationService.navigatorKey.currentContext!,
+ CustomPageRoute(
+ builder: (context) => CurtainView(
+ curtain: DeviceModel(
+ name: "Curtain",
+ status: [StatusModel(code: "awd", value: 1)],
+ productType: DeviceType.Curtain,
+ ),
+ ),
+ ),
+ );
+ },
),
],
'Devices': [
@@ -198,7 +218,7 @@ class HomeCubit extends Cubit {
'Routine': [
// IconButton(
// icon: Image.asset(
- // Assets.iconsFilter,
+ // Assets.assetsIconsFilter,
// height: 20,
// width: 20,
// ),
@@ -230,7 +250,7 @@ class HomeCubit extends Cubit {
'Menu': [
IconButton(
icon: SvgPicture.asset(
- Assets.iconsScan,
+ Assets.assetsIconsScan,
height: 20,
width: 20,
),
@@ -246,7 +266,7 @@ class HomeCubit extends Cubit {
'Menu': Padding(
padding: const EdgeInsets.only(left: 15),
child: Image.asset(
- Assets.imagesLogoHorizontal,
+ Assets.assetsImagesLogoHorizontal,
height: 15,
width: 100,
fit: BoxFit.scaleDown,
@@ -255,11 +275,12 @@ class HomeCubit extends Cubit {
};
static var bottomNavItems = [
- defaultBottomNavBarItem(icon: Assets.iconsDashboard, label: 'Dashboard'),
- // defaultBottomNavBarItem(icon: Assets.iconslayout, label: 'Layout'),
- defaultBottomNavBarItem(icon: Assets.iconsDevices, label: 'Devices'),
- defaultBottomNavBarItem(icon: Assets.iconsRoutines, label: 'Routine'),
- defaultBottomNavBarItem(icon: Assets.iconsMenu, label: 'Menu'),
+ defaultBottomNavBarItem(
+ icon: Assets.assetsIconsDashboard, label: 'Dashboard'),
+ // defaultBottomNavBarItem(icon: Assets.assetsIconslayout, label: 'Layout'),
+ defaultBottomNavBarItem(icon: Assets.assetsIconsDevices, label: 'Devices'),
+ defaultBottomNavBarItem(icon: Assets.assetsIconsRoutines, label: 'Routine'),
+ defaultBottomNavBarItem(icon: Assets.assetsIconsMenu, label: 'Menu'),
];
final List pages = [
diff --git a/lib/features/app_layout/view/widgets/app_bar_home_dropdown.dart b/lib/features/app_layout/view/widgets/app_bar_home_dropdown.dart
index 4fc6965..bc1496d 100644
--- a/lib/features/app_layout/view/widgets/app_bar_home_dropdown.dart
+++ b/lib/features/app_layout/view/widgets/app_bar_home_dropdown.dart
@@ -36,7 +36,7 @@ class AppBarHomeDropdown extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset(
- Assets.iconsHome,
+ Assets.assetsIconsHome,
width: 25,
height: 25,
colorFilter: const ColorFilter.mode(
diff --git a/lib/features/auth/view/widgets/login/login_view.dart b/lib/features/auth/view/widgets/login/login_view.dart
index 479d48e..16cfd03 100644
--- a/lib/features/auth/view/widgets/login/login_view.dart
+++ b/lib/features/auth/view/widgets/login/login_view.dart
@@ -41,7 +41,7 @@ class LoginView extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
- Assets.imagesBackground,
+ Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
),
@@ -52,7 +52,7 @@ class LoginView extends StatelessWidget {
height: MediaQuery.sizeOf(context).height,
decoration: const BoxDecoration(
image: DecorationImage(
- image: AssetImage(Assets.imagesVector),
+ image: AssetImage(Assets.assetsImagesVector),
fit: BoxFit.cover,
opacity: 0.9,
),
@@ -72,7 +72,7 @@ class LoginView extends StatelessWidget {
children: [
Center(
child: SvgPicture.asset(
- Assets.imagesLogo,
+ Assets.assetsImagesLogo,
width: 160,
),
),
diff --git a/lib/features/auth/view/widgets/login/login_with_google_facebook.dart b/lib/features/auth/view/widgets/login/login_with_google_facebook.dart
index c310663..b7e2394 100644
--- a/lib/features/auth/view/widgets/login/login_with_google_facebook.dart
+++ b/lib/features/auth/view/widgets/login/login_with_google_facebook.dart
@@ -22,7 +22,7 @@ class LoginWithGoogleFacebook extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
- SvgPicture.asset(Assets.iconsGoogle),
+ SvgPicture.asset(Assets.assetsIconsGoogle),
const SizedBox(width: 10),
BodyMedium(
text: "Google",
@@ -43,7 +43,7 @@ class LoginWithGoogleFacebook extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
- SvgPicture.asset(Assets.iconsFacebook),
+ SvgPicture.asset(Assets.assetsIconsFacebook),
const SizedBox(width: 10),
BodyMedium(
text: "Facebook",
diff --git a/lib/features/dashboard/view/widgets/carbon_emission.dart b/lib/features/dashboard/view/widgets/carbon_emission.dart
index 0e47a9f..4823210 100644
--- a/lib/features/dashboard/view/widgets/carbon_emission.dart
+++ b/lib/features/dashboard/view/widgets/carbon_emission.dart
@@ -41,7 +41,7 @@ class CarbonEmission extends StatelessWidget {
SizedBox.square(
dimension: 30,
child: SvgPicture.asset(
- Assets.iconsCO2,
+ Assets.assetsIconsCO2,
fit: BoxFit.contain,
),
),
@@ -71,7 +71,7 @@ class CarbonEmission extends StatelessWidget {
SizedBox.square(
dimension: 30,
child: SvgPicture.asset(
- Assets.iconsSustainability,
+ Assets.assetsIconsSustainability,
fit: BoxFit.contain,
),
),
diff --git a/lib/features/dashboard/view/widgets/consumption.dart b/lib/features/dashboard/view/widgets/consumption.dart
index 9e5a1a7..0e39498 100644
--- a/lib/features/dashboard/view/widgets/consumption.dart
+++ b/lib/features/dashboard/view/widgets/consumption.dart
@@ -61,7 +61,7 @@ class Consumption extends StatelessWidget {
SizedBox.square(
dimension: 60,
child: Image.asset(
- Assets.imagesTestDash2,
+ Assets.assetsImagesTestDash2,
fit: BoxFit.contain,
),
)
diff --git a/lib/features/dashboard/view/widgets/live_monitor_tab.dart b/lib/features/dashboard/view/widgets/live_monitor_tab.dart
index 1b4fb2e..71de05a 100644
--- a/lib/features/dashboard/view/widgets/live_monitor_tab.dart
+++ b/lib/features/dashboard/view/widgets/live_monitor_tab.dart
@@ -15,21 +15,21 @@ class LiveMonitorTab extends StatelessWidget {
children: [
Expanded(
child: LiveMonitorWidget(
- image: Assets.iconsActive,
+ image: Assets.assetsIconsActive,
title: StringsManager.active,
value: '10.00w',
),
),
Expanded(
child: LiveMonitorWidget(
- image: Assets.iconsVoltMeter,
+ image: Assets.assetsIconsVoltMeter,
title: StringsManager.current,
value: '12.1 A',
),
),
Expanded(
child: LiveMonitorWidget(
- image: Assets.iconsFrequency,
+ image: Assets.assetsIconsFrequency,
title: StringsManager.frequency,
value: '50 Hz',
),
diff --git a/lib/features/devices/bloc/devices_cubit.dart b/lib/features/devices/bloc/devices_cubit.dart
index 4f3f4b4..c362cc6 100644
--- a/lib/features/devices/bloc/devices_cubit.dart
+++ b/lib/features/devices/bloc/devices_cubit.dart
@@ -10,7 +10,7 @@ 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/features/devices/model/status_model.dart';
import 'package:syncrow_app/features/devices/view/widgets/ACs/acs_view.dart';
-import 'package:syncrow_app/features/devices/view/widgets/curtains/curtain_view.dart';
+import 'package:syncrow_app/features/devices/view/widgets/curtains/curtain_list_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/gateway/gateway_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/lights/lights_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/three_gang/three_gang_interface.dart';
@@ -86,7 +86,7 @@ class DevicesCubit extends Cubit {
case DeviceType.DoorLock:
return const DoorsListView();
case DeviceType.Curtain:
- return const CurtainView();
+ return const CurtainListView();
// case DeviceType.ThreeGang:
// return const ThreeGangSwitchesView();
case DeviceType.Gateway:
@@ -387,6 +387,88 @@ class DevicesCubit extends Cubit {
// emitSafe(LightBrightnessChanged(value));
// }
// }
+
+//////////////////////////////////CURTAINS//////////////////////////////////////
+ double curtainWidth = 270;
+ double curtainOpeningSpace = 195;
+ double blindWindowHight = 310;
+ double blindOpeningSpace = 245;
+ double _openPercentage = 0;
+ bool isMoving = false;
+
+ openCurtain(DeviceType type) async {
+ if (state is CurtainsIsOpening) {
+ return;
+ }
+
+ isMoving = true;
+ while (_openPercentage < 100.0) {
+ if (state is CurtainsIsClosing) {
+ //listen to interruption by the closing process
+ pauseCurtain();
+ break;
+ }
+
+ emit(CurtainsIsOpening());
+
+ if (isMoving) {
+ await Future.delayed(const Duration(milliseconds: 200), () {
+ _openPercentage += 10.0;
+ //25.5 is the 10% of the curtain opening space, its used to update the
+ // animated container of thecurtain
+
+ type == DeviceType.Curtain
+ ? curtainWidth -= curtainOpeningSpace / 10
+ : blindWindowHight -= blindOpeningSpace / 10;
+ if (_openPercentage >= 100.0) {
+ pauseCurtain();
+ }
+ });
+ } else {
+ pauseCurtain();
+ break;
+ }
+ }
+ }
+
+ closeCurtain(DeviceType type) async {
+ if (state is CurtainsIsClosing) {
+ return;
+ }
+
+ isMoving = true;
+ while (_openPercentage > 0.0) {
+ if (state is CurtainsIsOpening) {
+ // interrupted by the opening process
+ pauseCurtain();
+ break;
+ }
+
+ emit(CurtainsIsClosing());
+
+ if (isMoving) {
+ await Future.delayed(const Duration(milliseconds: 200), () {
+ _openPercentage -= 10.0;
+ //25.5 is the 10% of the curtain opening space, its used to update the
+ type == DeviceType.Curtain
+ ? curtainWidth += curtainOpeningSpace / 10
+ : blindWindowHight += 24.5;
+
+ if (_openPercentage <= 0.0) {
+ pauseCurtain();
+ }
+ });
+ } else {
+ pauseCurtain();
+ break;
+ }
+ }
+ }
+
+ pauseCurtain() {
+ isMoving = false;
+ emit(CurtainsStopped());
+ }
}
enum LightMode {
diff --git a/lib/features/devices/bloc/devices_state.dart b/lib/features/devices/bloc/devices_state.dart
index 4f89268..e1a45d4 100644
--- a/lib/features/devices/bloc/devices_state.dart
+++ b/lib/features/devices/bloc/devices_state.dart
@@ -80,3 +80,10 @@ class DevicesCategoriesError extends DevicesState {
DevicesCategoriesError(this.errorMsg);
}
+
+// Curtains
+class CurtainsIsOpening extends DevicesState {}
+
+class CurtainsIsClosing extends DevicesState {}
+
+class CurtainsStopped extends DevicesState {}
diff --git a/lib/features/devices/model/device_category_model.dart b/lib/features/devices/model/device_category_model.dart
index 00a1fa0..ba40509 100644
--- a/lib/features/devices/model/device_category_model.dart
+++ b/lib/features/devices/model/device_category_model.dart
@@ -54,13 +54,13 @@ class DevicesCategoryModel {
}
Map deviceTypeIconMap = {
- DeviceType.AC: Assets.iconsAC,
- DeviceType.LightBulb: Assets.iconsLight,
- DeviceType.DoorLock: Assets.iconsDoorLock,
- DeviceType.Curtain: Assets.iconsCurtain,
- DeviceType.Gateway: Assets.iconsGateway,
- DeviceType.CeilingSensor: Assets.iconsSensors,
- DeviceType.WallSensor: Assets.iconsSensors,
- DeviceType.ThreeGang: Assets.iconsGang,
- DeviceType.Other: Assets.iconsAC,
+ DeviceType.AC: Assets.assetsIconsAC,
+ DeviceType.LightBulb: Assets.assetsIconsLight,
+ DeviceType.DoorLock: Assets.assetsIconsDoorLock,
+ DeviceType.Curtain: Assets.assetsIconsCurtain,
+ DeviceType.Gateway: Assets.assetsIconsGateway,
+ DeviceType.CeilingSensor: Assets.assetsIconsSensors,
+ DeviceType.WallSensor: Assets.assetsIconsSensors,
+ DeviceType.ThreeGang: Assets.assetsIconsGang,
+ DeviceType.Other: Assets.assetsIconsAC,
};
diff --git a/lib/features/devices/model/device_control_model.dart b/lib/features/devices/model/device_control_model.dart
index c2a66e2..4941991 100644
--- a/lib/features/devices/model/device_control_model.dart
+++ b/lib/features/devices/model/device_control_model.dart
@@ -10,7 +10,6 @@ class DeviceControlModel {
});
factory DeviceControlModel.fromJson(Map json) {
- print('json: $json');
return DeviceControlModel(
deviceId: json['deviceUuid'],
code: json['code'],
diff --git a/lib/features/devices/model/device_model.dart b/lib/features/devices/model/device_model.dart
index 4cd6417..4d84eab 100644
--- a/lib/features/devices/model/device_model.dart
+++ b/lib/features/devices/model/device_model.dart
@@ -42,22 +42,22 @@ class DeviceModel {
DeviceType type = devicesTypesMap[json['productType']] ?? DeviceType.Other;
if (type == DeviceType.LightBulb) {
- tempIcon = Assets.iconsLight;
+ tempIcon = Assets.assetsIconsLight;
} else if (type == DeviceType.CeilingSensor ||
type == DeviceType.WallSensor) {
- tempIcon = Assets.iconsSensors;
+ tempIcon = Assets.assetsIconsSensors;
} else if (type == DeviceType.AC) {
- tempIcon = Assets.iconsAC;
+ tempIcon = Assets.assetsIconsAC;
} else if (type == DeviceType.DoorLock) {
- tempIcon = Assets.iconsDoorLock;
+ tempIcon = Assets.assetsIconsDoorLock;
} else if (type == DeviceType.Curtain) {
- tempIcon = Assets.iconsCurtain;
+ tempIcon = Assets.assetsIconsCurtain;
} else if (type == DeviceType.ThreeGang) {
- tempIcon = Assets.icons3GangSwitch;
+ tempIcon = Assets.assetsIcons3GangSwitch;
} else if (type == DeviceType.Gateway) {
- tempIcon = Assets.iconsGateway;
+ tempIcon = Assets.assetsIconsGateway;
} else {
- tempIcon = Assets.iconsLogo;
+ tempIcon = Assets.assetsIconsLogo;
}
return DeviceModel(
icon: tempIcon,
diff --git a/lib/features/devices/view/widgets/ACs/ac_interface.dart b/lib/features/devices/view/widgets/ACs/ac_interface.dart
index 417528b..209f4b2 100644
--- a/lib/features/devices/view/widgets/ACs/ac_interface.dart
+++ b/lib/features/devices/view/widgets/ACs/ac_interface.dart
@@ -54,7 +54,7 @@ class AcInterface extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
- Assets.imagesBackground,
+ Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
diff --git a/lib/features/devices/view/widgets/ACs/ac_interface_controls.dart b/lib/features/devices/view/widgets/ACs/ac_interface_controls.dart
index 9d39be6..3b1b3a4 100644
--- a/lib/features/devices/view/widgets/ACs/ac_interface_controls.dart
+++ b/lib/features/devices/view/widgets/ACs/ac_interface_controls.dart
@@ -31,7 +31,8 @@ class AcInterfaceControls extends StatelessWidget {
child: DefaultContainer(
height: 55,
child: Center(
- child: SvgPicture.asset(Assets.iconsAutomatedClock),
+ child:
+ SvgPicture.asset(Assets.assetsIconsAutomatedClock),
),
),
),
@@ -43,7 +44,7 @@ class AcInterfaceControls extends StatelessWidget {
child: DefaultContainer(
height: 55,
child: Center(
- child: SvgPicture.asset(Assets.iconsLock),
+ child: SvgPicture.asset(Assets.assetsIconsLock),
),
),
),
diff --git a/lib/features/devices/view/widgets/ACs/ac_interface_temp_unit.dart b/lib/features/devices/view/widgets/ACs/ac_interface_temp_unit.dart
index 883e103..f022ca3 100644
--- a/lib/features/devices/view/widgets/ACs/ac_interface_temp_unit.dart
+++ b/lib/features/devices/view/widgets/ACs/ac_interface_temp_unit.dart
@@ -128,7 +128,7 @@ class AcInterfaceTempUnit extends StatelessWidget {
}
},
child: SvgPicture.asset(
- Assets.iconsMinus,
+ Assets.assetsIconsMinus,
),
),
),
@@ -178,7 +178,7 @@ class AcInterfaceTempUnit extends StatelessWidget {
}
},
child: SvgPicture.asset(
- Assets.iconsPlus,
+ Assets.assetsIconsPlus,
height: 24,
width: 24,
),
diff --git a/lib/features/devices/view/widgets/ACs/ac_temp_widget.dart b/lib/features/devices/view/widgets/ACs/ac_temp_widget.dart
index 1517119..f3bf6bf 100644
--- a/lib/features/devices/view/widgets/ACs/ac_temp_widget.dart
+++ b/lib/features/devices/view/widgets/ACs/ac_temp_widget.dart
@@ -35,7 +35,7 @@ class ACTempWidget extends StatelessWidget {
// .setACTemp(DeviceModel, DeviceModel.temperature - 0.5);
},
child: SvgPicture.asset(
- Assets.iconsMinus,
+ Assets.assetsIconsMinus,
),
),
),
@@ -55,7 +55,7 @@ class ACTempWidget extends StatelessWidget {
// .setACTemp(DeviceModel, DeviceModel.temperature + 0.5);
},
child: SvgPicture.asset(
- Assets.iconsPlus,
+ Assets.assetsIconsPlus,
height: 24,
width: 24,
),
diff --git a/lib/features/devices/view/widgets/ACs/acs_view.dart b/lib/features/devices/view/widgets/ACs/acs_view.dart
index 9bb0af1..5ce1401 100644
--- a/lib/features/devices/view/widgets/ACs/acs_view.dart
+++ b/lib/features/devices/view/widgets/ACs/acs_view.dart
@@ -41,7 +41,7 @@ class ACsView extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
- Assets.imagesBackground,
+ Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
diff --git a/lib/features/devices/view/widgets/ACs/universal_ac_temp.dart b/lib/features/devices/view/widgets/ACs/universal_ac_temp.dart
index f2566c3..00de5f0 100644
--- a/lib/features/devices/view/widgets/ACs/universal_ac_temp.dart
+++ b/lib/features/devices/view/widgets/ACs/universal_ac_temp.dart
@@ -30,7 +30,7 @@ class UniversalACTemp extends StatelessWidget {
// .setTempToAll(DevicesCubit.universalACTemp - .5);
},
child: SvgPicture.asset(
- Assets.iconsMinus,
+ Assets.assetsIconsMinus,
),
),
),
@@ -50,7 +50,7 @@ class UniversalACTemp extends StatelessWidget {
// .setTempToAll(DevicesCubit.universalACTemp + .5);
},
child: SvgPicture.asset(
- Assets.iconsPlus,
+ Assets.assetsIconsPlus,
height: 24,
width: 24,
),
diff --git a/lib/features/devices/view/widgets/curtains/blind_view.dart b/lib/features/devices/view/widgets/curtains/blind_view.dart
new file mode 100644
index 0000000..dc47d41
--- /dev/null
+++ b/lib/features/devices/view/widgets/curtains/blind_view.dart
@@ -0,0 +1,163 @@
+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_model.dart';
+import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
+import 'package:syncrow_app/generated/assets.dart';
+import 'package:syncrow_app/utils/resource_manager/constants.dart';
+
+class BlindsView extends StatelessWidget {
+ const BlindsView({
+ super.key,
+ this.blind,
+ });
+ final DeviceModel? blind;
+ @override
+ Widget build(BuildContext context) {
+ return BlocProvider(
+ create: (context) => DevicesCubit.getInstance(),
+ child: BlocBuilder(
+ builder: (context, state) {
+ return DefaultScaffold(
+ title: blind?.name ?? 'Blinds',
+ child: Column(
+ children: [
+ Column(
+ children: [
+ Stack(
+ alignment: Alignment.topCenter,
+ children: [
+ Container(
+ height: 340,
+ width: 365,
+ decoration: const BoxDecoration(
+ image: DecorationImage(
+ image: AssetImage(
+ Assets.assetsImagesWindow,
+ ),
+ ),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.only(top: 15, bottom: 10),
+ child: AnimatedContainer(
+ duration: const Duration(milliseconds: 200),
+ curve: Curves.linear,
+ height: DevicesCubit.get(context).blindWindowHight,
+ width: 270,
+ child: Stack(
+ children: List.generate(
+ 25,
+ (index) {
+ double spacing = DevicesCubit.get(context)
+ .blindWindowHight /
+ 24;
+ double topPosition = index * spacing;
+ return AnimatedPositioned(
+ duration: const Duration(milliseconds: 200),
+ curve: Curves.linear,
+ top: topPosition,
+ child: SizedBox(
+ height: 10,
+ width: 270,
+ child: Image.asset(
+ Assets.assetsImagesHorizintalBlade,
+ fit: BoxFit.fill,
+ ),
+ ),
+ );
+ },
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ const SizedBox(height: 80),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ children: [
+ DecoratedBox(
+ decoration:
+ BoxDecoration(shape: BoxShape.circle, boxShadow: [
+ BoxShadow(
+ color: Colors.grey.withOpacity(0.5),
+ spreadRadius: 1,
+ blurRadius: 5,
+ offset: const Offset(3, 3),
+ ),
+ ]),
+ child: InkWell(
+ overlayColor:
+ MaterialStateProperty.all(Colors.transparent),
+ onTap: () {
+ // DevicesCubit.get(context).setHight(false);
+ DevicesCubit.get(context).openCurtain(
+ blind?.productType! ?? DeviceType.Blind);
+ },
+ child: Image.asset(
+ Assets.assetsImagesUp,
+ width: 60,
+ height: 60,
+ ),
+ ),
+ ),
+ DecoratedBox(
+ decoration:
+ BoxDecoration(shape: BoxShape.circle, boxShadow: [
+ BoxShadow(
+ color: Colors.grey.withOpacity(0.5),
+ spreadRadius: 1,
+ blurRadius: 5,
+ offset: const Offset(3, 3),
+ ),
+ ]),
+ child: InkWell(
+ overlayColor:
+ MaterialStateProperty.all(Colors.transparent),
+ onTap: () {
+ DevicesCubit.get(context).pauseCurtain();
+ },
+ child: Image.asset(
+ Assets.assetsImagesPause,
+ width: 60,
+ height: 60,
+ ),
+ ),
+ ),
+ DecoratedBox(
+ decoration:
+ BoxDecoration(shape: BoxShape.circle, boxShadow: [
+ BoxShadow(
+ color: Colors.grey.withOpacity(0.5),
+ spreadRadius: 1,
+ blurRadius: 5,
+ offset: const Offset(3, 3),
+ ),
+ ]),
+ child: InkWell(
+ overlayColor:
+ MaterialStateProperty.all(Colors.transparent),
+ onTap: () {
+ DevicesCubit.get(context).closeCurtain(
+ blind?.productType! ?? DeviceType.Blind);
+ },
+ child: Image.asset(
+ Assets.assetsImagesDown,
+ width: 60,
+ height: 60,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ],
+ ),
+ );
+ },
+ ),
+ );
+ }
+}
diff --git a/lib/features/devices/view/widgets/curtains/blinds_bottons.dart b/lib/features/devices/view/widgets/curtains/blinds_bottons.dart
new file mode 100644
index 0000000..c6e1886
--- /dev/null
+++ b/lib/features/devices/view/widgets/curtains/blinds_bottons.dart
@@ -0,0 +1,83 @@
+// import 'package:flutter/material.dart';
+// import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
+// import 'package:syncrow_app/generated2/assets.dart';
+
+// class BlindsBottons extends StatelessWidget {
+// const BlindsBottons({
+// super.key,
+// });
+
+// @override
+// Widget build(BuildContext context) {
+// return Row(
+// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+// children: [
+// DecoratedBox(
+// decoration: BoxDecoration(shape: BoxShape.circle, boxShadow: [
+// BoxShadow(
+// color: Colors.grey.withOpacity(0.5),
+// spreadRadius: 1,
+// blurRadius: 5,
+// offset: const Offset(3, 3),
+// ),
+// ]),
+// child: InkWell(
+// overlayColor: MaterialStateProperty.all(Colors.transparent),
+// onTap: () {
+// // DevicesCubit.get(context).setHight(false);
+// DevicesCubit.get(context).closeCurtain();
+// },
+// child: Image.asset(
+// Assets.assetsImagesUp,
+// width: 60,
+// height: 60,
+// ),
+// ),
+// ),
+// DecoratedBox(
+// decoration: BoxDecoration(shape: BoxShape.circle, boxShadow: [
+// BoxShadow(
+// color: Colors.grey.withOpacity(0.5),
+// spreadRadius: 1,
+// blurRadius: 5,
+// offset: const Offset(3, 3),
+// ),
+// ]),
+// child: InkWell(
+// overlayColor: MaterialStateProperty.all(Colors.transparent),
+// onTap: () {
+// // DevicesCubit.get(context).setHight(false);
+// },
+// child: Image.asset(
+// Assets.assetsImagesPause,
+// width: 60,
+// height: 60,
+// ),
+// ),
+// ),
+// DecoratedBox(
+// decoration: BoxDecoration(shape: BoxShape.circle, boxShadow: [
+// BoxShadow(
+// color: Colors.grey.withOpacity(0.5),
+// spreadRadius: 1,
+// blurRadius: 5,
+// offset: const Offset(3, 3),
+// ),
+// ]),
+// child: InkWell(
+// overlayColor: MaterialStateProperty.all(Colors.transparent),
+// onTap: () {
+// // DevicesCubit.get(context).setHight(true);
+// DevicesCubit.get(context).openCurtain();
+// },
+// child: Image.asset(
+// Assets.assetsImagesDown,
+// width: 60,
+// height: 60,
+// ),
+// ),
+// ),
+// ],
+// );
+// }
+// }
diff --git a/lib/features/devices/view/widgets/curtains/curtain_buttons.dart b/lib/features/devices/view/widgets/curtains/curtain_buttons.dart
new file mode 100644
index 0000000..356023c
--- /dev/null
+++ b/lib/features/devices/view/widgets/curtains/curtain_buttons.dart
@@ -0,0 +1,116 @@
+part of "curtain_view.dart";
+
+class CurtainButtons extends StatelessWidget {
+ const CurtainButtons({super.key, required this.curtain});
+ final DeviceModel curtain;
+ @override
+ Widget build(BuildContext context) {
+ return Row(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ children: [
+ Stack(
+ alignment: Alignment.center,
+ children: [
+ DecoratedBox(
+ decoration: BoxDecoration(shape: BoxShape.circle, boxShadow: [
+ BoxShadow(
+ color: Colors.grey.withOpacity(0.5),
+ spreadRadius: 1,
+ blurRadius: 5,
+ offset: const Offset(3, 3),
+ ),
+ ]),
+ child: InkWell(
+ overlayColor: MaterialStateProperty.all(Colors.transparent),
+ onTap: () {
+ DevicesCubit.get(context).openCurtain(curtain.productType!);
+ },
+ child: const SizedBox.square(
+ dimension: 60,
+ ),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.only(right: 5, bottom: 5),
+ child: InkWell(
+ overlayColor: MaterialStateProperty.all(Colors.transparent),
+ onTap: () {
+ DevicesCubit.get(context).openCurtain(curtain.productType!);
+ },
+ child: SvgPicture.asset(
+ Assets.assetsIconsCurtainsIconOpenCurtain,
+ width: 110,
+ height: 110,
+ ),
+ ),
+ )
+ ],
+ ),
+ DecoratedBox(
+ decoration: BoxDecoration(shape: BoxShape.circle, boxShadow: [
+ BoxShadow(
+ color: Colors.grey.withOpacity(0.5),
+ spreadRadius: 1,
+ blurRadius: 5,
+ offset: const Offset(3, 3),
+ ),
+ ]),
+ child: InkWell(
+ overlayColor: MaterialStateProperty.all(Colors.transparent),
+ onTap: () {
+ DevicesCubit.get(context).pauseCurtain();
+ },
+ child: Image.asset(
+ Assets.assetsImagesPause,
+ width: 60,
+ height: 60,
+ ),
+ ),
+ ),
+ Stack(
+ alignment: Alignment.center,
+ children: [
+ DecoratedBox(
+ decoration: BoxDecoration(shape: BoxShape.circle, boxShadow: [
+ BoxShadow(
+ color: Colors.grey.withOpacity(0.5),
+ spreadRadius: 1,
+ blurRadius: 5,
+ offset: const Offset(3, 3),
+ ),
+ ]),
+ child: const SizedBox.square(
+ dimension: 60,
+ ),
+ // InkWell(
+ // overlayColor: MaterialStateProperty.all(Colors.transparent),
+ // onTap: () {
+ // DevicesCubit.get(context).closeCurtain(curtain.productType!);
+ // },
+ // child: SvgPicture.asset(
+ // Assets.assetsIconsCurtainsIconCloseCurtain,
+ // width: 60,
+ // height: 60,
+ // ),
+ // ),
+ ),
+ Padding(
+ padding: const EdgeInsets.only(right: 5, bottom: 5),
+ child: InkWell(
+ overlayColor: MaterialStateProperty.all(Colors.transparent),
+ onTap: () {
+ DevicesCubit.get(context).closeCurtain(curtain.productType!);
+ },
+ child: SvgPicture.asset(
+ Assets.assetsIconsCurtainsIconCloseCurtain,
+ width: 110,
+ height: 110,
+ ),
+ ),
+ )
+ ],
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/features/devices/view/widgets/curtains/curtain_list.dart b/lib/features/devices/view/widgets/curtains/curtain_list.dart
index 9659fdd..eaf7f07 100644
--- a/lib/features/devices/view/widgets/curtains/curtain_list.dart
+++ b/lib/features/devices/view/widgets/curtains/curtain_list.dart
@@ -25,7 +25,7 @@ class CurtainList extends StatelessWidget {
const BodySmall(text: "All Curtains"),
const SizedBox(height: 5),
UniversalSwitch(
- category: DevicesCubit.getInstance().chosenCategory!,
+ category: DevicesCubit.get(context).chosenCategory!,
),
// other ACs controls
@@ -34,17 +34,16 @@ class CurtainList extends StatelessWidget {
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(0),
itemCount:
- DevicesCubit.getInstance().chosenCategory!.devices!.length,
+ DevicesCubit.get(context).chosenCategory!.devices!.length,
itemBuilder: (context, index) {
- DeviceModel curtain = DevicesCubit.getInstance()
- .chosenCategory!
- .devices![index];
+ DeviceModel curtain =
+ DevicesCubit.get(context).chosenCategory!.devices![index];
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 20),
BodySmall(
- text: DevicesCubit.getInstance()
+ text: DevicesCubit.get(context)
.chosenCategory!
.devices![index]
.name ??
diff --git a/lib/features/devices/view/widgets/curtains/curtain_list_view.dart b/lib/features/devices/view/widgets/curtains/curtain_list_view.dart
new file mode 100644
index 0000000..445ad4f
--- /dev/null
+++ b/lib/features/devices/view/widgets/curtains/curtain_list_view.dart
@@ -0,0 +1,22 @@
+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/view/widgets/ACs/category_view_app_bar.dart';
+import 'package:syncrow_app/features/devices/view/widgets/curtains/curtain_list.dart';
+import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
+
+class CurtainListView extends StatelessWidget {
+ const CurtainListView({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return BlocBuilder(
+ builder: (context, state) {
+ return const DefaultScaffold(
+ appBar: CategoryViewAppBar(),
+ child: CurtainList(),
+ );
+ },
+ );
+ }
+}
diff --git a/lib/features/devices/view/widgets/curtains/curtain_view.dart b/lib/features/devices/view/widgets/curtains/curtain_view.dart
index c67b0c6..8815cb2 100644
--- a/lib/features/devices/view/widgets/curtains/curtain_view.dart
+++ b/lib/features/devices/view/widgets/curtains/curtain_view.dart
@@ -1,56 +1,87 @@
import 'package:flutter/material.dart';
-import 'package:flutter/services.dart';
+import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
-import 'package:syncrow_app/features/devices/view/widgets/ACs/category_view_app_bar.dart';
-import 'package:syncrow_app/features/devices/view/widgets/curtains/curtain_list.dart';
+import 'package:syncrow_app/features/devices/model/device_model.dart';
+import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/generated/assets.dart';
-import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
-import 'package:syncrow_app/utils/resource_manager/constants.dart';
+
+part "curtain_buttons.dart";
class CurtainView extends StatelessWidget {
- const CurtainView({super.key});
-
+ const CurtainView({super.key, required this.curtain});
+ final DeviceModel curtain;
@override
Widget build(BuildContext context) {
- return BlocBuilder(
- builder: (context, state) {
- return AnnotatedRegion(
- value: SystemUiOverlayStyle(
- statusBarColor: ColorsManager.primaryColor.withOpacity(0.5),
- statusBarIconBrightness: Brightness.light,
- ),
- child: Scaffold(
- backgroundColor: ColorsManager.backgroundColor,
- extendBodyBehindAppBar: true,
- extendBody: true,
- appBar: const CategoryViewAppBar(),
- body: SafeArea(
- child: Container(
- width: MediaQuery.sizeOf(context).width,
- height: MediaQuery.sizeOf(context).height,
- decoration: const BoxDecoration(
- image: DecorationImage(
- image: AssetImage(
- Assets.imagesBackground,
+ return BlocProvider(
+ create: (context) => DevicesCubit.getInstance(),
+ child: BlocBuilder(
+ builder: (context, state) => DefaultScaffold(
+ title: curtain.name,
+ child: Column(
+ children: [
+ Stack(
+ alignment: Alignment.centerLeft,
+ children: [
+ Container(
+ height: 340,
+ width: 365,
+ decoration: const BoxDecoration(
+ image: DecorationImage(
+ image: AssetImage(
+ Assets.assetsImagesWindow,
+ ),
+ ),
),
- fit: BoxFit.cover,
- opacity: 0.4,
),
- ),
- child: Padding(
- padding: EdgeInsets.only(
- top: Constants.appBarHeight,
- left: Constants.defaultPadding,
- right: Constants.defaultPadding,
+ Padding(
+ padding: const EdgeInsets.all(40),
+ child: AnimatedContainer(
+ duration: const Duration(milliseconds: 200),
+ curve: Curves.linear,
+ height: 310,
+ width: DevicesCubit.getInstance().curtainWidth,
+ child: Stack(
+ children: List.generate(
+ 10,
+ (index) {
+ double spacing =
+ DevicesCubit.getInstance().curtainWidth / 9;
+ double leftMostPosition = index * spacing;
+ return AnimatedPositioned(
+ duration: const Duration(milliseconds: 200),
+ curve: Curves.linear,
+ left: leftMostPosition,
+ child: SizedBox(
+ height: 320,
+ width: 32,
+ child: SvgPicture.asset(
+ Assets.assetsIconsCurtainsIconVerticalBlade,
+ fit: BoxFit.fill,
+ ),
+ ),
+ );
+ },
+ ),
+ ),
+ ),
),
- child: const CurtainList(),
- ),
+ Positioned(
+ top: 27,
+ left: 43,
+ child: SvgPicture.asset(
+ Assets.assetsIconsCurtainsIconCurtainHolder)),
+ ],
),
- ),
+ const SizedBox(height: 80),
+ CurtainButtons(
+ curtain: curtain,
+ ),
+ ],
),
- );
- },
+ ),
+ ),
);
}
}
diff --git a/lib/features/devices/view/widgets/devices_mode_tab.dart b/lib/features/devices/view/widgets/devices_mode_tab.dart
index 4ee9877..12d82ae 100644
--- a/lib/features/devices/view/widgets/devices_mode_tab.dart
+++ b/lib/features/devices/view/widgets/devices_mode_tab.dart
@@ -29,7 +29,7 @@ class DevicesModeTab extends StatelessWidget {
height: 30,
width: 25,
child: SvgPicture.asset(
- Assets.iconsWinter,
+ Assets.assetsIconsWinter,
fit: BoxFit.contain,
),
),
@@ -57,7 +57,7 @@ class DevicesModeTab extends StatelessWidget {
height: 30,
width: 25,
child: SvgPicture.asset(
- Assets.iconsSummer,
+ Assets.assetsIconsSummer,
fit: BoxFit.contain,
),
),
diff --git a/lib/features/devices/view/widgets/devices_view_body.dart b/lib/features/devices/view/widgets/devices_view_body.dart
index 7a9d8fe..61c4f5b 100644
--- a/lib/features/devices/view/widgets/devices_view_body.dart
+++ b/lib/features/devices/view/widgets/devices_view_body.dart
@@ -8,7 +8,6 @@ import 'package:syncrow_app/features/devices/view/widgets/room_page.dart';
import 'package:syncrow_app/features/devices/view/widgets/rooms_slider.dart';
import 'package:syncrow_app/features/devices/view/widgets/wizard_page.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
-import 'package:syncrow_app/utils/resource_manager/constants.dart';
class DevicesViewBody extends StatelessWidget {
const DevicesViewBody({
@@ -17,93 +16,65 @@ class DevicesViewBody extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return BlocConsumer(
- listener: (context, state) {
- // if (state is GetDevicesError) {
- // ScaffoldMessenger.of(context).showSnackBar(
- // SnackBar(
- // content: Text(state.errorMsg),
- // ),
- // );
- // } else if (state is DevicesCategoriesError) {
- // ScaffoldMessenger.of(context).showSnackBar(
- // SnackBar(
- // content: Text(state.errorMsg),
- // ),
- // );
- // } else if (state is DeviceControlError) {
- // ScaffoldMessenger.of(context).showSnackBar(
- // SnackBar(
- // content: Text(state.errorMsg),
- // ),
- // );
- // }
- },
+ return BlocBuilder(
builder: (context, state) {
if (state is DevicesLoading ||
state is GetDevicesLoading ||
state is DevicesCategoriesLoading) {
return const Center(child: CircularProgressIndicator());
} else {
- return Padding(
- padding: EdgeInsets.only(
- top: Constants.appBarHeight,
- bottom: Constants.bottomNavBarHeight,
- ),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- const DevicesViewHeader(),
- const RoomsSlider(),
- const SizedBox(
- height: 10,
+ return Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ const DevicesViewHeader(),
+ const RoomsSlider(),
+ const SizedBox(
+ height: 10,
+ ),
+ Expanded(
+ child: PageView(
+ controller: HomeCubit.getInstance().devicesPageController,
+ onPageChanged: (index) {
+ HomeCubit.getInstance().devicesPageChanged(index);
+ },
+ children: [
+ const WizardPage(),
+ if (HomeCubit.getInstance().selectedSpace != null)
+ if (HomeCubit.getInstance().selectedSpace!.rooms != null)
+ ...HomeCubit.getInstance().selectedSpace!.rooms!.map(
+ (room) {
+ return RoomPage(
+ room: room,
+ );
+ },
+ )
+ ],
),
- Expanded(
- child: PageView(
- controller: HomeCubit.getInstance().devicesPageController,
- onPageChanged: (index) {
- HomeCubit.getInstance().devicesPageChanged(index);
- },
- children: [
- const WizardPage(),
- if (HomeCubit.getInstance().selectedSpace != null)
- if (HomeCubit.getInstance().selectedSpace!.rooms !=
- null)
- ...HomeCubit.getInstance().selectedSpace!.rooms!.map(
- (room) {
- return RoomPage(
- room: room,
- );
- },
- )
- ],
- ),
- ),
- HomeCubit.getInstance().selectedSpace != null
- ? Padding(
- padding: const EdgeInsets.symmetric(
- vertical: 7,
- ),
- child: SmoothPageIndicator(
- controller:
- HomeCubit.getInstance().devicesPageController,
- count: HomeCubit.getInstance()
- .selectedSpace!
- .rooms!
- .length +
- 1,
- effect: const WormEffect(
- paintStyle: PaintingStyle.stroke,
- dotHeight: 8,
- dotWidth: 8,
- ),
- ),
- )
- : const Center(
- child: BodyLarge(text: 'No Home Found'),
+ ),
+ HomeCubit.getInstance().selectedSpace != null
+ ? Padding(
+ padding: const EdgeInsets.symmetric(
+ vertical: 7,
),
- ],
- ),
+ child: SmoothPageIndicator(
+ controller:
+ HomeCubit.getInstance().devicesPageController,
+ count: HomeCubit.getInstance()
+ .selectedSpace!
+ .rooms!
+ .length +
+ 1,
+ effect: const WormEffect(
+ paintStyle: PaintingStyle.stroke,
+ dotHeight: 8,
+ dotWidth: 8,
+ ),
+ ),
+ )
+ : const Center(
+ child: BodyLarge(text: 'No Home Found'),
+ ),
+ ],
);
}
},
diff --git a/lib/features/devices/view/widgets/devices_view_header.dart b/lib/features/devices/view/widgets/devices_view_header.dart
index 43c98c4..ed24896 100644
--- a/lib/features/devices/view/widgets/devices_view_header.dart
+++ b/lib/features/devices/view/widgets/devices_view_header.dart
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:syncrow_app/features/devices/view/widgets/devices_mode_tab.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
import 'package:syncrow_app/utils/context_extension.dart';
-import 'package:syncrow_app/utils/resource_manager/constants.dart';
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
class DevicesViewHeader extends StatelessWidget {
@@ -12,25 +11,20 @@ class DevicesViewHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.symmetric(
- horizontal: Constants.defaultPadding,
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- TitleMedium(
- text: StringsManager.devices,
- style: context.titleMedium.copyWith(
- fontSize: 25,
- ),
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ TitleMedium(
+ text: StringsManager.devices,
+ style: context.titleMedium.copyWith(
+ fontSize: 25,
),
- const DevicesModeTab(),
- const SizedBox(
- height: 20,
- ),
- ],
- ),
+ ),
+ const DevicesModeTab(),
+ const SizedBox(
+ height: 20,
+ ),
+ ],
);
}
}
diff --git a/lib/features/devices/view/widgets/lights/light_interface_recent_color.dart b/lib/features/devices/view/widgets/lights/light_interface_recent_color.dart
index ad0509e..21d6163 100644
--- a/lib/features/devices/view/widgets/lights/light_interface_recent_color.dart
+++ b/lib/features/devices/view/widgets/lights/light_interface_recent_color.dart
@@ -55,7 +55,7 @@ class LightInterfaceRecentColor extends StatelessWidget {
color: ColorsManager.greyColor,
),
SvgPicture.asset(
- Assets.iconsKalvin,
+ Assets.assetsIconsKalvin,
height: 40,
width: 40,
),
@@ -63,7 +63,7 @@ class LightInterfaceRecentColor extends StatelessWidget {
width: 10,
),
SvgPicture.asset(
- Assets.iconsColorWheel,
+ Assets.assetsIconsColorWheel,
height: 40,
width: 40,
),
diff --git a/lib/features/devices/view/widgets/lights/lights_view.dart b/lib/features/devices/view/widgets/lights/lights_view.dart
index f16a444..0ff37eb 100644
--- a/lib/features/devices/view/widgets/lights/lights_view.dart
+++ b/lib/features/devices/view/widgets/lights/lights_view.dart
@@ -46,7 +46,7 @@ class LightsView extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
- Assets.imagesBackground,
+ Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
diff --git a/lib/features/devices/view/widgets/no_devices_view.dart b/lib/features/devices/view/widgets/no_devices_view.dart
index 55ef22a..b21bab1 100644
--- a/lib/features/devices/view/widgets/no_devices_view.dart
+++ b/lib/features/devices/view/widgets/no_devices_view.dart
@@ -14,7 +14,7 @@ class NoDevicesView extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
- Assets.imagesBoxEmpty,
+ Assets.assetsImagesBoxEmpty,
opacity: const AlwaysStoppedAnimation(0.5),
scale: 1,
width: 140,
diff --git a/lib/features/devices/view/widgets/presence_sensors/ceiling_sensor_interface.dart b/lib/features/devices/view/widgets/presence_sensors/ceiling_sensor_interface.dart
index 238cdc3..1a00f1f 100644
--- a/lib/features/devices/view/widgets/presence_sensors/ceiling_sensor_interface.dart
+++ b/lib/features/devices/view/widgets/presence_sensors/ceiling_sensor_interface.dart
@@ -51,7 +51,7 @@ class CeilingSensorInterface extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
- Assets.imagesBackground,
+ Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
@@ -104,8 +104,9 @@ class CeilingSensorInterface extends StatelessWidget {
},
child: SvgPicture.asset(
state == 'presence'
- ? Assets.presenceSensorAssetsPresence
- : Assets.presenceSensorAssetsPresenceSensorMotion,
+ ? Assets.assetsIconsPresenceSensorAssetsPresence
+ : Assets
+ .assetsIconsPresenceSensorAssetsPresenceSensorMotion,
width: 100,
height: 100,
// colorFilter: ColorFilter.mode(
@@ -258,17 +259,17 @@ class CeilingSensorInterface extends StatelessWidget {
var ceilingSensorButtons = [
{
'title': 'Parameter Settings',
- 'icon': Assets.presenceSensorAssetsParameterSettings,
+ 'icon': Assets.assetsIconsPresenceSensorAssetsParameterSettings,
'page': null,
},
{
'title': 'Induction History',
- 'icon': Assets.presenceSensorAssetsInductionRecording,
+ 'icon': Assets.assetsIconsPresenceSensorAssetsInductionRecording,
'page': null,
},
{
'title': 'Help Description',
- 'icon': Assets.presenceSensorAssetsHelpDescription,
+ 'icon': Assets.assetsIconsPresenceSensorAssetsHelpDescription,
'page': null,
},
];
diff --git a/lib/features/devices/view/widgets/presence_sensors/parameters_list.dart b/lib/features/devices/view/widgets/presence_sensors/parameters_list.dart
index cad1776..da9ef21 100644
--- a/lib/features/devices/view/widgets/presence_sensors/parameters_list.dart
+++ b/lib/features/devices/view/widgets/presence_sensors/parameters_list.dart
@@ -213,38 +213,38 @@ class ParametersList extends StatelessWidget {
//{"result":{"productId":"awarhusb","productType":"WPS","status":[{"code":"presence_state","value":"none"},{"code":"far_detection","value":75},{"code":"presence_time","value":0},{"code":"motion_sensitivity_value","value":5},{"code":"motionless_sensitivity","value":5},{"code":"dis_current","value":214},{"code":"illuminance_value","value":231},{"code":"indicator","value":true}]},"success":true}
final List