make method

  1. @override
ExpansionPanelRadio make(
  1. BuildContext context
)
override

Implementation

@override
ExpansionPanelRadio make(BuildContext context) {
  lochildren(isExpanded) => [
        // if (lowDensity) Text('ld'),//was only debug test
        Flexible(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisSize: MainAxisSize.min,
            children: [
              Text(
                title + (isExpanded ? ':' : ''),
                style: isExpanded
                    ? Theme.of(context).textTheme.headlineSmall
                    // ?.apply(
                    //       color: Theme.of(context).colorScheme.primary,
                    //     )
                    : Theme.of(context).textTheme.bodyLarge,
                overflow:
                    isExpanded ? TextOverflow.visible : TextOverflow.ellipsis,
                maxLines: isExpanded ? 10 : 1,
              ),
              if (subtitle != null)
                Text(subtitle ?? "",
                    style: Theme.of(context).textTheme.bodyMedium),
            ],
          ),
        ),
        if (extra != null) extra!,
      ];
  return ExpansionPanelRadio(
    backgroundColor:
        color, // Theme.of(context).colorScheme.secondary.withOpacity(0.1),
    headerBuilder: (context, isExpanded) => ListTile(
      // selectedTileColor: Theme.of(context).colorScheme.secondary,
      // selectedColor: Theme.of(context).colorScheme.secondary,
      // selected: isExpanded,
      // enabled: true,
      leading: Padding(
        padding: EdgeInsets.all(isExpanded ? 0.0 : 8.0),
        child: ClipOval(
          child: AspectRatio(
            aspectRatio: 1.0,
            child: FutureBuilder<ImageData?>(
                future: previewImg,
                builder: (context, snapshot) {
                  var imagep = snapshot.data?.thumbnail.image;
                  return (imagep != null
                          ? Image(image: imagep, fit: BoxFit.fill)
                          : null) ??
                      Icon(
                        Icons.construction,
                        color: _color(isExpanded, context),
                      );
                }),
          ),
        ),
      ),
      // trailing: extra,
      title: lowDensity
          ? Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisSize: MainAxisSize.min,
              children: lochildren(isExpanded).reversed.toList(),
            )
          : Row(
              // direction: Axis.horizontal,
              // alignment: WrapAlignment.spaceBetween,
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisSize: MainAxisSize.min,
              children: lochildren(isExpanded),
            ),
      // subtitle: (subtitle != null) ? Text(subtitle ?? "") : null,
    ),
    body: Container(
      // color: Theme.of(context).colorScheme.secondary,
      child: Column(
        children: [...children, SizedBox(height: 10)],
      ),
    ),
    canTapOnHeader: true,
    value: key,
  );
}