mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-17 02:25:16 +00:00
94 lines
3.5 KiB
Dart
94 lines
3.5 KiB
Dart
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/enum/create_scene_enum.dart';
|
|
import 'package:syncrow_app/features/scene/view/scene_tasks_view.dart';
|
|
import 'package:syncrow_app/features/scene/widgets/effective_period_setting/effective_period_bottom_sheet.dart';
|
|
import 'package:syncrow_app/features/scene/widgets/scene_list_tile.dart';
|
|
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
|
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
|
import 'package:syncrow_app/utils/context_extension.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
|
|
|
class SceneAutoSettings extends StatelessWidget {
|
|
const SceneAutoSettings({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final sceneSettings =
|
|
ModalRoute.of(context)!.settings.arguments as Map<String, dynamic>? ??
|
|
{};
|
|
final sceneId = sceneSettings['sceneId'] as String? ?? '';
|
|
final isAutomation = context.read<CreateSceneBloc>().sceneType ==
|
|
CreateSceneEnum.deviceStatusChanges;
|
|
final sceneName = sceneSettings['sceneName'] as String? ?? '';
|
|
|
|
return DefaultScaffold(
|
|
title: 'Settings',
|
|
padding: EdgeInsets.zero,
|
|
leading: IconButton(
|
|
onPressed: () {
|
|
Navigator.of(context).pop();
|
|
},
|
|
icon: const Icon(
|
|
Icons.arrow_back_ios,
|
|
)),
|
|
child: SizedBox(
|
|
height: MediaQuery.sizeOf(context).height,
|
|
child: Column(
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
|
child: DefaultContainer(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
const SizedBox(
|
|
height: 8,
|
|
),
|
|
Visibility(
|
|
visible: isAutomation,
|
|
child: SceneListTile(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: 16, vertical: 8),
|
|
titleString: "Effective Period",
|
|
trailingWidget:
|
|
const Icon(Icons.arrow_forward_ios_rounded),
|
|
onPressed: () {
|
|
context.customBottomSheet(
|
|
child: const EffectPeriodBottomSheetContent(),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
Visibility(
|
|
visible: sceneName.isNotEmpty && isAutomation,
|
|
child: SizedBox(
|
|
width: context.width * 0.9,
|
|
child: const Divider(
|
|
color: ColorsManager.greyColor,
|
|
),
|
|
),
|
|
),
|
|
Visibility(
|
|
visible: sceneName.isNotEmpty,
|
|
child: DeleteBottomSheetContent(
|
|
isAutomation: isAutomation,
|
|
sceneId: sceneId,
|
|
),
|
|
),
|
|
const SizedBox(
|
|
height: 16,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|