Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class _ExhibitionBottomSheetState extends State<ExhibitionBottomSheet>
with SingleTickerProviderStateMixin {
double get itemBorderRadius => lerp(8, 24);
double get iconLeftBorderRadius => itemBorderRadius; //<-- Left border radius stays the same
double get iconRightBorderRadius => lerp(8, 0); //<-- Right border radius lerps to 0 instead.
@override
Widget build(BuildContext context) {
return ...
child: Stack(
children: <Widget>[
MenuButton(),
SheetHeader(
fontSize: headerFontSize,
topMargin: headerTopMargin,
),
for (Event event in events) _buildFullItem(event), //<-- Add FullItems
for (Event event in events) _buildIcon(event),
],
),
...
);
}
Widget _buildIcon(Event event) {
...
child: ClipRRect(
borderRadius: BorderRadius.horizontal(
left: Radius.circular(iconLeftBorderRadius), //<-- update border radius
right: Radius.circular(iconRightBorderRadius), //<-- update border radius
),
...
}
Widget _buildFullItem(Event event) {
int index = events.indexOf(event);
return ExpandedEventItem(
topMargin: iconTopMargin(index), //<--provide margins and height same as for icon
leftMargin: iconLeftMargin(index),
height: iconSize,
isVisible: _controller.status == AnimationStatus.completed, //<--set visibility
borderRadius: itemBorderRadius, //<-- pass border radius
title: event.title, //<-- data to be displayed
date: event.date, //<-- data to be displayed
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.