mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 02:37:55 +00:00
finished if scene design
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
enum CreateSceneEnum {
|
||||
tabToRun,
|
||||
deviceStatusChanges,
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_app/features/scene/enum/create_scene_enum.dart';
|
||||
import 'package:syncrow_app/features/scene/view/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/features/shared_widgets/text_widgets/body_medium.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.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/navigation/routing_constants.dart';
|
||||
|
||||
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
||||
|
||||
class CreateSceneView extends StatelessWidget {
|
||||
@@ -14,61 +14,41 @@ class CreateSceneView extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const DefaultScaffold(
|
||||
return DefaultScaffold(
|
||||
title: StringsManager.createScene,
|
||||
padding: EdgeInsets.only(top: 24),
|
||||
padding: const EdgeInsets.only(top: 24),
|
||||
child: Column(
|
||||
children: [
|
||||
DefaultContainer(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.symmetric(vertical: 4),
|
||||
child: SceneListTile(
|
||||
margin: const EdgeInsets.symmetric(vertical: 4),
|
||||
child: const SceneListTile(
|
||||
assetPath: Assets.handClickIcon,
|
||||
title: StringsManager.tapToRun,
|
||||
subtitle: StringsManager.turnOffAllLights,
|
||||
),
|
||||
onTap: () => Navigator.pushNamed(
|
||||
context,
|
||||
Routes.sceneTasksRoute,
|
||||
arguments: CreateSceneEnum.tabToRun,
|
||||
),
|
||||
),
|
||||
DefaultContainer(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.symmetric(vertical: 4),
|
||||
child: SceneListTile(
|
||||
margin: const EdgeInsets.symmetric(vertical: 4),
|
||||
child: const SceneListTile(
|
||||
assetPath: Assets.refreshIcon,
|
||||
title: StringsManager.whenDeviceStatusChanges,
|
||||
subtitle: StringsManager.whenUnusualActivityIsDetected,
|
||||
),
|
||||
onTap: () => Navigator.pushNamed(
|
||||
context,
|
||||
Routes.sceneTasksRoute,
|
||||
arguments: CreateSceneEnum.deviceStatusChanges,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SceneListTile extends StatelessWidget {
|
||||
const SceneListTile({
|
||||
super.key,
|
||||
required this.assetPath,
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
});
|
||||
final String assetPath;
|
||||
final String title;
|
||||
final String subtitle;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
minLeadingWidth: 40,
|
||||
leading: SvgPicture.asset(
|
||||
assetPath,
|
||||
width: 20,
|
||||
height: 32,
|
||||
),
|
||||
title: BodyMedium(text: title),
|
||||
subtitle: BodySmall(
|
||||
text: subtitle,
|
||||
style: context.bodySmall.copyWith(
|
||||
fontWeight: FontWeight.w400, color: ColorsManager.greyColor),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_app/features/auth/view/widgets/login_divider.dart';
|
||||
import 'package:syncrow_app/features/scene/view/widgets/scene_list_tile.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_button.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/features/shared_widgets/text_widgets/body_large.dart';
|
||||
import 'package:syncrow_app/generated/assets.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
||||
|
||||
class SceneAddTasksView extends StatelessWidget {
|
||||
const SceneAddTasksView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DefaultScaffold(
|
||||
title: StringsManager.createScene,
|
||||
padding: const EdgeInsets.only(top: 24),
|
||||
actions: [
|
||||
SizedBox(
|
||||
width: 40,
|
||||
child: GestureDetector(
|
||||
child: SvgPicture.asset(
|
||||
Assets.assetsIconsSettings,
|
||||
colorFilter: const ColorFilter.mode(
|
||||
ColorsManager.textPrimaryColor,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
DefaultContainer(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const BodyLarge(
|
||||
text: 'IF',
|
||||
),
|
||||
SvgPicture.asset(Assets.addIcon),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
color: ColorsManager.greyColor,
|
||||
),
|
||||
const SceneListTile(
|
||||
assetPath: Assets.handClickIcon,
|
||||
title: StringsManager.tapToRun,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
|
||||
import 'package:syncrow_app/utils/context_extension.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
class SceneListTile extends StatelessWidget {
|
||||
const SceneListTile({
|
||||
super.key,
|
||||
required this.assetPath,
|
||||
required this.title,
|
||||
this.subtitle,
|
||||
});
|
||||
final String assetPath;
|
||||
final String title;
|
||||
final String? subtitle;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
minLeadingWidth: 40,
|
||||
leading: SvgPicture.asset(
|
||||
assetPath,
|
||||
width: 20,
|
||||
height: 32,
|
||||
),
|
||||
title: BodyMedium(text: title),
|
||||
subtitle: subtitle == null
|
||||
? null
|
||||
: BodySmall(
|
||||
text: subtitle!,
|
||||
style: context.bodySmall.copyWith(
|
||||
fontWeight: FontWeight.w400, color: ColorsManager.greyColor),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user