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.
30 lines
1.2 KiB
Dart
30 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hmg_patient_app_new/widgets/expandable_bottom_sheet/model/BottomSheetType.dart';
|
|
|
|
class ExpandableBottomSheet extends StatelessWidget {
|
|
final BottomSheetType bottomSheetType;
|
|
final Map<BottomSheetType, Widget> children;
|
|
|
|
const ExpandableBottomSheet(
|
|
{super.key, required this.bottomSheetType, required this.children});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
print("the currently selected item is ${bottomSheetType}");
|
|
return AnimatedCrossFade(
|
|
duration: const Duration(milliseconds: 600),
|
|
firstChild:children[BottomSheetType.FIXED] ?? SizedBox.shrink(),
|
|
secondChild: children[BottomSheetType.EXPANDED] ?? const SizedBox.shrink(),
|
|
crossFadeState: BottomSheetType.FIXED == bottomSheetType ? CrossFadeState.showFirst : CrossFadeState.showSecond,
|
|
);
|
|
// switch (bottomSheetType) {
|
|
// case BottomSheetType.EXPANDED:
|
|
// return children[BottomSheetType.EXPANDED] ??
|
|
// SizedBox.shrink();
|
|
// case BottomSheetType.FIXED:
|
|
// return children[BottomSheetType.FIXED] ?? SizedBox.shrink();
|
|
// }
|
|
// return SizedBox.shrink();
|
|
}
|
|
}
|