From dc397ea29b5d6c2246f27f1630dfde0562564266 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Fri, 17 Jan 2020 18:21:01 +0900 Subject: [PATCH] info: padding at the sliver level, to improve overscroll feedback look --- lib/widgets/fullscreen/info/info_page.dart | 47 +++++++++++++--------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/lib/widgets/fullscreen/info/info_page.dart b/lib/widgets/fullscreen/info/info_page.dart index d59e1074c..6aaf2f8f6 100644 --- a/lib/widgets/fullscreen/info/info_page.dart +++ b/lib/widgets/fullscreen/info/info_page.dart @@ -38,6 +38,8 @@ class InfoPageState extends State { @override Widget build(BuildContext context) { + const horizontalPadding = EdgeInsets.symmetric(horizontal: 8); + return MediaQueryDataProvider( child: Scaffold( appBar: AppBar( @@ -58,15 +60,15 @@ class InfoPageState extends State { final mqViewInsetsBottom = mq.item2; final split = mqWidth > 400; - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: CustomScrollView( - slivers: [ - const SliverPadding( - padding: EdgeInsets.only(top: 8), - ), - if (split && entry.hasGps) - SliverToBoxAdapter( + return CustomScrollView( + slivers: [ + const SliverPadding( + padding: EdgeInsets.only(top: 8), + ), + if (split && entry.hasGps) + SliverPadding( + padding: horizontalPadding, + sliver: SliverToBoxAdapter( child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -75,9 +77,12 @@ class InfoPageState extends State { Expanded(child: LocationSection(entry: entry, showTitle: false)), ], ), - ) - else - SliverList( + ), + ) + else + SliverPadding( + padding: horizontalPadding, + sliver: SliverList( delegate: SliverChildListDelegate( [ BasicSection(entry: entry), @@ -85,13 +90,19 @@ class InfoPageState extends State { ], ), ), - 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), + ), + ], ); }, ),