![](/img/trans.png)
[英]How to scroll to a widget inside the SingleChildScrollView in flutter web?
[英]How to scroll a widget inside a SingleChildScrollView in Flutter?
我在 SingleChildScrollView 中有 pdf 查看器。 Pdf 查看器不会仅滚动列。 如何使 Column 能够滚动并且 pdf 也能够滚动?
return Scaffold(
appBar: AppBar(
title: const Text('Nahranie súboru'),
automaticallyImplyLeading: false,
),
body: SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
SizedBox(
child: SfPdfViewer.file(file),
height: 200,
width: double.infinity
),
const SizedBox(height: 10),
const PayRadioGroup(),
const SizedBox(height: 10),
const PayList(),
const SizedBox(height: 10),
ElevatedButton(
onPressed: () => uploadData(),
child: const Text('Odoslať Dáta'),
),
],
),
),
);
尝试不使用 pdf 的大小盒。
return Scaffold(
appBar: AppBar(
title: const Text('Nahranie súboru'),
automaticallyImplyLeading: false,
),
body: SingleChildScrollView(
child: Column(
mainAxisSize : MainAxisSize.min
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
SfPdfViewer.file(file),
const SizedBox(height: 10),
const PayRadioGroup(),
const SizedBox(height: 10),
const PayList(),
const SizedBox(height: 10),
ElevatedButton(
onPressed: () => uploadData(),
child: const Text('Odoslať Dáta'),
),
],
),
),
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.