import 'package:flutter/material.dart'; import 'package:qadirneyriz/config/config.dart'; class ExpansionTileCustom extends StatefulWidget { final String title; final String? subTitile; final List widgets; final bool isForm; const ExpansionTileCustom({ Key? key, required this.title, this.subTitile, required this.widgets, this.isForm = false, }) : super(key: key); @override State createState() => _ExpansionTileCustomState(); } class _ExpansionTileCustomState extends State { @override Widget build(BuildContext context) { return Container( decoration: widget.isForm ? BoxDecoration( border: Border( bottom: BorderSide( color: config.ui.mainGreen, // Set the color of the bottom border width: 2.0, // Set the width of the bottom border ), ), ) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (widget.isForm) Text( widget.subTitile ?? '', style: TextStyle( fontWeight: FontWeight.normal, fontSize: 13, color: Colors.black.withOpacity(.8), ), ), if (widget.isForm) const SizedBox( height: 5, ), ExpansionTile( shape: const Border(), // No shape (no shadow) collapsedShape: const Border(), // No shape (no shadow when collapsed) tilePadding: widget.isForm ? const EdgeInsets.symmetric(horizontal: 5) : null, // Adjust padding if needed iconColor: config.ui.secendGreen, collapsedIconColor: config.ui.secendGreen, title: Padding( padding: const EdgeInsets.symmetric(horizontal: 10), child: Text( widget.title, style: TextStyle( fontSize: 12, color: Colors.black.withOpacity(.5), ), ), ), children: [ Padding( padding: const EdgeInsets.all(8.0), child: Container( decoration: (widget.isForm) ? BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12.0), // Rounded corners boxShadow: [ BoxShadow( color: Colors.black.withOpacity(0.1), // Shadow color spreadRadius: 1, // Spread of the shadow blurRadius: 8, // Softening of the shadow offset: const Offset( 0, 4), // Positioning of the shadow ), ], ) : null, child: Padding( padding: const EdgeInsets.symmetric(vertical: 10), child: Column( children: widget.widgets, // Widgets inside the shadow container ), ), ), ), ], ), ], ), ); } }