You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
doctor_app_flutter/lib/widgets/shared/app_expandable_notifier.dart

55 lines
1.7 KiB
Dart

import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart';
class AppExpandableNotifier extends StatelessWidget {
final Widget headerWid;
final Widget bodyWid;
AppExpandableNotifier({this.headerWid, this.bodyWid});
@override
Widget build(BuildContext context) {
return ExpandableNotifier(
child: Padding(
padding: const EdgeInsets.all(10),
child: Card(
clipBehavior: Clip.antiAlias,
child: Column(
children: <Widget>[
SizedBox(
child: headerWid,
),
ScrollOnExpand(
scrollOnExpand: true,
scrollOnCollapse: false,
child: ExpandablePanel(
theme: const ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center,
tapBodyToCollapse: true,
),
header: Padding(
padding: EdgeInsets.all(10),
child: Text(
"See Graph Details",
style: TextStyle(fontWeight: FontWeight.bold),
)),
collapsed: Text(''),
expanded: bodyWid,
builder: (_, collapsed, expanded) {
return Padding(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
child: Expandable(
collapsed: collapsed,
expanded: expanded,
theme: const ExpandableThemeData(crossFadePoint: 0),
),
);
},
),
),
],
),
),
));
}
}