mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-16 01:56:24 +00:00
push get scenes and automation
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/bloc/device_mgmt_bloc/device_managment_bloc.dart';
|
||||
import 'package:syncrow_web/pages/routiens/widgets/dragable_card.dart';
|
||||
import 'package:syncrow_web/pages/routiens/widgets/routine_devices.dart';
|
||||
import 'package:syncrow_web/pages/routiens/widgets/routines_title_widget.dart';
|
||||
import 'package:syncrow_web/pages/routiens/widgets/scenes_and_automations.dart';
|
||||
import 'package:syncrow_web/pages/routiens/widgets/search_bar_condition_title.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
|
||||
@ -50,6 +50,9 @@ class ConditionsRoutinesDevicesView extends StatelessWidget {
|
||||
title: 'Conditions',
|
||||
subtitle: '(THEN)',
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
const Wrap(
|
||||
spacing: 10,
|
||||
runSpacing: 10,
|
||||
@ -71,33 +74,21 @@ class ConditionsRoutinesDevicesView extends StatelessWidget {
|
||||
title: 'Routines',
|
||||
subtitle: '(THEN)',
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
const ScenesAndAutomations(),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
const TitleRoutine(
|
||||
title: 'Devices',
|
||||
subtitle: '',
|
||||
),
|
||||
BlocProvider(
|
||||
create: (context) => DeviceManagementBloc()
|
||||
..add(
|
||||
FetchDevices(),
|
||||
),
|
||||
child: BlocBuilder<DeviceManagementBloc, DeviceManagementState>(
|
||||
builder: (context, state) {
|
||||
if (state is DeviceManagementLoaded) {
|
||||
return Wrap(
|
||||
spacing: 10,
|
||||
runSpacing: 10,
|
||||
children: state.devices
|
||||
.map((device) => DraggableCard(
|
||||
imagePath: device.getDefaultIcon(device.productType),
|
||||
title: device.name ?? '',
|
||||
))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
const RoutineDevices(),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user