mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 18:37:56 +00:00
115 lines
4.2 KiB
Dart
115 lines
4.2 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/text_widgets/body_large.dart';
|
|
import 'package:syncrow_app/generated/assets.dart';
|
|
import 'package:syncrow_app/utils/context_extension.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/font_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 Scaffold(
|
|
backgroundColor: ColorsManager.backgroundColor,
|
|
appBar: AppBar(
|
|
centerTitle: true,
|
|
backgroundColor: ColorsManager.backgroundColor,
|
|
title: const BodyLarge(
|
|
text: "Settings",
|
|
fontColor: ColorsManager.secondaryColor,
|
|
fontWeight: FontsManager.bold,
|
|
),
|
|
),
|
|
body: Stack(
|
|
children: [
|
|
Container(
|
|
width: double.infinity,
|
|
height: context.height,
|
|
decoration: const BoxDecoration(
|
|
color: ColorsManager.backgroundColor,
|
|
image: DecorationImage(
|
|
image: AssetImage(
|
|
Assets.assetsImagesBackground,
|
|
),
|
|
fit: BoxFit.cover,
|
|
opacity: 0.4,
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
|
child: Container(
|
|
decoration: const BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.all(Radius.circular(16)),
|
|
),
|
|
constraints: const BoxConstraints(
|
|
maxWidth: 600,
|
|
maxHeight: 300,
|
|
),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
const SizedBox(
|
|
height: 8,
|
|
),
|
|
Visibility(
|
|
visible: isAutomation == true,
|
|
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,
|
|
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,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|