finished rooms call with all devices and single devices call

This commit is contained in:
ashrafzarkanisala
2024-06-23 20:12:38 +03:00
parent b58af41b88
commit 759888857d
8 changed files with 446 additions and 72 deletions
+9 -4
View File
@@ -5,6 +5,8 @@ import 'package:syncrow_app/features/auth/view/otp_view.dart';
import 'package:syncrow_app/features/auth/view/login_view.dart';
import 'package:syncrow_app/features/auth/view/sign_up_view.dart';
import 'package:syncrow_app/features/dashboard/view/dashboard_view.dart';
import 'package:syncrow_app/features/devices/bloc/device_manager_bloc/device_manager_bloc.dart';
import 'package:syncrow_app/features/devices/bloc/device_manager_bloc/device_manager_event.dart';
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
import 'package:syncrow_app/features/layout/view/layout_view.dart';
import 'package:syncrow_app/features/menu/view/menu_view.dart';
@@ -75,12 +77,15 @@ class Router {
return MaterialPageRoute(
builder: (_) => MultiBlocProvider(
providers: [
BlocProvider<TabBarBloc>(
create: (BuildContext context) => TabBarBloc()
BlocProvider(
create: (BuildContext context) =>
DeviceManagerBloc()..add(FetchAllDevices()),
),
BlocProvider(
create: (BuildContext context) => TabBarBloc(
context.read<DeviceManagerBloc>())
..add(const TabChanged(selectedIndex: 0, roomId: '-1')),
),
BlocProvider<DevicesCubit>(
create: (context) => DevicesCubit.getInstance()),
],
child: const SceneControlDevicesView(),
),