Skip to content

Instantly share code, notes, and snippets.

@isaacadariku
Created September 26, 2023 14:42
Show Gist options
  • Save isaacadariku/2efb8f554256df066102cbae05a9047e to your computer and use it in GitHub Desktop.
Save isaacadariku/2efb8f554256df066102cbae05a9047e to your computer and use it in GitHub Desktop.
A snippet of the adaptive navigation Layout for Reflection.app
LayoutBuilder(
builder: (context, dimension) {
final isExtended = dimension.maxWidth >= 800;
final optionalFAB = Offstage(
offstage: !showFAB,
child: HomeFAB(
isExtended: isExtended,
fabWidth: isExtended ? 188 : 60,
fabHeight: 60,
),
);
// Desktop Layout
if (dimension.maxWidth >= 720) {
return Scaffold(
resizeToAvoidBottomInset: false,
body: Row(
children: [
Background(
child: ClipRRect(
borderRadius: BorderRadius.only(
topRight: Radius.circular(30),
bottomRight: Radius.circular(30),
),
child: NavigationRail(
elevation: 1,
backgroundColor:
theme.colorScheme.background.withOpacity(0.9),
extended: isExtended,
minExtendedWidth: 150,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment