info: padding at the sliver level, to improve overscroll feedback look

This commit is contained in:
Thibault Deckers 2020-01-17 18:21:01 +09:00
parent f5f13527fa
commit dc397ea29b

View file

@ -38,6 +38,8 @@ class InfoPageState extends State<InfoPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
const horizontalPadding = EdgeInsets.symmetric(horizontal: 8);
return MediaQueryDataProvider( return MediaQueryDataProvider(
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
@ -58,15 +60,15 @@ class InfoPageState extends State<InfoPage> {
final mqViewInsetsBottom = mq.item2; final mqViewInsetsBottom = mq.item2;
final split = mqWidth > 400; final split = mqWidth > 400;
return Padding( return CustomScrollView(
padding: const EdgeInsets.symmetric(horizontal: 8), slivers: [
child: CustomScrollView( const SliverPadding(
slivers: [ padding: EdgeInsets.only(top: 8),
const SliverPadding( ),
padding: EdgeInsets.only(top: 8), if (split && entry.hasGps)
), SliverPadding(
if (split && entry.hasGps) padding: horizontalPadding,
SliverToBoxAdapter( sliver: SliverToBoxAdapter(
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -75,9 +77,12 @@ class InfoPageState extends State<InfoPage> {
Expanded(child: LocationSection(entry: entry, showTitle: false)), Expanded(child: LocationSection(entry: entry, showTitle: false)),
], ],
), ),
) ),
else )
SliverList( else
SliverPadding(
padding: horizontalPadding,
sliver: SliverList(
delegate: SliverChildListDelegate( delegate: SliverChildListDelegate(
[ [
BasicSection(entry: entry), BasicSection(entry: entry),
@ -85,13 +90,19 @@ class InfoPageState extends State<InfoPage> {
], ],
), ),
), ),
XmpTagSectionSliver(collection: widget.collection, entry: entry),
MetadataSectionSliver(entry: entry, columnCount: split ? 2 : 1),
SliverPadding(
padding: EdgeInsets.only(bottom: 8 + mqViewInsetsBottom),
), ),
], SliverPadding(
), padding: horizontalPadding,
sliver: XmpTagSectionSliver(collection: widget.collection, entry: entry),
),
SliverPadding(
padding: horizontalPadding,
sliver: MetadataSectionSliver(entry: entry, columnCount: split ? 2 : 1),
),
SliverPadding(
padding: EdgeInsets.only(bottom: 8 + mqViewInsetsBottom),
),
],
); );
}, },
), ),