Widget _buildChildren(BuildContext context, Widget child)
        {
            Color borderSideColor = this._borderColor.value ?? Colors.transparent;

            return(new Container(
                       decoration: new BoxDecoration(
                           color: this._backgroundColor.value ?? Colors.transparent,
                           border: new Border(
                               top: new BorderSide(color: borderSideColor),
                               bottom: new BorderSide(color: borderSideColor))),
                       child: new Column(
                           mainAxisSize: MainAxisSize.min,
                           children: new List <Widget> {
                ListTileTheme.merge(
                    iconColor: this._iconColor.value,
                    textColor: this._headerColor.value,
                    child: new ListTile(
                        onTap: this._handleTap,
                        leading: this.widget.leading,
                        title: this.widget.title,
                        trailing: this.widget.trailing ?? new RotationTransition(
                            turns: this._iconTurns,
                            child: new Icon(Icons.expand_more)
                            )
                        )
                    ),
                new ClipRect(
                    child: new Align(
                        heightFactor: this._heightFactor.value,
                        child: child)
                    )
            }
                           )
                       ));
        }
Beispiel #2
0
        public override Widget build(BuildContext context)
        {
            Widget control = null;

            switch (_switchListTileType)
            {
            case _SwitchListTileType.adaptive:
                control = Switch.adaptive(
                    value: value,
                    onChanged: onChanged,
                    activeColor: activeColor,
                    activeThumbImage: activeThumbImage,
                    inactiveThumbImage: inactiveThumbImage,
                    materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
                    activeTrackColor: activeTrackColor,
                    inactiveTrackColor: inactiveTrackColor,
                    inactiveThumbColor: inactiveThumbColor
                    );
                break;

            case _SwitchListTileType.material:
                control = new Switch(
                    value: value,
                    onChanged: onChanged,
                    activeColor: activeColor,
                    activeThumbImage: activeThumbImage,
                    inactiveThumbImage: inactiveThumbImage,
                    materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
                    activeTrackColor: activeTrackColor,
                    inactiveTrackColor: inactiveTrackColor,
                    inactiveThumbColor: inactiveThumbColor
                    );
                break;
            }

            return(ListTileTheme.merge(
                       selectedColor: activeColor ?? Theme.of(context).accentColor,
                       child: new ListTile(
                           leading: secondary,
                           title: title,
                           subtitle: subtitle,
                           trailing: control,
                           isThreeLine: isThreeLine,
                           dense: dense,
                           contentPadding: contentPadding,
                           enabled: onChanged != null,
                           onTap: onChanged != null ? () => { onChanged(!value); } : (GestureTapCallback)null,
                           selected: selected
                           )
                       ));
        }
Beispiel #3
0
        public override Widget build(BuildContext context)
        {
            Widget control = new Checkbox(
                value: value,
                onChanged: onChanged,
                activeColor: activeColor,
                checkColor: checkColor,
                materialTapTargetSize: MaterialTapTargetSize.shrinkWrap
                );
            Widget leading  = null;
            Widget trailing = null;

            switch (controlAffinity)
            {
            case ListTileControlAffinity.leading:
                leading  = control;
                trailing = secondary;
                break;

            case ListTileControlAffinity.trailing:
            case ListTileControlAffinity.platform:
                leading  = secondary;
                trailing = control;
                break;
            }

            return(ListTileTheme.merge(
                       selectedColor: activeColor ?? Theme.of(context).accentColor,
                       child: new ListTile(
                           leading: leading,
                           title: title,
                           subtitle: subtitle,
                           trailing: trailing,
                           isThreeLine: isThreeLine,
                           dense: dense,
                           enabled: onChanged != null,
                           onTap: onChanged != null ? () => { onChanged(!value); } : (GestureTapCallback)null,
                           selected: selected
                           )
                       ));
        }