mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 04:04:55 +00:00
push folders revamp
This commit is contained in:
67
lib/features/scene/widgets/scene_list_tile.dart
Normal file
67
lib/features/scene/widgets/scene_list_tile.dart
Normal file
@ -0,0 +1,67 @@
|
||||
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,
|
||||
this.assetPath,
|
||||
this.titleString,
|
||||
this.subtitle,
|
||||
this.leadingWidget,
|
||||
this.trailingWidget,
|
||||
this.padding,
|
||||
this.textAlign,
|
||||
this.onPressed,
|
||||
this.assetHeight,
|
||||
this.minLeadingWidth,
|
||||
this.titleWidget,
|
||||
});
|
||||
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;
|
||||
final double? assetHeight;
|
||||
final double? minLeadingWidth;
|
||||
final Widget? titleWidget;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
minLeadingWidth: minLeadingWidth ?? 40,
|
||||
leading: leadingWidget ??
|
||||
(assetPath != null
|
||||
? SvgPicture.asset(
|
||||
assetPath ?? Assets.assetsImagesLogo,
|
||||
width: 20,
|
||||
height: assetHeight ?? 32,
|
||||
fit: BoxFit.fitWidth,
|
||||
)
|
||||
: null),
|
||||
trailing: trailingWidget,
|
||||
contentPadding: padding,
|
||||
title: titleWidget ??
|
||||
BodyMedium(
|
||||
text: titleString ?? '',
|
||||
textAlign: textAlign,
|
||||
style: context.bodyMedium.copyWith(fontSize: 15),
|
||||
),
|
||||
subtitle: subtitle == null
|
||||
? null
|
||||
: BodySmall(
|
||||
text: subtitle!,
|
||||
style: context.bodySmall.copyWith(
|
||||
fontWeight: FontWeight.w400, color: ColorsManager.greyColor),
|
||||
),
|
||||
onTap: onPressed,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user