mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 23:47:54 +00:00
finished if - then - save button design
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
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/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/strings_manager.dart';
|
||||
|
||||
class IFDefaultContainer extends StatelessWidget {
|
||||
const IFDefaultContainer({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DefaultContainer(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 2),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SceneListTile(
|
||||
leadingWidget: BodyLarge(
|
||||
text: 'IF',
|
||||
style: context.bodyLarge.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: ColorsManager.primaryTextColor,
|
||||
),
|
||||
),
|
||||
trailingWidget: SvgPicture.asset(Assets.addIcon),
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
const Divider(
|
||||
color: ColorsManager.greyColor,
|
||||
thickness: 0.3,
|
||||
),
|
||||
const SceneListTile(
|
||||
assetPath: Assets.handClickIcon,
|
||||
titleString: StringsManager.tapToRun,
|
||||
padding: EdgeInsets.zero,
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
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/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 ThenDefaultContainer extends StatelessWidget {
|
||||
const ThenDefaultContainer({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DefaultContainer(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 2),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SceneListTile(
|
||||
leadingWidget: BodyLarge(
|
||||
text: 'Then',
|
||||
style: context.bodyLarge.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: ColorsManager.primaryTextColor,
|
||||
),
|
||||
),
|
||||
trailingWidget: GestureDetector(
|
||||
onTap: () => context.customBottomSheet(title: 'Add Task'),
|
||||
child: SvgPicture.asset(
|
||||
Assets.addIcon,
|
||||
colorFilter: const ColorFilter.mode(
|
||||
ColorsManager.primaryColor,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
const Divider(
|
||||
color: ColorsManager.greyColor,
|
||||
thickness: 0.3,
|
||||
),
|
||||
SceneListTile(
|
||||
titleString: '+ Add Task',
|
||||
textAlign: TextAlign.center,
|
||||
onPressed: () => context.customBottomSheet(
|
||||
title: 'Add Task',
|
||||
titleStyle: context.bodyLarge.copyWith(
|
||||
color: ColorsManager.primaryColorWithOpacity,
|
||||
fontWeight: FontWeight.bold,
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,30 +2,50 @@ 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/generated/assets.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.assetPath,
|
||||
this.titleString,
|
||||
this.subtitle,
|
||||
this.leadingWidget,
|
||||
this.trailingWidget,
|
||||
this.padding,
|
||||
this.textAlign,
|
||||
this.onPressed,
|
||||
});
|
||||
final String assetPath;
|
||||
final String title;
|
||||
final String? assetPath;
|
||||
final String? titleString;
|
||||
final String? subtitle;
|
||||
final Widget? leadingWidget;
|
||||
final Widget? trailingWidget;
|
||||
final EdgeInsetsGeometry? padding;
|
||||
final TextAlign? textAlign;
|
||||
final void Function()? onPressed;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
minLeadingWidth: 40,
|
||||
leading: SvgPicture.asset(
|
||||
assetPath,
|
||||
width: 20,
|
||||
height: 32,
|
||||
leading: leadingWidget ??
|
||||
(assetPath != null
|
||||
? SvgPicture.asset(
|
||||
assetPath ?? Assets.assetsImagesLogo,
|
||||
width: 20,
|
||||
height: 32,
|
||||
)
|
||||
: null),
|
||||
trailing: trailingWidget,
|
||||
contentPadding: padding,
|
||||
title: BodyMedium(
|
||||
text: titleString ?? '',
|
||||
textAlign: textAlign,
|
||||
style: context.bodyMedium.copyWith(fontSize: 15),
|
||||
),
|
||||
title: BodyMedium(text: title),
|
||||
subtitle: subtitle == null
|
||||
? null
|
||||
: BodySmall(
|
||||
@@ -33,6 +53,7 @@ class SceneListTile extends StatelessWidget {
|
||||
style: context.bodySmall.copyWith(
|
||||
fontWeight: FontWeight.w400, color: ColorsManager.greyColor),
|
||||
),
|
||||
onTap: onPressed,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user