Slide 59
Slide 59 text
Drawerが出入りする際にNavigationRailに重なってしまう
- Stackを使って無理やり解決できなくは無いが、
コードが複雑化してしまう
62
サイドメニューの実装問題
Stack(
children: [
Row(
children: [
switch (screenSize) {
ScreenSize.compact => const SizedBox.shrink(),
ScreenSize.medium => const SizedBox(
width: 80,
),
ScreenSize.expanded => const SizedBox(
width: 256,
),
},
Expanded(
child: Scaffold(
key: homeScaffoldKey,
drawer: const HomeDrawer(),
drawerEdgeDragWidth: 0,
body: child,
bottomNavigationBar: screenSize == ScreenSize.compact
? HomeNavigationBar(
currentPage: currentPage,
)
: null,
),
),
],
),
if (screenSize != ScreenSize.compact)
Row(
children: [
HomeNavigationRail(
currentPage: currentPage,
),
const Spacer(),
],
),
],
)
←NavigationRailの幅分スペースを開ける必要