album: improved bottom insets handling
This commit is contained in:
parent
8c57970947
commit
a25f81f359
1 changed files with 22 additions and 10 deletions
|
@ -30,13 +30,10 @@ class ThumbnailCollection extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
}
|
||||
final bottomInsets = MediaQuery.of(context).viewInsets.bottom;
|
||||
final sectionKeys = sections.keys.toList();
|
||||
return SafeArea(
|
||||
child: DraggableScrollbar.arrows(
|
||||
labelTextBuilder: (double offset) => Text(
|
||||
"${offset ~/ 1}",
|
||||
style: TextStyle(color: Colors.blueGrey),
|
||||
),
|
||||
controller: scrollController,
|
||||
child: CustomScrollView(
|
||||
controller: scrollController,
|
||||
slivers: [
|
||||
|
@ -44,13 +41,28 @@ class ThumbnailCollection extends StatelessWidget {
|
|||
title: Text('Aves - All'),
|
||||
floating: true,
|
||||
),
|
||||
...sections.keys.map((sectionKey) => SectionSliver(
|
||||
...sectionKeys.map((sectionKey) {
|
||||
Widget sliver = SectionSliver(
|
||||
entries: entries,
|
||||
sections: sections,
|
||||
sectionKey: sectionKey,
|
||||
)),
|
||||
);
|
||||
if (sectionKey == sectionKeys.last) {
|
||||
sliver = SliverPadding(
|
||||
padding: EdgeInsets.only(bottom: bottomInsets),
|
||||
sliver: sliver,
|
||||
);
|
||||
}
|
||||
return sliver;
|
||||
}),
|
||||
],
|
||||
),
|
||||
controller: scrollController,
|
||||
padding: EdgeInsets.only(bottom: bottomInsets),
|
||||
labelTextBuilder: (double offset) => Text(
|
||||
"${offset ~/ 1}",
|
||||
style: TextStyle(color: Colors.blueGrey),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue