|
@@ -2,15 +2,21 @@ import 'package:flutter/material.dart';
|
|
|
|
|
|
class VListFormCellGroup extends StatelessWidget {
|
|
|
final List<Widget> children;
|
|
|
+ final double? leadingIconWidth;
|
|
|
|
|
|
const VListFormCellGroup({
|
|
|
Key? key,
|
|
|
required this.children,
|
|
|
+ this.leadingIconWidth,
|
|
|
}) : super(key: key);
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- final divider = Divider(thickness: 1, color: Colors.grey.shade400);
|
|
|
+ final divider = Divider(
|
|
|
+ thickness: 1,
|
|
|
+ color: Colors.grey.shade400,
|
|
|
+ indent: leadingIconWidth,
|
|
|
+ );
|
|
|
final kids = <Widget>[];
|
|
|
for (var i = 0; i < children.length; i++) {
|
|
|
if (i > 0) {
|
|
@@ -42,6 +48,8 @@ class VListFormCell extends StatelessWidget {
|
|
|
final Widget? contentWidget;
|
|
|
final VoidCallback? onTap;
|
|
|
final double? height;
|
|
|
+ final double? leadingIconWidth;
|
|
|
+ final Widget? leadingIcon;
|
|
|
|
|
|
const VListFormCell({
|
|
|
super.key,
|
|
@@ -52,16 +60,26 @@ class VListFormCell extends StatelessWidget {
|
|
|
this.contentWidget,
|
|
|
this.onTap,
|
|
|
this.height,
|
|
|
+ this.leadingIcon,
|
|
|
+ this.leadingIconWidth,
|
|
|
}) : assert(label != null || labelWidget != null);
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
+ final h = height ?? 40;
|
|
|
final children = <Widget>[];
|
|
|
+ if (leadingIcon != null) {
|
|
|
+ final leadingWidget = SizedBox(
|
|
|
+ width: leadingIconWidth ?? h * .6,
|
|
|
+ child: leadingIcon,
|
|
|
+ );
|
|
|
+ children.add(leadingWidget);
|
|
|
+ }
|
|
|
children.add(_buildLabel());
|
|
|
children.add(Expanded(child: _buildRightPart()));
|
|
|
|
|
|
return SizedBox(
|
|
|
- height: height ?? 40,
|
|
|
+ height: h,
|
|
|
child: InkWell(
|
|
|
onTap: onTap,
|
|
|
child: Row(
|