|
|
|
@ -18,7 +18,8 @@ class AppExpandableNotifier extends StatefulWidget {
|
|
|
|
final bool isExpand;
|
|
|
|
final bool isExpand;
|
|
|
|
bool expandFlag = false;
|
|
|
|
bool expandFlag = false;
|
|
|
|
var controller = new ExpandableController();
|
|
|
|
var controller = new ExpandableController();
|
|
|
|
AppExpandableNotifier({this.headerWidget, this.bodyWidget, this.title, this.collapsed, this.isExpand = false});
|
|
|
|
bool isTitleSingleLine;
|
|
|
|
|
|
|
|
AppExpandableNotifier({this.headerWidget, this.bodyWidget, this.title, this.collapsed, this.isExpand = false, this.isTitleSingleLine = true});
|
|
|
|
|
|
|
|
|
|
|
|
_AppExpandableNotifier createState() => _AppExpandableNotifier();
|
|
|
|
_AppExpandableNotifier createState() => _AppExpandableNotifier();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -48,6 +49,8 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
|
|
|
_subTitle = _subTitle.toLowerCase().capitalizeFirstofEach;
|
|
|
|
_subTitle = _subTitle.toLowerCase().capitalizeFirstofEach;
|
|
|
|
_title = _title.toLowerCase().capitalizeFirstofEach;
|
|
|
|
_title = _title.toLowerCase().capitalizeFirstofEach;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
print("_title:$_title");
|
|
|
|
|
|
|
|
print("_subTitle:$_subTitle");
|
|
|
|
return ExpandableNotifier(
|
|
|
|
return ExpandableNotifier(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
@ -66,7 +69,7 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
|
|
|
header: Padding(
|
|
|
|
header: Padding(
|
|
|
|
padding: const EdgeInsets.only(top: 12, bottom: 12, left: 21, right: 21),
|
|
|
|
padding: const EdgeInsets.only(top: 12, bottom: 12, left: 21, right: 21),
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: (){
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
widget.expandFlag = !widget.expandFlag;
|
|
|
|
widget.expandFlag = !widget.expandFlag;
|
|
|
|
widget.controller.expanded = widget.expandFlag;
|
|
|
|
widget.controller.expanded = widget.expandFlag;
|
|
|
|
@ -80,16 +83,23 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
if (_mainTitle.isNotEmpty)
|
|
|
|
if (_mainTitle.isNotEmpty && widget.isTitleSingleLine)
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
_mainTitle,
|
|
|
|
_mainTitle,
|
|
|
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1),
|
|
|
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// Text(
|
|
|
|
if (_title.isNotEmpty && !widget.isTitleSingleLine)
|
|
|
|
// _subTitle,
|
|
|
|
Text(
|
|
|
|
// maxLines: 1,
|
|
|
|
_title,
|
|
|
|
// style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24),
|
|
|
|
maxLines: 1,
|
|
|
|
// ),
|
|
|
|
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (_subTitle.isNotEmpty && !widget.isTitleSingleLine)
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
_subTitle,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 23 / 12),
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|