mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 05:17:55 +00:00
push bottom sheet design of the scenes
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_app/features/scene/view/widgets/scene_list_tile.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/light_divider.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';
|
||||
|
||||
class CustomBottomSheetWidget extends StatelessWidget {
|
||||
const CustomBottomSheetWidget({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16, bottom: 8),
|
||||
child: BodyLarge(
|
||||
text: 'Add Task',
|
||||
style: context.bodyLarge.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: ColorsManager.primaryColorWithOpacity,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: context.width * 0.7,
|
||||
child: const LightDivider(),
|
||||
),
|
||||
SceneListTile(
|
||||
assetPath: Assets.assetsIconsLight,
|
||||
assetHeight: 24,
|
||||
minLeadingWidth: 30,
|
||||
titleString: 'Control Single Device',
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
trailingWidget: const Icon(
|
||||
Icons.arrow_forward_ios_rounded,
|
||||
size: 16,
|
||||
color: ColorsManager.greyColor,
|
||||
),
|
||||
onPressed: () {},
|
||||
),
|
||||
SceneListTile(
|
||||
assetPath: Assets.player,
|
||||
titleString: 'Select Automation',
|
||||
minLeadingWidth: 30,
|
||||
assetHeight: 24,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
trailingWidget: const Icon(
|
||||
Icons.arrow_forward_ios_rounded,
|
||||
size: 16,
|
||||
color: ColorsManager.greyColor,
|
||||
),
|
||||
onPressed: () {},
|
||||
),
|
||||
SceneListTile(
|
||||
assetPath: Assets.delay,
|
||||
titleString: 'Delay The Action',
|
||||
assetHeight: 24,
|
||||
minLeadingWidth: 30,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
trailingWidget: const Icon(
|
||||
Icons.arrow_forward_ios_rounded,
|
||||
size: 16,
|
||||
color: ColorsManager.greyColor,
|
||||
),
|
||||
onPressed: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.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/light_divider.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';
|
||||
@@ -31,10 +32,7 @@ class IFDefaultContainer extends StatelessWidget {
|
||||
trailingWidget: SvgPicture.asset(Assets.addIcon),
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
const Divider(
|
||||
color: ColorsManager.greyColor,
|
||||
thickness: 0.3,
|
||||
),
|
||||
const LightDivider(),
|
||||
const SceneListTile(
|
||||
assetPath: Assets.handClickIcon,
|
||||
titleString: StringsManager.tapToRun,
|
||||
@@ -45,3 +43,5 @@ class IFDefaultContainer extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_app/features/scene/view/widgets/scene_list_tile.dart';
|
||||
import 'package:syncrow_app/features/scene/view/widgets/if_then_containers/bottom_sheet_widget.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/light_divider.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';
|
||||
@@ -28,7 +30,9 @@ class ThenDefaultContainer extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
trailingWidget: GestureDetector(
|
||||
onTap: () => context.customBottomSheet(title: 'Add Task'),
|
||||
onTap: () => context.customBottomSheet(
|
||||
child: const CustomBottomSheetWidget(),
|
||||
),
|
||||
child: SvgPicture.asset(
|
||||
Assets.addIcon,
|
||||
colorFilter: const ColorFilter.mode(
|
||||
@@ -39,19 +43,13 @@ class ThenDefaultContainer extends StatelessWidget {
|
||||
),
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
const Divider(
|
||||
color: ColorsManager.greyColor,
|
||||
thickness: 0.3,
|
||||
),
|
||||
const LightDivider(),
|
||||
SceneListTile(
|
||||
titleString: '+ Add Task',
|
||||
textAlign: TextAlign.center,
|
||||
onPressed: () => context.customBottomSheet(
|
||||
title: 'Add Task',
|
||||
titleStyle: context.bodyLarge.copyWith(
|
||||
color: ColorsManager.primaryColorWithOpacity,
|
||||
fontWeight: FontWeight.bold,
|
||||
)),
|
||||
child: const CustomBottomSheetWidget(),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -17,6 +17,8 @@ class SceneListTile extends StatelessWidget {
|
||||
this.padding,
|
||||
this.textAlign,
|
||||
this.onPressed,
|
||||
this.assetHeight,
|
||||
this.minLeadingWidth,
|
||||
});
|
||||
final String? assetPath;
|
||||
final String? titleString;
|
||||
@@ -26,17 +28,20 @@ class SceneListTile extends StatelessWidget {
|
||||
final EdgeInsetsGeometry? padding;
|
||||
final TextAlign? textAlign;
|
||||
final void Function()? onPressed;
|
||||
final double? assetHeight;
|
||||
final double? minLeadingWidth;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
minLeadingWidth: 40,
|
||||
minLeadingWidth: minLeadingWidth ?? 40,
|
||||
leading: leadingWidget ??
|
||||
(assetPath != null
|
||||
? SvgPicture.asset(
|
||||
assetPath ?? Assets.assetsImagesLogo,
|
||||
width: 20,
|
||||
height: 32,
|
||||
height: assetHeight ?? 32,
|
||||
fit: BoxFit.fitWidth,
|
||||
)
|
||||
: null),
|
||||
trailing: trailingWidget,
|
||||
|
||||
Reference in New Issue
Block a user