mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-08-26 07:19:39 +00:00
push automation
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
|
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
|
||||||
|
import 'package:syncrow_app/features/devices/view/widgets/scene_listview.dart';
|
||||||
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
|
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
|
||||||
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_bloc.dart';
|
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_bloc.dart';
|
||||||
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_event.dart';
|
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_event.dart';
|
||||||
@ -72,11 +73,18 @@ class SceneView extends StatelessWidget {
|
|||||||
final scenes = state.scenes;
|
final scenes = state.scenes;
|
||||||
final automationList = state.automationList;
|
final automationList = state.automationList;
|
||||||
|
|
||||||
return Expanded(
|
return pageType
|
||||||
|
? Expanded(
|
||||||
|
child: SceneListview(
|
||||||
|
scenes: state.scenes,
|
||||||
|
loadingSceneId: state.loadingSceneId,
|
||||||
|
))
|
||||||
|
: Expanded(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
ExpansionTile(
|
ExpansionTile(
|
||||||
tilePadding: const EdgeInsets.symmetric(
|
tilePadding:
|
||||||
|
const EdgeInsets.symmetric(
|
||||||
horizontal: 6),
|
horizontal: 6),
|
||||||
initiallyExpanded: true,
|
initiallyExpanded: true,
|
||||||
iconColor: ColorsManager.grayColor,
|
iconColor: ColorsManager.grayColor,
|
||||||
@ -104,9 +112,11 @@ class SceneView extends StatelessWidget {
|
|||||||
ExpansionTile(
|
ExpansionTile(
|
||||||
initiallyExpanded: true,
|
initiallyExpanded: true,
|
||||||
iconColor: ColorsManager.grayColor,
|
iconColor: ColorsManager.grayColor,
|
||||||
tilePadding: const EdgeInsets.symmetric(
|
tilePadding:
|
||||||
|
const EdgeInsets.symmetric(
|
||||||
horizontal: 6),
|
horizontal: 6),
|
||||||
title: const BodySmall(text: 'Automation'),
|
title: const BodySmall(
|
||||||
|
text: 'Automation'),
|
||||||
children: [
|
children: [
|
||||||
automationList.isNotEmpty
|
automationList.isNotEmpty
|
||||||
? SceneGrid(
|
? SceneGrid(
|
||||||
|
@ -13,6 +13,7 @@ import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
|||||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||||
import 'package:syncrow_app/generated/assets.dart';
|
import 'package:syncrow_app/generated/assets.dart';
|
||||||
import 'package:syncrow_app/utils/context_extension.dart';
|
import 'package:syncrow_app/utils/context_extension.dart';
|
||||||
|
import 'package:syncrow_app/utils/helpers/snack_bar.dart';
|
||||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||||
|
|
||||||
class ThenAddedTasksContainer extends StatelessWidget
|
class ThenAddedTasksContainer extends StatelessWidget
|
||||||
@ -146,9 +147,7 @@ class ThenAddedTasksContainer extends StatelessWidget
|
|||||||
String removeFunction =
|
String removeFunction =
|
||||||
"${taskItem.operationName} with value ${taskItem.operationalValues.first.value}";
|
"${taskItem.operationName} with value ${taskItem.operationalValues.first.value}";
|
||||||
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
CustomSnackBar.displaySnackBar('$removeFunction removed');
|
||||||
SnackBar(content: Text('$removeFunction removed')),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
child: SceneListTile(
|
child: SceneListTile(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
|
Reference in New Issue
Block a user