mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-21 22:39:11 +00:00
81 lines
No EOL
2.1 KiB
Dart
81 lines
No EOL
2.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class CustomListTile extends StatelessWidget {
|
|
final IconData? leadingIcon;
|
|
final String label;
|
|
final String? description;
|
|
final Color? color;
|
|
final void Function()? onTap;
|
|
final void Function()? onDoubleTap;
|
|
final Widget? trailing;
|
|
final EdgeInsets? padding;
|
|
|
|
const CustomListTile({
|
|
Key? key,
|
|
this.leadingIcon,
|
|
required this.label,
|
|
this.description,
|
|
this.color,
|
|
this.onTap,
|
|
this.onDoubleTap,
|
|
this.trailing,
|
|
this.padding
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Material(
|
|
color: Colors.transparent,
|
|
child: InkWell(
|
|
onTap: onTap,
|
|
onDoubleTap: onDoubleTap,
|
|
child: Container(
|
|
padding: padding ?? const EdgeInsets.symmetric(
|
|
vertical: 10,
|
|
horizontal: 25
|
|
),
|
|
width: double.maxFinite,
|
|
child: Row(
|
|
children: [
|
|
if (leadingIcon != null) Row(
|
|
children: [
|
|
Icon(
|
|
leadingIcon,
|
|
color: color,
|
|
),
|
|
const SizedBox(width: 20),
|
|
],
|
|
),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
label,
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
color: color
|
|
),
|
|
),
|
|
if (description != null) Column(
|
|
children: [
|
|
const SizedBox(height: 5),
|
|
Text(
|
|
description!,
|
|
style: TextStyle(
|
|
color: color ?? Colors.grey
|
|
),
|
|
)
|
|
],
|
|
)
|
|
],
|
|
),
|
|
),
|
|
if (trailing != null) trailing!
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |