mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-23 11:57:54 +00:00
bug fixes and read sensors states
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
import 'package:syncrow_app/features/menu/bloc/manage_unit_bloc/manage_unit_event.dart';
|
||||
import 'package:syncrow_app/features/menu/bloc/manage_unit_bloc/manage_unit_state.dart';
|
||||
@@ -101,6 +102,7 @@ class ManageUnitBloc extends Bloc<ManageUnitEvent, ManageUnitState> {
|
||||
final roomsList = await SpacesAPI.getRoomsBySpaceId(event.unitId);
|
||||
allDevices = await HomeManagementAPI.fetchDevicesByUserId();
|
||||
emit(FetchRoomsState(devicesList: allDevices, roomsList: roomsList));
|
||||
await HomeCubit.getInstance().fetchUnitsByUserId();
|
||||
} else {
|
||||
emit(const ErrorState(message: 'Something went wrong'));
|
||||
}
|
||||
|
||||
@@ -40,8 +40,9 @@ class HomeSettingsView extends StatelessWidget {
|
||||
Flexible(
|
||||
child: TextField(
|
||||
textAlign: TextAlign.end,
|
||||
readOnly: true,
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Enter Name',
|
||||
hintText: space?.name ?? 'Enter Name',
|
||||
hintStyle: context.bodyMedium.copyWith(color: Colors.grey),
|
||||
border: InputBorder.none,
|
||||
),
|
||||
@@ -55,15 +56,16 @@ class HomeSettingsView extends StatelessWidget {
|
||||
height: 1,
|
||||
color: ColorsManager.greyColor,
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(CustomPageRoute(
|
||||
builder: (context) => RoomsView(
|
||||
unitId: space?.id ?? '',
|
||||
)));
|
||||
},
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(CustomPageRoute(
|
||||
builder: (context) => RoomsView(
|
||||
unitId: space?.id ?? '',
|
||||
)));
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user