浏览代码

update BoxScrollView buildSlivers

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
6013134b
共有 1 个文件被更改,包括 22 次插入1 次删除
  1. 23
      com.unity.uiwidgets/Runtime/widgets/scroll_view.cs

23
com.unity.uiwidgets/Runtime/widgets/scroll_view.cs


protected override List<Widget> buildSlivers(BuildContext context) {
Widget sliver = buildChildLayout(context);
EdgeInsetsGeometry effectivePadding = padding; // no need to check MediaQuery for now.
EdgeInsetsGeometry effectivePadding = padding;
if (padding == null) {
MediaQueryData mediaQuery = MediaQuery.of(context, nullOk: true);
if (mediaQuery != null) {
EdgeInsets mediaQueryHorizontalPadding =
mediaQuery.padding.copyWith(top: 0.0f, bottom: 0.0f);
EdgeInsets mediaQueryVerticalPadding =
mediaQuery.padding.copyWith(left: 0.0f, right: 0.0f);
effectivePadding = scrollDirection == Axis.vertical
? mediaQueryVerticalPadding
: mediaQueryHorizontalPadding;
sliver = new MediaQuery(
data: mediaQuery.copyWith(
padding: scrollDirection == Axis.vertical
? mediaQueryHorizontalPadding
: mediaQueryVerticalPadding
),
child: sliver
);
}
}
if (effectivePadding != null) {
sliver = new SliverPadding(padding: effectivePadding, sliver: sliver);
}

正在加载...
取消
保存