mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-17 02:25:16 +00:00
code changes
This commit is contained in:
@ -34,7 +34,7 @@ part 'home_state.dart';
|
|||||||
|
|
||||||
class HomeCubit extends Cubit<HomeState> {
|
class HomeCubit extends Cubit<HomeState> {
|
||||||
HomeCubit._() : super(HomeInitial()) {
|
HomeCubit._() : super(HomeInitial()) {
|
||||||
checkIfNotificationPermissionGranted();
|
// checkIfNotificationPermissionGranted();
|
||||||
fetchUserInfo();
|
fetchUserInfo();
|
||||||
if (selectedSpace == null) {
|
if (selectedSpace == null) {
|
||||||
fetchUnitsByUserId();
|
fetchUnitsByUserId();
|
||||||
@ -55,7 +55,7 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
|
|
||||||
Future fetchUserInfo() async {
|
Future fetchUserInfo() async {
|
||||||
try {
|
try {
|
||||||
var uuid = await const FlutterSecureStorage().read(key: UserModel.userUuidKey);
|
var uuid=await const FlutterSecureStorage().read(key: UserModel.userUuidKey);
|
||||||
user = await ProfileApi().fetchUserInfo(uuid);
|
user = await ProfileApi().fetchUserInfo(uuid);
|
||||||
emit(HomeUserInfoLoaded(user!)); // Emit state after fetching user info
|
emit(HomeUserInfoLoaded(user!)); // Emit state after fetching user info
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -76,9 +76,12 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
selectedSpace = null;
|
selectedSpace = null;
|
||||||
selectedRoom = null;
|
selectedRoom = null;
|
||||||
pageIndex = 0;
|
pageIndex = 0;
|
||||||
OneSignal.User.pushSubscription.removeObserver((stateChanges) => oneSignalSubscriptionObserver);
|
// OneSignal.User.pushSubscription
|
||||||
OneSignal.Notifications.removePermissionObserver((permission) => oneSignalPermissionObserver);
|
// .removeObserver((stateChanges) => oneSignalSubscriptionObserver);
|
||||||
OneSignal.Notifications.removeClickListener((event) => oneSignalClickListenerObserver);
|
// OneSignal.Notifications.removePermissionObserver(
|
||||||
|
// (permission) => oneSignalPermissionObserver);
|
||||||
|
// OneSignal.Notifications.removeClickListener(
|
||||||
|
// (event) => oneSignalClickListenerObserver);
|
||||||
return super.close();
|
return super.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,9 +99,9 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
|
|
||||||
var duration = const Duration(milliseconds: 300);
|
var duration = const Duration(milliseconds: 300);
|
||||||
|
|
||||||
void oneSignalPermissionObserver;
|
// void oneSignalPermissionObserver;
|
||||||
void oneSignalSubscriptionObserver;
|
// void oneSignalSubscriptionObserver;
|
||||||
void oneSignalClickListenerObserver;
|
// void oneSignalClickListenerObserver;
|
||||||
|
|
||||||
// selectSpace(SpaceModel space) async {
|
// selectSpace(SpaceModel space) async {
|
||||||
// selectedSpace = space;
|
// selectedSpace = space;
|
||||||
@ -120,31 +123,36 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var userUuid = await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ?? '';
|
var userUuid =
|
||||||
|
await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ??
|
||||||
|
'';
|
||||||
if (userUuid.isNotEmpty) {
|
if (userUuid.isNotEmpty) {
|
||||||
await OneSignal.login(userUuid);
|
await OneSignal.login(userUuid);
|
||||||
}
|
}
|
||||||
//Enable push notifications
|
//Enable push notifications
|
||||||
await OneSignal.User.pushSubscription.optIn();
|
await OneSignal.User.pushSubscription.optIn();
|
||||||
|
|
||||||
//this function will be called once a user is subscribed
|
// //this function will be called once a user is subscribed
|
||||||
oneSignalSubscriptionObserver = OneSignal.User.pushSubscription.addObserver((state) async {
|
// oneSignalSubscriptionObserver =
|
||||||
if (state.current.optedIn) {
|
// OneSignal.User.pushSubscription.addObserver((state) async {
|
||||||
await _sendSubscriptionId();
|
// if (state.current.optedIn) {
|
||||||
}
|
// await _sendSubscriptionId();
|
||||||
});
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
// Send the player id when a user allows notifications
|
// // Send the player id when a user allows notifications
|
||||||
oneSignalPermissionObserver = OneSignal.Notifications.addPermissionObserver((state) async {
|
// oneSignalPermissionObserver =
|
||||||
await _sendSubscriptionId();
|
// OneSignal.Notifications.addPermissionObserver((state) async {
|
||||||
});
|
// await _sendSubscriptionId();
|
||||||
|
// });
|
||||||
|
|
||||||
//check if the player id is sent, if not send it again
|
// //check if the player id is sent, if not send it again
|
||||||
await _sendSubscriptionId();
|
// await _sendSubscriptionId();
|
||||||
|
|
||||||
oneSignalClickListenerObserver = OneSignal.Notifications.addClickListener((event) async {
|
// oneSignalClickListenerObserver =
|
||||||
//Once the user clicks on the notification
|
// OneSignal.Notifications.addClickListener((event) async {
|
||||||
});
|
// //Once the user clicks on the notification
|
||||||
|
// });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
debugPrint("******* Error");
|
debugPrint("******* Error");
|
||||||
debugPrint(err.toString());
|
debugPrint(err.toString());
|
||||||
@ -213,7 +221,8 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
//////////////////////////////////////// API ////////////////////////////////////////
|
//////////////////////////////////////// API ////////////////////////////////////////
|
||||||
generateInvitation(SpaceModel unit) async {
|
generateInvitation(SpaceModel unit) async {
|
||||||
try {
|
try {
|
||||||
final invitationCode = await SpacesAPI.generateInvitationCode(unit.id, unit.community.uuid);
|
final invitationCode =
|
||||||
|
await SpacesAPI.generateInvitationCode(unit.id, unit.community.uuid);
|
||||||
if (invitationCode.isNotEmpty) {
|
if (invitationCode.isNotEmpty) {
|
||||||
Share.share('The invitation code is $invitationCode');
|
Share.share('The invitation code is $invitationCode');
|
||||||
CustomSnackBar.displaySnackBar(
|
CustomSnackBar.displaySnackBar(
|
||||||
@ -229,7 +238,9 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
|
|
||||||
Future<bool> joinAUnit(String code) async {
|
Future<bool> joinAUnit(String code) async {
|
||||||
try {
|
try {
|
||||||
var userUuid = await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ?? '';
|
var userUuid =
|
||||||
|
await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ??
|
||||||
|
'';
|
||||||
Map<String, String> body = {'inviteCode': code};
|
Map<String, String> body = {'inviteCode': code};
|
||||||
|
|
||||||
final success = await SpacesAPI.joinUnit(userUuid, body);
|
final success = await SpacesAPI.joinUnit(userUuid, body);
|
||||||
@ -265,7 +276,8 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
fetchRoomsByUnitId(SpaceModel space) async {
|
fetchRoomsByUnitId(SpaceModel space) async {
|
||||||
emitSafe(GetSpaceRoomsLoading());
|
emitSafe(GetSpaceRoomsLoading());
|
||||||
try {
|
try {
|
||||||
space.subspaces = await SpacesAPI.getSubSpaceBySpaceId(space.community.uuid, space.id);
|
space.subspaces =
|
||||||
|
await SpacesAPI.getSubSpaceBySpaceId(space.community.uuid, space.id);
|
||||||
} catch (failure) {
|
} catch (failure) {
|
||||||
emitSafe(GetSpaceRoomsError(failure.toString()));
|
emitSafe(GetSpaceRoomsError(failure.toString()));
|
||||||
return;
|
return;
|
||||||
@ -347,7 +359,8 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
size: 32,
|
size: 32,
|
||||||
),
|
),
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
foregroundColor: WidgetStateProperty.all(ColorsManager.textPrimaryColor),
|
foregroundColor:
|
||||||
|
WidgetStateProperty.all(ColorsManager.textPrimaryColor),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
@ -368,7 +381,8 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
NavigationService.navigatorKey.currentContext!
|
NavigationService.navigatorKey.currentContext!
|
||||||
.read<SmartSceneSelectBloc>()
|
.read<SmartSceneSelectBloc>()
|
||||||
.add(const SmartSceneClearEvent());
|
.add(const SmartSceneClearEvent());
|
||||||
BlocProvider.of<EffectPeriodBloc>(NavigationService.navigatorKey.currentState!.context)
|
BlocProvider.of<EffectPeriodBloc>(
|
||||||
|
NavigationService.navigatorKey.currentState!.context)
|
||||||
.add(ResetEffectivePeriod());
|
.add(ResetEffectivePeriod());
|
||||||
NavigationService.navigatorKey.currentContext!
|
NavigationService.navigatorKey.currentContext!
|
||||||
.read<CreateSceneBloc>()
|
.read<CreateSceneBloc>()
|
||||||
@ -381,7 +395,8 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
size: 28,
|
size: 28,
|
||||||
),
|
),
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
foregroundColor: WidgetStateProperty.all(ColorsManager.textPrimaryColor),
|
foregroundColor:
|
||||||
|
WidgetStateProperty.all(ColorsManager.textPrimaryColor),
|
||||||
),
|
),
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
),
|
),
|
||||||
@ -414,7 +429,8 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static var bottomNavItems = [
|
static var bottomNavItems = [
|
||||||
defaultBottomNavBarItem(icon: Assets.assetsIconsDashboard, label: 'Dashboard'),
|
defaultBottomNavBarItem(
|
||||||
|
icon: Assets.assetsIconsDashboard, label: 'Dashboard'),
|
||||||
// defaultBottomNavBarItem(icon: Assets.assetsIconslayout, label: 'Layout'),
|
// defaultBottomNavBarItem(icon: Assets.assetsIconslayout, label: 'Layout'),
|
||||||
defaultBottomNavBarItem(icon: Assets.assetsIconsDevices, label: 'Devices'),
|
defaultBottomNavBarItem(icon: Assets.assetsIconsDevices, label: 'Devices'),
|
||||||
defaultBottomNavBarItem(icon: Assets.assetsIconsRoutines, label: 'Routine'),
|
defaultBottomNavBarItem(icon: Assets.assetsIconsRoutines, label: 'Routine'),
|
||||||
@ -440,7 +456,8 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
|
|
||||||
void updateDevice(String deviceId) async {
|
void updateDevice(String deviceId) async {
|
||||||
try {
|
try {
|
||||||
final response = await DevicesAPI.firmwareDevice(deviceId: deviceId, firmwareVersion: '0');
|
final response = await DevicesAPI.firmwareDevice(
|
||||||
|
deviceId: deviceId, firmwareVersion: '0');
|
||||||
if (response['success'] ?? false) {
|
if (response['success'] ?? false) {
|
||||||
CustomSnackBar.displaySnackBar('No updates available');
|
CustomSnackBar.displaySnackBar('No updates available');
|
||||||
}
|
}
|
||||||
@ -448,7 +465,8 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BottomNavigationBarItem defaultBottomNavBarItem({required String icon, required String label}) {
|
BottomNavigationBarItem defaultBottomNavBarItem(
|
||||||
|
{required String icon, required String label}) {
|
||||||
return BottomNavigationBarItem(
|
return BottomNavigationBarItem(
|
||||||
icon: SvgPicture.asset(icon),
|
icon: SvgPicture.asset(icon),
|
||||||
activeIcon: SvgPicture.asset(
|
activeIcon: SvgPicture.asset(
|
||||||
|
@ -167,8 +167,8 @@ class SearchScenesEvent extends FourSceneEvent {
|
|||||||
class SaveLocationSelectionEvent extends FourSceneEvent {}
|
class SaveLocationSelectionEvent extends FourSceneEvent {}
|
||||||
|
|
||||||
class SelectOptionEvent extends FourSceneEvent {
|
class SelectOptionEvent extends FourSceneEvent {
|
||||||
dynamic selectedOption;
|
final dynamic selectedOption;
|
||||||
SelectOptionEvent({
|
const SelectOptionEvent({
|
||||||
this.selectedOption,
|
this.selectedOption,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_blo
|
|||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/four_scene_model.dart';
|
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||||
@ -29,18 +28,6 @@ class FourSceneCreateGroup extends StatelessWidget {
|
|||||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final sensor = BlocProvider.of<FourSceneBloc>(context);
|
final sensor = BlocProvider.of<FourSceneBloc>(context);
|
||||||
FourSceneModelState model = FourSceneModelState(
|
|
||||||
scene_1: '',
|
|
||||||
scene_2: '',
|
|
||||||
scene_3: '',
|
|
||||||
scene_4: '',
|
|
||||||
scene_id_group_id: '',
|
|
||||||
switch_backlight: '');
|
|
||||||
if (state is LoadingNewSate) {
|
|
||||||
model = state.device;
|
|
||||||
} else if (state is UpdateState) {
|
|
||||||
model = state.device;
|
|
||||||
}
|
|
||||||
return state is LoadingNewSate
|
return state is LoadingNewSate
|
||||||
? const Center(
|
? const Center(
|
||||||
child: DefaultContainer(
|
child: DefaultContainer(
|
||||||
@ -49,7 +36,7 @@ class FourSceneCreateGroup extends StatelessWidget {
|
|||||||
child: CircularProgressIndicator()),
|
child: CircularProgressIndicator()),
|
||||||
)
|
)
|
||||||
: Padding(
|
: Padding(
|
||||||
padding: EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const Padding(
|
const Padding(
|
||||||
@ -201,7 +188,7 @@ class FourSceneCreateGroup extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Spacer()
|
const Spacer()
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -5,7 +5,6 @@ import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_blo
|
|||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/four_scene_model.dart';
|
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||||
@ -29,18 +28,6 @@ class FourSceneInfoPage extends StatelessWidget {
|
|||||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final _bloc = BlocProvider.of<FourSceneBloc>(context);
|
final _bloc = BlocProvider.of<FourSceneBloc>(context);
|
||||||
FourSceneModelState model = FourSceneModelState(
|
|
||||||
scene_1: '',
|
|
||||||
scene_2: '',
|
|
||||||
scene_3: '',
|
|
||||||
scene_4: '',
|
|
||||||
scene_id_group_id: '',
|
|
||||||
switch_backlight: '');
|
|
||||||
if (state is LoadingNewSate) {
|
|
||||||
model = state.device;
|
|
||||||
} else if (state is UpdateState) {
|
|
||||||
model = state.device;
|
|
||||||
}
|
|
||||||
return state is FourSceneLoadingState
|
return state is FourSceneLoadingState
|
||||||
? const Center(
|
? const Center(
|
||||||
child: DefaultContainer(
|
child: DefaultContainer(
|
||||||
@ -69,7 +56,7 @@ class FourSceneInfoPage extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
SizedBox(
|
||||||
width:
|
width:
|
||||||
MediaQuery.of(context).size.width * 0.61,
|
MediaQuery.of(context).size.width * 0.61,
|
||||||
child: BodySmall(
|
child: BodySmall(
|
||||||
|
@ -6,7 +6,6 @@ import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_blo
|
|||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/four_scene_model.dart';
|
|
||||||
import 'package:syncrow_app/features/devices/view/widgets/four_scene_switch/four_scene_setting/location_setting_four_scene.dart';
|
import 'package:syncrow_app/features/devices/view/widgets/four_scene_switch/four_scene_setting/location_setting_four_scene.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||||
@ -37,18 +36,6 @@ class FourSceneProfilePage extends StatelessWidget {
|
|||||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final _bloc = BlocProvider.of<FourSceneBloc>(context);
|
final _bloc = BlocProvider.of<FourSceneBloc>(context);
|
||||||
FourSceneModelState model = FourSceneModelState(
|
|
||||||
scene_1: '',
|
|
||||||
scene_2: '',
|
|
||||||
scene_3: '',
|
|
||||||
scene_4: '',
|
|
||||||
scene_id_group_id: '',
|
|
||||||
switch_backlight: '');
|
|
||||||
if (state is LoadingNewSate) {
|
|
||||||
model = state.device;
|
|
||||||
} else if (state is UpdateState) {
|
|
||||||
model = state.device;
|
|
||||||
}
|
|
||||||
return state is FourSceneLoadingState
|
return state is FourSceneLoadingState
|
||||||
? const Center(
|
? const Center(
|
||||||
child: DefaultContainer(
|
child: DefaultContainer(
|
||||||
@ -73,7 +60,7 @@ class FourSceneProfilePage extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
const SizedBox(
|
||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
@ -157,7 +144,7 @@ class FourSceneProfilePage extends StatelessWidget {
|
|||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
if (val == true) {
|
if (val == true) {
|
||||||
_bloc.add(FourSceneInitialInfo());
|
_bloc.add(const FourSceneInitialInfo());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
|
@ -367,7 +367,8 @@ class FourSceneSettings extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
@ -2,11 +2,11 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||||
|
|
||||||
class upDateNote extends StatelessWidget {
|
class UpDateNote extends StatelessWidget {
|
||||||
final Function()? cancelTab;
|
final Function()? cancelTab;
|
||||||
final Function()? confirmTab;
|
final Function()? confirmTab;
|
||||||
|
|
||||||
const upDateNote({
|
const UpDateNote({
|
||||||
super.key,
|
super.key,
|
||||||
required this.cancelTab,
|
required this.cancelTab,
|
||||||
required this.confirmTab,
|
required this.confirmTab,
|
||||||
|
@ -39,9 +39,6 @@ class FourSceneUpdatePage extends StatelessWidget {
|
|||||||
onRefresh: () async {},
|
onRefresh: () async {},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// SizedBox(
|
|
||||||
// height: MediaQuery.of(context).size.height * 0.15,
|
|
||||||
// ),
|
|
||||||
DefaultContainer(
|
DefaultContainer(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
@ -116,7 +113,7 @@ class FourSceneUpdatePage extends StatelessWidget {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
UpdateSosContainerWithProgressBar(
|
const UpdateSosContainerWithProgressBar(
|
||||||
sosDescription:
|
sosDescription:
|
||||||
'Connectivity Issue Resolved Fixed a bug that caused the SOS button to disconnect from the app intermittently.',
|
'Connectivity Issue Resolved Fixed a bug that caused the SOS button to disconnect from the app intermittently.',
|
||||||
sosVersion: 'SOS v2.0.5',
|
sosVersion: 'SOS v2.0.5',
|
||||||
@ -221,7 +218,7 @@ class NewUpdateContainer extends StatelessWidget {
|
|||||||
text: sosVersion!,
|
text: sosVersion!,
|
||||||
fontColor: ColorsManager.primaryTextColor,
|
fontColor: ColorsManager.primaryTextColor,
|
||||||
),
|
),
|
||||||
Container(
|
SizedBox(
|
||||||
width: MediaQuery.of(context).size.width * 0.7,
|
width: MediaQuery.of(context).size.width * 0.7,
|
||||||
child: BodyMedium(
|
child: BodyMedium(
|
||||||
text: sosDescription!,
|
text: sosDescription!,
|
||||||
@ -239,7 +236,7 @@ class NewUpdateContainer extends StatelessWidget {
|
|||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return upDateNote(
|
return UpDateNote(
|
||||||
cancelTab: () {
|
cancelTab: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
@ -297,7 +294,7 @@ class UpdateSosContainerWithProgressBar extends StatelessWidget {
|
|||||||
Assets.emptyUpdateIcon,
|
Assets.emptyUpdateIcon,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
BodyMedium(
|
const BodyMedium(
|
||||||
text: 'New Update Available Now!',
|
text: 'New Update Available Now!',
|
||||||
fontColor: ColorsManager.blueColor,
|
fontColor: ColorsManager.blueColor,
|
||||||
),
|
),
|
||||||
@ -314,7 +311,7 @@ class UpdateSosContainerWithProgressBar extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
LinearPercentIndicator(
|
LinearPercentIndicator(
|
||||||
barRadius: Radius.circular(10),
|
barRadius: const Radius.circular(10),
|
||||||
width: 170.0,
|
width: 170.0,
|
||||||
animation: true,
|
animation: true,
|
||||||
animationDuration: 1000,
|
animationDuration: 1000,
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:syncrow_app/features/app_layout/model/space_model.dart';
|
import 'package:syncrow_app/features/app_layout/model/space_model.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_bloc.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_bloc.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/four_scene_model.dart';
|
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||||
@ -29,21 +27,14 @@ class LocationFourScenePage extends StatelessWidget {
|
|||||||
body: BlocProvider(
|
body: BlocProvider(
|
||||||
create: (context) => FourSceneBloc(fourSceneId: deviceId ?? '')
|
create: (context) => FourSceneBloc(fourSceneId: deviceId ?? '')
|
||||||
..add(const FourSceneInitial())
|
..add(const FourSceneInitial())
|
||||||
..add(FourSceneInitialInfo())
|
..add(const FourSceneInitialInfo())
|
||||||
..add(FetchRoomsEvent(unit: space!)),
|
..add(FetchRoomsEvent(unit: space!)),
|
||||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final _bloc = BlocProvider.of<FourSceneBloc>(context);
|
final _bloc = BlocProvider.of<FourSceneBloc>(context);
|
||||||
FourSceneModelState model = FourSceneModelState(
|
|
||||||
scene_1: '',
|
|
||||||
scene_2: '',
|
|
||||||
scene_3: '',
|
|
||||||
scene_4: '',
|
|
||||||
scene_id_group_id: '',
|
|
||||||
switch_backlight: '');
|
|
||||||
if (state is SaveSelectionSuccessState) {
|
if (state is SaveSelectionSuccessState) {
|
||||||
new Future.delayed(const Duration(microseconds: 500), () {
|
Future.delayed(const Duration(microseconds: 500), () {
|
||||||
_bloc.add(FourSceneInitialInfo());
|
_bloc.add(const FourSceneInitialInfo());
|
||||||
Navigator.of(context).pop(true);
|
Navigator.of(context).pop(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -84,65 +75,59 @@ class LocationFourScenePage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 20),
|
const SizedBox(width: 20),
|
||||||
],
|
],
|
||||||
|
child: ListView(
|
||||||
child: RefreshIndicator(
|
shrinkWrap: true,
|
||||||
onRefresh: () async {
|
padding: const EdgeInsets.symmetric(vertical: 20),
|
||||||
// sensor.add(const SosInitial());
|
children: [
|
||||||
},
|
const BodyMedium(
|
||||||
child: ListView(
|
text: 'Smart Device Location',
|
||||||
shrinkWrap: true,
|
fontWeight: FontWeight.w700,
|
||||||
padding: const EdgeInsets.symmetric(vertical: 20),
|
fontSize: 12,
|
||||||
children: [
|
fontColor: ColorsManager.grayColor,
|
||||||
const BodyMedium(
|
),
|
||||||
text: 'Smart Device Location',
|
const SizedBox(height: 5),
|
||||||
fontWeight: FontWeight.w700,
|
DefaultContainer(
|
||||||
fontSize: 12,
|
padding: const EdgeInsets.all(20),
|
||||||
fontColor: ColorsManager.grayColor,
|
child: ListView.builder(
|
||||||
),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
const SizedBox(height: 5),
|
shrinkWrap: true,
|
||||||
DefaultContainer(
|
itemCount: _bloc.roomsList.length,
|
||||||
padding: const EdgeInsets.all(20),
|
itemBuilder: (context, index) {
|
||||||
child: ListView.builder(
|
final fromRoom = _bloc.roomsList[index];
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
final isSelected = (state
|
||||||
shrinkWrap: true,
|
is OptionSelectedState &&
|
||||||
itemCount: _bloc.roomsList.length,
|
state.selectedOption == fromRoom.id) ||
|
||||||
itemBuilder: (context, index) {
|
(state is! OptionSelectedState &&
|
||||||
final fromRoom = _bloc.roomsList[index];
|
fromRoom.id ==
|
||||||
final isSelected = (state
|
_bloc.deviceInfo.subspace.uuid);
|
||||||
is OptionSelectedState &&
|
|
||||||
state.selectedOption == fromRoom.id) ||
|
|
||||||
(state is! OptionSelectedState &&
|
|
||||||
fromRoom.id ==
|
|
||||||
_bloc.deviceInfo.subspace.uuid);
|
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
_buildCheckboxOption(
|
_buildCheckboxOption(
|
||||||
label: fromRoom.name!,
|
label: fromRoom.name!,
|
||||||
isSelected: isSelected,
|
isSelected: isSelected,
|
||||||
onTap: (label) {
|
onTap: (label) {
|
||||||
context.read<FourSceneBloc>().add(
|
context.read<FourSceneBloc>().add(
|
||||||
SelectOptionEvent(
|
SelectOptionEvent(
|
||||||
selectedOption: fromRoom.id!,
|
selectedOption: fromRoom.id!,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
roomIdSelected = fromRoom.id!;
|
roomIdSelected = fromRoom.id!;
|
||||||
},
|
},
|
||||||
|
),
|
||||||
|
if (index < _bloc.roomsList.length - 1) ...[
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
const Divider(
|
||||||
|
color: ColorsManager.dividerColor,
|
||||||
),
|
),
|
||||||
if (index < _bloc.roomsList.length - 1) ...[
|
const SizedBox(height: 10),
|
||||||
const SizedBox(height: 10),
|
|
||||||
const Divider(
|
|
||||||
color: ColorsManager.dividerColor,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
);
|
],
|
||||||
},
|
);
|
||||||
),
|
},
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -156,7 +141,8 @@ class CircularCheckbox extends StatefulWidget {
|
|||||||
final bool value;
|
final bool value;
|
||||||
final ValueChanged<bool?> onChanged;
|
final ValueChanged<bool?> onChanged;
|
||||||
|
|
||||||
CircularCheckbox({required this.value, required this.onChanged});
|
const CircularCheckbox(
|
||||||
|
{super.key, required this.value, required this.onChanged});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_CircularCheckboxState createState() => _CircularCheckboxState();
|
_CircularCheckboxState createState() => _CircularCheckboxState();
|
||||||
|
@ -4,7 +4,6 @@ import 'package:flutter_svg/flutter_svg.dart';
|
|||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_bloc.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_bloc.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/four_scene_model.dart';
|
|
||||||
import 'package:syncrow_app/features/devices/model/question_model.dart';
|
import 'package:syncrow_app/features/devices/model/question_model.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_button.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_button.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||||
@ -29,18 +28,6 @@ class QuestionPageFourScene extends StatelessWidget {
|
|||||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final sensor = BlocProvider.of<FourSceneBloc>(context);
|
final sensor = BlocProvider.of<FourSceneBloc>(context);
|
||||||
FourSceneModelState model = FourSceneModelState(
|
|
||||||
scene_1: '',
|
|
||||||
scene_2: '',
|
|
||||||
scene_3: '',
|
|
||||||
scene_4: '',
|
|
||||||
scene_id_group_id: '',
|
|
||||||
switch_backlight: '');
|
|
||||||
if (state is LoadingNewSate) {
|
|
||||||
model = state.device;
|
|
||||||
} else if (state is UpdateState) {
|
|
||||||
model = state.device;
|
|
||||||
}
|
|
||||||
return state is FourSceneLoadingState
|
return state is FourSceneLoadingState
|
||||||
? const Center(
|
? const Center(
|
||||||
child: DefaultContainer(
|
child: DefaultContainer(
|
||||||
@ -48,109 +35,105 @@ class QuestionPageFourScene extends StatelessWidget {
|
|||||||
height: 50,
|
height: 50,
|
||||||
child: CircularProgressIndicator()),
|
child: CircularProgressIndicator()),
|
||||||
)
|
)
|
||||||
: RefreshIndicator(
|
: Column(
|
||||||
onRefresh: () async {
|
children: [
|
||||||
sensor.add(const FourSceneInitial());
|
DefaultContainer(
|
||||||
},
|
padding: const EdgeInsets.all(15),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
DefaultContainer(
|
children: [
|
||||||
padding: EdgeInsets.all(15),
|
BodyLarge(
|
||||||
child: Column(
|
text: questionModel!.question,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
fontSize: 22,
|
||||||
children: [
|
fontWeight: FontWeight.w400,
|
||||||
BodyLarge(
|
fontColor: ColorsManager.blackColor,
|
||||||
text: questionModel!.question,
|
),
|
||||||
fontSize: 22,
|
const SizedBox(
|
||||||
fontWeight: FontWeight.w400,
|
height: 15,
|
||||||
fontColor: ColorsManager.blackColor,
|
),
|
||||||
),
|
BodyMedium(
|
||||||
SizedBox(
|
text: questionModel!.answer,
|
||||||
height: 15,
|
fontSize: 14,
|
||||||
),
|
fontWeight: FontWeight.w400,
|
||||||
BodyMedium(
|
fontColor: ColorsManager.secondaryTextColor,
|
||||||
text: questionModel!.answer,
|
),
|
||||||
fontSize: 14,
|
],
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
fontColor: ColorsManager.secondaryTextColor,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
),
|
||||||
height: MediaQuery.of(context).size.height * 0.15,
|
SizedBox(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.15,
|
||||||
|
),
|
||||||
|
Center(
|
||||||
|
child: SizedBox(
|
||||||
|
width: 180,
|
||||||
|
child: DefaultButton(
|
||||||
|
backgroundColor: sensor.isHelpful == true
|
||||||
|
? ColorsManager.grayColor
|
||||||
|
: ColorsManager.grayButtonColors,
|
||||||
|
borderRadius: 50,
|
||||||
|
onPressed: () {
|
||||||
|
sensor.add(
|
||||||
|
const ToggleHelpfulEvent(isHelpful: true));
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
SvgPicture.asset(
|
||||||
|
Assets.thumbUp,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
|
const BodyMedium(
|
||||||
|
text: 'Helpful',
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
fontColor: ColorsManager.blackColor,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
),
|
),
|
||||||
Center(
|
),
|
||||||
child: SizedBox(
|
const SizedBox(
|
||||||
width: 180,
|
height: 15,
|
||||||
child: DefaultButton(
|
),
|
||||||
backgroundColor: sensor.isHelpful == true
|
Center(
|
||||||
? ColorsManager.grayColor
|
child: SizedBox(
|
||||||
: ColorsManager.grayButtonColors,
|
width: 180,
|
||||||
borderRadius: 50,
|
child: DefaultButton(
|
||||||
onPressed: () {
|
backgroundColor: sensor.isHelpful == false
|
||||||
sensor
|
? ColorsManager.grayColor
|
||||||
.add(ToggleHelpfulEvent(isHelpful: true));
|
: ColorsManager.grayButtonColors,
|
||||||
},
|
borderRadius: 50,
|
||||||
child: Row(
|
onPressed: () {
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
sensor.add(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
const ToggleHelpfulEvent(isHelpful: false));
|
||||||
children: [
|
},
|
||||||
SvgPicture.asset(
|
child: Row(
|
||||||
Assets.thumbUp,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
fit: BoxFit.fill,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
),
|
children: [
|
||||||
const SizedBox(
|
SvgPicture.asset(
|
||||||
width: 10,
|
Assets.thumbDown,
|
||||||
),
|
fit: BoxFit.fill,
|
||||||
const BodyMedium(
|
),
|
||||||
text: 'Helpful',
|
const SizedBox(
|
||||||
fontSize: 12,
|
width: 10,
|
||||||
fontWeight: FontWeight.w400,
|
),
|
||||||
fontColor: ColorsManager.blackColor,
|
const BodyMedium(
|
||||||
),
|
text: 'Not Helpful',
|
||||||
],
|
fontSize: 12,
|
||||||
)),
|
fontWeight: FontWeight.w400,
|
||||||
),
|
fontColor: ColorsManager.blackColor,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
),
|
||||||
height: 15,
|
],
|
||||||
),
|
);
|
||||||
Center(
|
|
||||||
child: SizedBox(
|
|
||||||
width: 180,
|
|
||||||
child: DefaultButton(
|
|
||||||
backgroundColor: sensor.isHelpful == false
|
|
||||||
? ColorsManager.grayColor
|
|
||||||
: ColorsManager.grayButtonColors,
|
|
||||||
borderRadius: 50,
|
|
||||||
onPressed: () {
|
|
||||||
sensor.add(
|
|
||||||
ToggleHelpfulEvent(isHelpful: false));
|
|
||||||
},
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
SvgPicture.asset(
|
|
||||||
Assets.thumbDown,
|
|
||||||
fit: BoxFit.fill,
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
width: 10,
|
|
||||||
),
|
|
||||||
const BodyMedium(
|
|
||||||
text: 'Not Helpful',
|
|
||||||
fontSize: 12,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
fontColor: ColorsManager.blackColor,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
));
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -5,7 +5,6 @@ import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_blo
|
|||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/four_scene_model.dart';
|
|
||||||
import 'package:syncrow_app/features/menu/view/widgets/manage_home/home_settings.dart';
|
import 'package:syncrow_app/features/menu/view/widgets/manage_home/home_settings.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_button.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_button.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||||
@ -21,7 +20,6 @@ class ShareFourScenePage extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var spaces = HomeCubit.getInstance().spaces;
|
var spaces = HomeCubit.getInstance().spaces;
|
||||||
|
|
||||||
return DefaultScaffold(
|
return DefaultScaffold(
|
||||||
title: 'Share Device',
|
title: 'Share Device',
|
||||||
child: BlocProvider(
|
child: BlocProvider(
|
||||||
@ -30,18 +28,6 @@ class ShareFourScenePage extends StatelessWidget {
|
|||||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final sensor = BlocProvider.of<FourSceneBloc>(context);
|
final sensor = BlocProvider.of<FourSceneBloc>(context);
|
||||||
FourSceneModelState model = FourSceneModelState(
|
|
||||||
scene_1: '',
|
|
||||||
scene_2: '',
|
|
||||||
scene_3: '',
|
|
||||||
scene_4: '',
|
|
||||||
scene_id_group_id: '',
|
|
||||||
switch_backlight: '');
|
|
||||||
if (state is LoadingNewSate) {
|
|
||||||
model = state.device;
|
|
||||||
} else if (state is UpdateState) {
|
|
||||||
model = state.device;
|
|
||||||
}
|
|
||||||
return state is LoadingNewSate
|
return state is LoadingNewSate
|
||||||
? const Center(
|
? const Center(
|
||||||
child: DefaultContainer(
|
child: DefaultContainer(
|
||||||
@ -103,7 +89,7 @@ class ShareFourScenePage extends StatelessWidget {
|
|||||||
space: spaces!.first,
|
space: spaces!.first,
|
||||||
)));
|
)));
|
||||||
},
|
},
|
||||||
child: Text('Add Home Member')),
|
child: const Text('Add Home Member')),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
@ -51,9 +51,10 @@ class SosScreen extends StatelessWidget {
|
|||||||
builder: (context) => SosSettings(device: device!),
|
builder: (context) => SosSettings(device: device!),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
if (val == true) {
|
||||||
sensor.add(SosInitialDeviseInfo());
|
sensor.add(SosInitialDeviseInfo());
|
||||||
sensor.add(const SosInitial());
|
sensor.add(const SosInitial());
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: SvgPicture.asset(Assets.assetsIconsSettings),
|
child: SvgPicture.asset(Assets.assetsIconsSettings),
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user