mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-03-13 05:31:45 +00:00
showSpaceBottomSheet in a DefaultAppBar and Routine trigger from the device screen
and fixes github comments and i used this package flutter_html: ^3.0.0-beta.2
This commit is contained in:
@ -1,14 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
|
||||
import 'package:syncrow_app/features/scene/bloc/smart_scene/smart_scene_select_dart_bloc.dart';
|
||||
import 'package:syncrow_app/features/scene/enum/create_scene_enum.dart';
|
||||
import 'package:syncrow_app/features/scene/model/scene_settings_route_arguments.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/model/scenes_model.dart';
|
||||
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/generated/assets.dart';
|
||||
import 'package:syncrow_app/navigation/routing_constants.dart';
|
||||
|
||||
class SceneListview extends StatelessWidget {
|
||||
final List<ScenesModel> scenes;
|
||||
@ -31,23 +28,28 @@ class SceneListview extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(right: 10),
|
||||
child: DefaultContainer(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
Routes.sceneTasksRoute,
|
||||
arguments: SceneSettingsRouteArguments(
|
||||
sceneType: CreateSceneEnum.tabToRun.name,
|
||||
sceneId: scene.id,
|
||||
sceneName: scene.name,
|
||||
),
|
||||
);
|
||||
context.read<SmartSceneSelectBloc>().add(const SmartSceneClearEvent());
|
||||
context
|
||||
.read<SceneBloc>()
|
||||
.add(SceneTrigger(scene.id, scene.name));
|
||||
// Navigator.pushNamed(
|
||||
// context,
|
||||
// Routes.sceneTasksRoute,
|
||||
// arguments: SceneSettingsRouteArguments(
|
||||
// sceneType: CreateSceneEnum.tabToRun.name,
|
||||
// sceneId: scene.id,
|
||||
// sceneName: scene.name,
|
||||
// ),
|
||||
// );
|
||||
// context.read<SmartSceneSelectBloc>()
|
||||
// .add(const SmartSceneClearEvent());
|
||||
|
||||
BlocProvider.of<CreateSceneBloc>(context)
|
||||
.add(FetchSceneTasksEvent(sceneId: scene.id, isAutomation: false));
|
||||
// BlocProvider.of<CreateSceneBloc>(context).add(
|
||||
// FetchSceneTasksEvent(
|
||||
// sceneId: scene.id, isAutomation: false));
|
||||
|
||||
/// the state to set the scene type must be after the fetch
|
||||
BlocProvider.of<CreateSceneBloc>(context)
|
||||
.add(const SceneTypeEvent(CreateSceneEnum.tabToRun));
|
||||
// /// the state to set the scene type must be after the fetch
|
||||
// BlocProvider.of<CreateSceneBloc>(context)
|
||||
// .add(const SceneTypeEvent(CreateSceneEnum.tabToRun));
|
||||
},
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.4,
|
||||
@ -62,7 +64,8 @@ class SceneListview extends StatelessWidget {
|
||||
height: 32,
|
||||
width: 32,
|
||||
fit: BoxFit.fill,
|
||||
errorBuilder: (context, error, stackTrace) => Image.asset(
|
||||
errorBuilder: (context, error, stackTrace) =>
|
||||
Image.asset(
|
||||
Assets.assetsIconsLogo,
|
||||
height: 32,
|
||||
width: 32,
|
||||
|
||||
Reference in New Issue
Block a user