Skip to content

Commit 0a0b0f8

Browse files
authored
Merge pull request #56 from openpatch/copilot/fix-fab-button-issue
fix: prevent FAB from obscuring last list items in lesson mode
2 parents c2b80c5 + 53ecb8e commit 0a0b0f8

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

lib/features/lessons/lesson_mode_screen.dart

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,22 @@ class _LessonModeScreenState extends ConsumerState<LessonModeScreen> {
183183
}
184184
}
185185

186+
// Add extra bottom padding when the FAB is visible so the last
187+
// list item is not obscured by it.
188+
// 56dp is the standard Material extended FAB height.
189+
const kExtendedFabHeight = 56.0;
190+
final hasFab = gradeCategories.length > 1;
191+
final listPadding = hasFab
192+
? appScreenPadding.copyWith(
193+
bottom: appScreenPadding.bottom +
194+
kFloatingActionButtonMargin +
195+
kExtendedFabHeight,
196+
)
197+
: appScreenPadding;
198+
186199
return ContentConstraints(
187200
child: ListView(
188-
padding: appScreenPadding,
201+
padding: listPadding,
189202
children: [
190203
LessonContextCard(
191204
sessionController: _sessionController,

0 commit comments

Comments
 (0)