mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 19:37:55 +00:00
fixed space
This commit is contained in:
@@ -60,7 +60,7 @@ class HomeSettingsView extends StatelessWidget {
|
||||
onTap: () {
|
||||
Navigator.of(context).push(CustomPageRoute(
|
||||
builder: (context) => RoomsView(
|
||||
unitId: space?.id ?? '',
|
||||
unit: space!,
|
||||
)));
|
||||
},
|
||||
child: Container(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/app_layout/model/space_model.dart';
|
||||
import 'package:syncrow_app/features/menu/bloc/manage_unit_bloc/manage_unit_bloc.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';
|
||||
@@ -11,14 +12,14 @@ import 'package:syncrow_app/utils/helpers/snack_bar.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
class RoomsView extends StatelessWidget {
|
||||
final String unitId;
|
||||
const RoomsView({super.key, required this.unitId});
|
||||
final SpaceModel unit;
|
||||
const RoomsView({super.key, required this.unit});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
return BlocProvider(
|
||||
create: (context) => ManageUnitBloc()..add(FetchRoomsEvent(unitId: unitId)),
|
||||
create: (context) => ManageUnitBloc()..add(FetchRoomsEvent(unit:unit )),
|
||||
child: BlocConsumer<ManageUnitBloc, ManageUnitState>(
|
||||
listener: (context, state) {},
|
||||
builder: (context, state) {
|
||||
@@ -62,7 +63,7 @@ class RoomsView extends StatelessWidget {
|
||||
MaterialPageRoute(
|
||||
builder: (context) => AssignDeviceView(
|
||||
roomId: state.roomsList[index].id ?? '',
|
||||
unitId: unitId,
|
||||
unitId: unit.id,
|
||||
)),
|
||||
);
|
||||
},
|
||||
@@ -100,7 +101,7 @@ class RoomsView extends StatelessWidget {
|
||||
BlocProvider.of<ManageUnitBloc>(context).add(
|
||||
AddNewRoom(
|
||||
roomName: textEditingController.text,
|
||||
unitId: unitId));
|
||||
unit: unit));
|
||||
textEditingController.clear();
|
||||
},
|
||||
child: const Row(
|
||||
|
||||
Reference in New Issue
Block a user