mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
Implemented side tree to devices and rountines screen
This commit is contained in:
120
lib/pages/routines/widgets/conditions_routines_devices_view.dart
Normal file
120
lib/pages/routines/widgets/conditions_routines_devices_view.dart
Normal file
@ -0,0 +1,120 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/routines/bloc/routine_bloc/routine_bloc.dart';
|
||||
import 'package:syncrow_web/pages/routines/widgets/dragable_card.dart';
|
||||
import 'package:syncrow_web/pages/routines/widgets/routine_devices.dart';
|
||||
import 'package:syncrow_web/pages/routines/widgets/routines_title_widget.dart';
|
||||
import 'package:syncrow_web/pages/routines/widgets/scenes_and_automations.dart';
|
||||
import 'package:syncrow_web/pages/routines/widgets/search_bar_condition_title.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
|
||||
class ConditionsRoutinesDevicesView extends StatelessWidget {
|
||||
const ConditionsRoutinesDevicesView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<RoutineBloc, RoutineState>(
|
||||
builder: (context, state) {
|
||||
return const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ConditionTitleAndSearchBar(),
|
||||
SizedBox(height: 10),
|
||||
Wrap(
|
||||
spacing: 10,
|
||||
runSpacing: 10,
|
||||
children: [
|
||||
DraggableCard(
|
||||
imagePath: Assets.tabToRun,
|
||||
title: 'Tab to run',
|
||||
deviceData: {
|
||||
'deviceId': 'tab_to_run',
|
||||
'type': 'trigger',
|
||||
'name': 'Tab to run',
|
||||
},
|
||||
),
|
||||
DraggableCard(
|
||||
imagePath: Assets.map,
|
||||
title: 'Location',
|
||||
deviceData: {
|
||||
'deviceId': 'location',
|
||||
'type': 'trigger',
|
||||
'name': 'Location',
|
||||
},
|
||||
),
|
||||
DraggableCard(
|
||||
imagePath: Assets.weather,
|
||||
title: 'Weather',
|
||||
deviceData: {
|
||||
'deviceId': 'weather',
|
||||
'type': 'trigger',
|
||||
'name': 'Weather',
|
||||
},
|
||||
),
|
||||
DraggableCard(
|
||||
imagePath: Assets.schedule,
|
||||
title: 'Schedule',
|
||||
deviceData: {
|
||||
'deviceId': 'schedule',
|
||||
'type': 'trigger',
|
||||
'name': 'Schedule',
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
TitleRoutine(
|
||||
title: 'Conditions',
|
||||
subtitle: '(THEN)',
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Wrap(
|
||||
spacing: 10,
|
||||
runSpacing: 10,
|
||||
children: [
|
||||
DraggableCard(
|
||||
imagePath: Assets.notification,
|
||||
title: 'Send Notification',
|
||||
deviceData: {
|
||||
'deviceId': 'notification',
|
||||
'type': 'action',
|
||||
'name': 'Send Notification',
|
||||
},
|
||||
),
|
||||
DraggableCard(
|
||||
imagePath: Assets.delay,
|
||||
title: 'Delay the action',
|
||||
deviceData: {
|
||||
'deviceId': 'delay',
|
||||
'type': 'action',
|
||||
'name': 'Delay the action',
|
||||
'uniqueCustomId': '',
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
TitleRoutine(
|
||||
title: 'Routines',
|
||||
subtitle: '(THEN)',
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
ScenesAndAutomations(),
|
||||
SizedBox(height: 10),
|
||||
TitleRoutine(
|
||||
title: 'Devices',
|
||||
subtitle: '',
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
RoutineDevices(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user