mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
updated project hardcoded values
This commit is contained in:
@ -10,6 +10,7 @@ import 'package:share_plus/share_plus.dart';
|
||||
import 'package:syncrow_app/features/app_layout/model/permission_model.dart';
|
||||
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/auth/model/project_model.dart';
|
||||
import 'package:syncrow_app/features/auth/model/user_model.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
|
||||
import 'package:syncrow_app/features/devices/model/subspace_model.dart';
|
||||
@ -28,6 +29,7 @@ import 'package:syncrow_app/navigation/routing_constants.dart';
|
||||
import 'package:syncrow_app/services/api/devices_api.dart';
|
||||
import 'package:syncrow_app/services/api/profile_api.dart';
|
||||
import 'package:syncrow_app/services/api/spaces_api.dart';
|
||||
import 'package:syncrow_app/utils/constants/temp_const.dart';
|
||||
import 'package:syncrow_app/utils/helpers/snack_bar.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
part 'home_state.dart';
|
||||
@ -67,6 +69,8 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
var uuid =
|
||||
await const FlutterSecureStorage().read(key: UserModel.userUuidKey);
|
||||
user = await ProfileApi().fetchUserInfo(uuid);
|
||||
project = user?.project;
|
||||
|
||||
emit(HomeUserInfoLoaded(user!));
|
||||
} catch (e) {
|
||||
return;
|
||||
@ -175,6 +179,8 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
|
||||
SubSpaceModel? selectedRoom;
|
||||
|
||||
Project? project;
|
||||
|
||||
PageController devicesPageController = PageController();
|
||||
|
||||
PageController roomsPageController = PageController();
|
||||
@ -324,8 +330,8 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
//////////////////////////////////////// API ////////////////////////////////////////
|
||||
generateInvitation(SpaceModel unit) async {
|
||||
try {
|
||||
final invitationCode =
|
||||
await SpacesAPI.generateInvitationCode(unit.id, unit.community.uuid);
|
||||
final invitationCode = await SpacesAPI.generateInvitationCode(unit.id,
|
||||
unit.community.uuid, project?.uuid ?? TempConst.projectIdDev);
|
||||
if (invitationCode.isNotEmpty) {
|
||||
Share.share('The invitation code is $invitationCode');
|
||||
CustomSnackBar.displaySnackBar(
|
||||
@ -380,8 +386,10 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
fetchRoomsByUnitId(SpaceModel space) async {
|
||||
emitSafe(GetSpaceRoomsLoading());
|
||||
try {
|
||||
space.subspaces =
|
||||
await SpacesAPI.getSubSpaceBySpaceId(space.community.uuid, space.id);
|
||||
space.subspaces = await SpacesAPI.getSubSpaceBySpaceId(
|
||||
space.community.uuid,
|
||||
space.id,
|
||||
project?.uuid ?? TempConst.projectIdDev);
|
||||
} catch (failure) {
|
||||
emitSafe(GetSpaceRoomsError(failure.toString()));
|
||||
return;
|
||||
@ -414,7 +422,6 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
emitSafe(ActivationError(errMessage: errorMsg));
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////// Nav ///////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user