|
|
|
|
@ -21,6 +21,8 @@ class AppExpandableNotifier extends StatefulWidget {
|
|
|
|
|
bool hasCounter = false;
|
|
|
|
|
String counter = "0";
|
|
|
|
|
Color widgetColor;
|
|
|
|
|
Color? headerColor;
|
|
|
|
|
Color? completeHeaderColor;
|
|
|
|
|
var controller = new ExpandableController();
|
|
|
|
|
bool isTitleSingleLine;
|
|
|
|
|
bool isDisabled = false;
|
|
|
|
|
@ -28,6 +30,10 @@ class AppExpandableNotifier extends StatefulWidget {
|
|
|
|
|
final String? projectTitleTop;
|
|
|
|
|
final String? projectTitleBottom;
|
|
|
|
|
final bool showDropDownIconWithCustomHeader;
|
|
|
|
|
final BorderRadius? headerRadius;
|
|
|
|
|
final bool applyBackgroundColor;
|
|
|
|
|
final bool applyBackgroundToOnlyHeader;
|
|
|
|
|
final double? paddingValue;
|
|
|
|
|
|
|
|
|
|
AppExpandableNotifier(
|
|
|
|
|
{this.headerWidget,
|
|
|
|
|
@ -39,12 +45,17 @@ class AppExpandableNotifier extends StatefulWidget {
|
|
|
|
|
this.hasCounter = false,
|
|
|
|
|
this.counter = "0",
|
|
|
|
|
this.widgetColor = Colors.white,
|
|
|
|
|
this.headerColor,
|
|
|
|
|
this.completeHeaderColor,
|
|
|
|
|
this.isDisabled = false,
|
|
|
|
|
this.isDoctorSearchResult = false,
|
|
|
|
|
this.projectTitleTop = "",
|
|
|
|
|
this.projectTitleBottom = "",
|
|
|
|
|
this.showDropDownIconWithCustomHeader = false,
|
|
|
|
|
});
|
|
|
|
|
this.headerRadius,
|
|
|
|
|
this.applyBackgroundColor = true,
|
|
|
|
|
this.applyBackgroundToOnlyHeader = false,
|
|
|
|
|
this.paddingValue});
|
|
|
|
|
|
|
|
|
|
_AppExpandableNotifier createState() => _AppExpandableNotifier();
|
|
|
|
|
}
|
|
|
|
|
@ -86,7 +97,9 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
|
|
|
|
|
|
|
|
|
return ExpandableNotifier(
|
|
|
|
|
child: Container(
|
|
|
|
|
color: widget.widgetColor != null ? widget.widgetColor : Colors.white,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: (widget.applyBackgroundColor) ? widget.widgetColor : null,
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
if(widget.showDropDownIconWithCustomHeader == false && widget.headerWidget != null)
|
|
|
|
|
@ -103,8 +116,14 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
|
|
|
|
headerAlignment: ExpandablePanelHeaderAlignment.center,
|
|
|
|
|
tapBodyToCollapse: true,
|
|
|
|
|
),
|
|
|
|
|
header: Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 20, bottom: 20, left: 21, right: 21),
|
|
|
|
|
header: Material(
|
|
|
|
|
color: widget.applyBackgroundToOnlyHeader
|
|
|
|
|
? widget.headerColor
|
|
|
|
|
: Colors.transparent,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: widget.headerRadius ?? BorderRadius.zero),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.all(widget.paddingValue ?? 20),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
if (!widget.isDisabled)
|
|
|
|
|
@ -116,14 +135,13 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
if(widget.showDropDownIconWithCustomHeader && widget.headerWidget != null)
|
|
|
|
|
...{
|
|
|
|
|
if (widget.showDropDownIconWithCustomHeader &&
|
|
|
|
|
widget.headerWidget != null) ...{
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
child: widget.headerWidget,
|
|
|
|
|
))}
|
|
|
|
|
else
|
|
|
|
|
...{
|
|
|
|
|
))
|
|
|
|
|
} else ...{
|
|
|
|
|
//todo use the custom header to show the drop down
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
@ -135,7 +153,8 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
|
|
|
|
!widget.hasCounter
|
|
|
|
|
? Text(
|
|
|
|
|
_mainTitle,
|
|
|
|
|
style: TextStyle(fontSize: 20,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Color(0xff2E303A),
|
|
|
|
|
letterSpacing: -0.72,
|
|
|
|
|
@ -145,7 +164,8 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
_mainTitle,
|
|
|
|
|
style: TextStyle(fontSize: 20,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Color(0xff2E303A),
|
|
|
|
|
letterSpacing: -0.72,
|
|
|
|
|
@ -155,13 +175,15 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
|
|
|
|
width: 10.0,
|
|
|
|
|
),
|
|
|
|
|
CircleAvatar(
|
|
|
|
|
backgroundColor: CustomColors
|
|
|
|
|
.accentColor,
|
|
|
|
|
backgroundColor:
|
|
|
|
|
CustomColors.accentColor,
|
|
|
|
|
radius: 12.0,
|
|
|
|
|
child: Text(
|
|
|
|
|
widget.counter,
|
|
|
|
|
style: TextStyle(fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.w600,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
letterSpacing: -0.72),
|
|
|
|
|
),
|
|
|
|
|
@ -173,7 +195,8 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
|
|
|
|
Text(
|
|
|
|
|
_title,
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
style: TextStyle(fontSize: 24,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 24,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
color: Color(0xff2E303A),
|
|
|
|
|
letterSpacing: -1.44,
|
|
|
|
|
@ -184,7 +207,8 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
|
|
|
|
Text(
|
|
|
|
|
_subTitle,
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
style: TextStyle(fontSize: 14,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Color(0xff2E303A),
|
|
|
|
|
letterSpacing: -0.72,
|
|
|
|
|
@ -192,9 +216,12 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),}
|
|
|
|
|
,Icon(
|
|
|
|
|
widget.expandFlag ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
Icon(
|
|
|
|
|
widget.expandFlag
|
|
|
|
|
? Icons.keyboard_arrow_up
|
|
|
|
|
: Icons.keyboard_arrow_down,
|
|
|
|
|
color: Color(0xff2E303A),
|
|
|
|
|
// size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
@ -202,6 +229,7 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
collapsed: widget.collapsed ?? Container(),
|
|
|
|
|
expanded: widget.bodyWidget!,
|
|
|
|
|
builder: (_, collapsed, expanded) {
|
|
|
|
|
|