diff --git a/assets/icons/hand_click.svg b/assets/icons/hand_click.svg
new file mode 100644
index 0000000..f0c81f2
--- /dev/null
+++ b/assets/icons/hand_click.svg
@@ -0,0 +1,9 @@
+
diff --git a/assets/icons/refresh.svg b/assets/icons/refresh.svg
new file mode 100644
index 0000000..9f12d98
--- /dev/null
+++ b/assets/icons/refresh.svg
@@ -0,0 +1,10 @@
+
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index c859ce0..8c3f26a 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -42,9 +42,9 @@ PODS:
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12)
- GoogleUtilities/Logger (~> 7.12)
- - FirebaseCoreExtension (10.21.0):
+ - FirebaseCoreExtension (10.27.0):
- FirebaseCore (~> 10.0)
- - FirebaseCoreInternal (10.21.0):
+ - FirebaseCoreInternal (10.27.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseCrashlytics (10.20.0):
- FirebaseCore (~> 10.5)
@@ -54,18 +54,19 @@ PODS:
- GoogleUtilities/Environment (~> 7.8)
- nanopb (< 2.30910.0, >= 2.30908.0)
- PromisesObjC (~> 2.1)
- - FirebaseInstallations (10.21.0):
+ - FirebaseInstallations (10.27.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1)
- - FirebaseSessions (10.21.0):
+ - FirebaseSessions (10.27.0):
- FirebaseCore (~> 10.5)
- FirebaseCoreExtension (~> 10.0)
- FirebaseInstallations (~> 10.0)
- GoogleDataTransport (~> 9.2)
- - GoogleUtilities/Environment (~> 7.10)
- - nanopb (< 2.30910.0, >= 2.30908.0)
+ - GoogleUtilities/Environment (~> 7.13)
+ - GoogleUtilities/UserDefaults (~> 7.13)
+ - nanopb (< 2.30911.0, >= 2.30908.0)
- PromisesSwift (~> 2.1)
- Flutter (1.0.0)
- flutter_localization (0.0.1):
@@ -92,29 +93,38 @@ PODS:
- GoogleUtilities/Network (~> 7.11)
- "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30910.0, >= 2.30908.0)
- - GoogleDataTransport (9.3.0):
+ - GoogleDataTransport (9.4.1):
- GoogleUtilities/Environment (~> 7.7)
- - nanopb (< 2.30910.0, >= 2.30908.0)
+ - nanopb (< 2.30911.0, >= 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
- - GoogleUtilities/AppDelegateSwizzler (7.12.0):
+ - GoogleUtilities/AppDelegateSwizzler (7.13.3):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- - GoogleUtilities/Environment (7.12.0):
+ - GoogleUtilities/Privacy
+ - GoogleUtilities/Environment (7.13.3):
+ - GoogleUtilities/Privacy
- PromisesObjC (< 3.0, >= 1.2)
- - GoogleUtilities/Logger (7.12.0):
+ - GoogleUtilities/Logger (7.13.3):
- GoogleUtilities/Environment
- - GoogleUtilities/MethodSwizzler (7.12.0):
+ - GoogleUtilities/Privacy
+ - GoogleUtilities/MethodSwizzler (7.13.3):
- GoogleUtilities/Logger
- - GoogleUtilities/Network (7.12.0):
+ - GoogleUtilities/Privacy
+ - GoogleUtilities/Network (7.13.3):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
+ - GoogleUtilities/Privacy
- GoogleUtilities/Reachability
- - "GoogleUtilities/NSData+zlib (7.12.0)"
- - GoogleUtilities/Reachability (7.12.0):
+ - "GoogleUtilities/NSData+zlib (7.13.3)":
+ - GoogleUtilities/Privacy
+ - GoogleUtilities/Privacy (7.13.3)
+ - GoogleUtilities/Reachability (7.13.3):
- GoogleUtilities/Logger
- - GoogleUtilities/UserDefaults (7.12.0):
+ - GoogleUtilities/Privacy
+ - GoogleUtilities/UserDefaults (7.13.3):
- GoogleUtilities/Logger
+ - GoogleUtilities/Privacy
- nanopb (2.30909.1):
- nanopb/decode (= 2.30909.1)
- nanopb/encode (= 2.30909.1)
@@ -174,9 +184,9 @@ PODS:
- FlutterMacOS
- permission_handler_apple (9.3.0):
- Flutter
- - PromisesObjC (2.3.1)
- - PromisesSwift (2.3.1):
- - PromisesObjC (= 2.3.1)
+ - PromisesObjC (2.4.0)
+ - PromisesSwift (2.4.0):
+ - PromisesObjC (= 2.4.0)
- share_plus (0.0.1):
- Flutter
- shared_preferences_foundation (0.0.1):
@@ -256,24 +266,24 @@ SPEC CHECKSUMS:
firebase_crashlytics: 012078b4eec6fc9716f97ba3da0f0e44a04e95b1
FirebaseAnalytics: a2731bf3670747ce8f65368b118d18aa8e368246
FirebaseCore: 28045c1560a2600d284b9c45a904fe322dc890b6
- FirebaseCoreExtension: 1c044fd46e95036cccb29134757c499613f3f564
- FirebaseCoreInternal: 43c1788eaeee9d1b97caaa751af567ce11010d00
+ FirebaseCoreExtension: 4ec89dd0c6de93d6becde32122d68b7c35f6bf5d
+ FirebaseCoreInternal: 4b297a2d56063dbea2c1d0d04222d44a8d058862
FirebaseCrashlytics: 81530595edb6d99f1918f723a6c33766a24a4c86
- FirebaseInstallations: 390ea1d10a4d02b20c965cbfd527ee9b3b412acb
- FirebaseSessions: 80c2bbdd28166267b3d132debe5f7531efdb00bc
+ FirebaseInstallations: 766dabca09fd94aef922538aaf144cc4a6fb6869
+ FirebaseSessions: 2fdf949f9e58295a57703ae8f2efc44f9fa3aa16
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_localization: f43b18844a2b3d2c71fd64f04ffd6b1e64dd54d4
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
GoogleAppMeasurement: bb3c564c3efb933136af0e94899e0a46167466a8
- GoogleDataTransport: 57c22343ab29bc686febbf7cbb13bad167c2d8fe
- GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
+ GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
+ GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
onesignal_flutter: 5ce68a29861960168e81101cb1bd685d264361de
OneSignalXCFramework: bdf74fdc06888f9466dc21e826fe1549ed143095
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
- PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
- PromisesSwift: 28dca69a9c40779916ac2d6985a0192a5cb4a265
+ PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
+ PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
@@ -281,4 +291,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: cf86fcba3fb3dbd505936bc190bb0b8fe3dd2498
-COCOAPODS: 1.13.0
+COCOAPODS: 1.14.3
diff --git a/lib/features/app_layout/bloc/home_cubit.dart b/lib/features/app_layout/bloc/home_cubit.dart
index 48021cc..253ff0f 100644
--- a/lib/features/app_layout/bloc/home_cubit.dart
+++ b/lib/features/app_layout/bloc/home_cubit.dart
@@ -18,6 +18,7 @@ import 'package:syncrow_app/features/devices/model/status_model.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/create_scene_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';
@@ -62,9 +63,12 @@ class HomeCubit extends Cubit {
selectedSpace = null;
selectedRoom = null;
pageIndex = 0;
- OneSignal.User.pushSubscription.removeObserver((stateChanges) => oneSignalSubscriptionObserver);
- OneSignal.Notifications.removePermissionObserver((permission) => oneSignalPermissionObserver);
- OneSignal.Notifications.removeClickListener((event) => oneSignalClickListenerObserver);
+ OneSignal.User.pushSubscription
+ .removeObserver((stateChanges) => oneSignalSubscriptionObserver);
+ OneSignal.Notifications.removePermissionObserver(
+ (permission) => oneSignalPermissionObserver);
+ OneSignal.Notifications.removeClickListener(
+ (event) => oneSignalClickListenerObserver);
return super.close();
}
@@ -106,7 +110,9 @@ class HomeCubit extends Cubit {
return;
}
- var userUuid = await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ?? '';
+ var userUuid =
+ await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ??
+ '';
if (userUuid.isNotEmpty) {
await OneSignal.login(userUuid);
}
@@ -114,21 +120,24 @@ class HomeCubit extends Cubit {
await OneSignal.User.pushSubscription.optIn();
//this function will be called once a user is subscribed
- oneSignalSubscriptionObserver = OneSignal.User.pushSubscription.addObserver((state) async {
+ oneSignalSubscriptionObserver =
+ OneSignal.User.pushSubscription.addObserver((state) async {
if (state.current.optedIn) {
await _sendSubscriptionId();
}
});
// Send the player id when a user allows notifications
- oneSignalPermissionObserver = OneSignal.Notifications.addPermissionObserver((state) async {
+ oneSignalPermissionObserver =
+ OneSignal.Notifications.addPermissionObserver((state) async {
await _sendSubscriptionId();
});
//check if the player id is sent, if not send it again
await _sendSubscriptionId();
- oneSignalClickListenerObserver = OneSignal.Notifications.addClickListener((event) async {
+ oneSignalClickListenerObserver =
+ OneSignal.Notifications.addClickListener((event) async {
//Once the user clicks on the notification
});
} catch (err) {
@@ -215,7 +224,9 @@ class HomeCubit extends Cubit {
Future joinAUnit(String code) async {
try {
- var uuid = await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ?? '';
+ var uuid =
+ await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ??
+ '';
Map body = {'userUuid': uuid, 'inviteCode': code};
final success = await SpacesAPI.joinUnit(body);
@@ -275,7 +286,8 @@ class HomeCubit extends Cubit {
size: 25,
),
style: ButtonStyle(
- foregroundColor: MaterialStateProperty.all(ColorsManager.textPrimaryColor),
+ foregroundColor:
+ WidgetStateProperty.all(ColorsManager.textPrimaryColor),
),
onPressed: () {
Navigator.push(
@@ -294,26 +306,29 @@ class HomeCubit extends Cubit {
),
],
'Devices': [
- IconButton(
- icon: const Icon(
- Icons.add,
- size: 25,
- ),
- style: ButtonStyle(
- foregroundColor: MaterialStateProperty.all(ColorsManager.textPrimaryColor),
- ),
- onPressed: () {},
- ),
- IconButton(
- icon: const Icon(
- Icons.more_vert,
- size: 25,
- ),
- style: ButtonStyle(
- foregroundColor: MaterialStateProperty.all(ColorsManager.textPrimaryColor),
- ),
- onPressed: () {},
- ),
+ //TODO: to be checked
+ // IconButton(
+ // icon: const Icon(
+ // Icons.add,
+ // size: 25,
+ // ),
+ // style: ButtonStyle(
+ // foregroundColor:
+ // MaterialStateProperty.all(ColorsManager.textPrimaryColor),
+ // ),
+ // onPressed: () {},
+ // ),
+ // IconButton(
+ // icon: const Icon(
+ // Icons.more_vert,
+ // size: 25,
+ // ),
+ // style: ButtonStyle(
+ // foregroundColor:
+ // MaterialStateProperty.all(ColorsManager.textPrimaryColor),
+ // ),
+ // onPressed: () {},
+ // ),
],
'Routine': [
// IconButton(
@@ -327,20 +342,29 @@ class HomeCubit extends Cubit {
IconButton(
icon: const Icon(
Icons.add,
- size: 25,
+ size: 32,
),
style: ButtonStyle(
- foregroundColor: MaterialStateProperty.all(ColorsManager.textPrimaryColor),
+ foregroundColor:
+ WidgetStateProperty.all(ColorsManager.textPrimaryColor),
),
- onPressed: () {},
+ onPressed: () {
+ Navigator.push(
+ NavigationService.navigatorKey.currentContext!,
+ CustomPageRoute(
+ builder: (context) => const CreateSceneView(),
+ ),
+ );
+ },
),
IconButton(
icon: const Icon(
Icons.more_vert,
- size: 25,
+ size: 28,
),
style: ButtonStyle(
- foregroundColor: MaterialStateProperty.all(ColorsManager.textPrimaryColor),
+ foregroundColor:
+ WidgetStateProperty.all(ColorsManager.textPrimaryColor),
),
onPressed: () {},
),
@@ -373,7 +397,8 @@ class HomeCubit extends Cubit {
};
static var bottomNavItems = [
- defaultBottomNavBarItem(icon: Assets.assetsIconsDashboard, label: 'Dashboard'),
+ defaultBottomNavBarItem(
+ icon: Assets.assetsIconsDashboard, label: 'Dashboard'),
// defaultBottomNavBarItem(icon: Assets.assetsIconslayout, label: 'Layout'),
defaultBottomNavBarItem(icon: Assets.assetsIconsDevices, label: 'Devices'),
defaultBottomNavBarItem(icon: Assets.assetsIconsRoutines, label: 'Routine'),
@@ -398,7 +423,8 @@ class HomeCubit extends Cubit {
}
}
-BottomNavigationBarItem defaultBottomNavBarItem({required String icon, required String label}) {
+BottomNavigationBarItem defaultBottomNavBarItem(
+ {required String icon, required String label}) {
return BottomNavigationBarItem(
icon: SvgPicture.asset(icon),
activeIcon: SvgPicture.asset(
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 bc1496d..e00eae3 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
@@ -16,21 +16,21 @@ class AppBarHomeDropdown extends StatelessWidget {
builder: (context, state) {
return Padding(
padding: const EdgeInsets.only(left: 10, right: 10),
- child: DropdownButton(
- icon: const Icon(
- Icons.expand_more,
- color: Colors.black,
- size: 25,
- ),
- underline: const SizedBox.shrink(),
- padding: const EdgeInsets.all(0),
- borderRadius: BorderRadius.circular(20),
- value: HomeCubit.getInstance().selectedSpace!.id,
- items: HomeCubit.getInstance().spaces!.map((space) {
- return DropdownMenuItem(
- value: space.id,
- child: SizedBox(
- width: 100,
+ child: Center(
+ child: DropdownButton(
+ icon: const Icon(
+ Icons.expand_more,
+ color: ColorsManager.textPrimaryColor,
+ size: 16,
+ ),
+ underline: const SizedBox.shrink(),
+ padding: EdgeInsets.zero,
+ borderRadius: BorderRadius.circular(20),
+ value: HomeCubit.getInstance().selectedSpace!.id,
+ items: HomeCubit.getInstance().spaces!.map((space) {
+ return DropdownMenuItem(
+ alignment: AlignmentDirectional.centerStart,
+ value: space.id,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
@@ -45,7 +45,8 @@ class AppBarHomeDropdown extends StatelessWidget {
),
),
const SizedBox(width: 5),
- Expanded(
+ Flexible(
+ fit: FlexFit.loose,
child: BodyMedium(
text: space.name ?? "??",
style: context.bodyMedium.copyWith(
@@ -55,19 +56,20 @@ class AppBarHomeDropdown extends StatelessWidget {
),
),
),
+ const SizedBox(width: 5),
],
),
- ),
- );
- }).toList(),
- onChanged: (value) {
- if (value != null) {
- HomeCubit.getInstance().changeSelectedSpace(
- HomeCubit.getInstance()
- .spaces!
- .firstWhere((element) => element.id == value));
- }
- },
+ );
+ }).toList(),
+ onChanged: (value) {
+ if (value != null) {
+ HomeCubit.getInstance().changeSelectedSpace(
+ HomeCubit.getInstance()
+ .spaces!
+ .firstWhere((element) => element.id == value));
+ }
+ },
+ ),
),
);
},
diff --git a/lib/features/app_layout/view/widgets/default_app_bar.dart b/lib/features/app_layout/view/widgets/default_app_bar.dart
index 332ef19..6c67536 100644
--- a/lib/features/app_layout/view/widgets/default_app_bar.dart
+++ b/lib/features/app_layout/view/widgets/default_app_bar.dart
@@ -20,9 +20,11 @@ class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
leadingWidth: 150,
toolbarHeight: Constants.appBarHeight,
leading: HomeCubit.getInstance().spaces!.isNotEmpty
- ? HomeCubit.appBarLeading[HomeCubit.bottomNavItems[HomeCubit.pageIndex].label]
+ ? HomeCubit.appBarLeading[
+ HomeCubit.bottomNavItems[HomeCubit.pageIndex].label]
: null,
- // actions: HomeCubit.appBarActions[HomeCubit.bottomNavItems[HomeCubit.pageIndex].label],
+ actions: HomeCubit.appBarActions[
+ HomeCubit.bottomNavItems[HomeCubit.pageIndex].label],
));
},
);
diff --git a/lib/features/scene/bloc/create_scene/create_scene_bloc.dart b/lib/features/scene/bloc/create_scene/create_scene_bloc.dart
new file mode 100644
index 0000000..e69de29
diff --git a/lib/features/scene/bloc/create_scene/create_scene_event.dart b/lib/features/scene/bloc/create_scene/create_scene_event.dart
new file mode 100644
index 0000000..e69de29
diff --git a/lib/features/scene/bloc/create_scene/create_scene_state.dart b/lib/features/scene/bloc/create_scene/create_scene_state.dart
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/lib/features/scene/bloc/create_scene/create_scene_state.dart
@@ -0,0 +1 @@
+
diff --git a/lib/features/scene/bloc/scene_bloc/scene_bloc.dart b/lib/features/scene/bloc/scene_bloc/scene_bloc.dart
new file mode 100644
index 0000000..32de4bb
--- /dev/null
+++ b/lib/features/scene/bloc/scene_bloc/scene_bloc.dart
@@ -0,0 +1,28 @@
+import 'package:equatable/equatable.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_event.dart';
+import 'package:syncrow_app/features/scene/model/scene_model.dart';
+
+part 'scene_state.dart';
+
+class SceneBloc extends Bloc {
+ SceneBloc() : super(SceneInitial()) {
+ on(_onLoadScenes);
+ }
+
+ void _onLoadScenes(LoadScenes event, Emitter emit) {
+ emit(SceneLoading());
+
+ try {
+ final scenes = _loadScenes();
+ emit(SceneLoaded(scenes));
+ } catch (_) {
+ emit(SceneError());
+ }
+ }
+
+ List _loadScenes() {
+ //TODO: Load scenes
+ return [];
+ }
+}
diff --git a/lib/features/scene/bloc/scene_bloc/scene_event.dart b/lib/features/scene/bloc/scene_bloc/scene_event.dart
new file mode 100644
index 0000000..f1d3739
--- /dev/null
+++ b/lib/features/scene/bloc/scene_bloc/scene_event.dart
@@ -0,0 +1,9 @@
+
+import 'package:equatable/equatable.dart';
+
+abstract class SceneEvent extends Equatable {
+ @override
+ List