gpt4 book ai didi

flutter - 使用Flutter向下滚动时如何隐藏带有动画的小部件

转载 作者:行者123 更新时间:2023-12-03 02:52:08 26 4
gpt4 key购买 nike

我有两个Icons Buttons的问题,如下图所示:
Icons Buttons
当我向下滚动直到另一个小部件(例如, map 或Graph)出现时,这里的问题Icons Buttons如下图所示:
result
所以我有一个想法是在向下滚动时隐藏这些按钮,在滚动带有动画的应用程序时再次显示它们,但是我不知道该怎么做。
这与下面的相关代码:

return Scaffold(
body: Stack(
alignment: AlignmentDirectional.bottomCenter,
children: [
Container(
height: double.infinity,
child: SingleChildScrollView(
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(
top: 85,
left: 10,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Text(
'Sim information',
style: TextStyle(fontWeight: FontWeight.bold),
),
DataTable(
headingRowHeight: 20,
columnSpacing: 83,
dataRowHeight: double.parse('20'),
columns: [
DataColumn(
label: Text(
'Sim operator',
style: TextStyle(color: Colors.black),
)),
DataColumn(
label: Row(
children: <Widget>[
Text(
simInfo.operator == null
? ' '
: simInfo.operator,
style: TextStyle(color: Colors.black),
),
],
),
),
],
rows: [
DataRow(cells: [
DataCell(Row(
Text('ICCID'),
],
)),
DataCell(
Text(simInfo == null ? '' : simInfo.iccid)),
]),
],
),
],
),
),
//Network provider
Padding(
padding: const EdgeInsets.only(
top: 20,
left: 10,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Text(
'Network Provider',
style: TextStyle(fontWeight: FontWeight.bold),
),
DataTable(
headingRowHeight: 20,
columnSpacing: 120,
dataRowHeight: double.parse('20'),
columns: [
DataColumn(
label: Text(
'Operator',
style: TextStyle(color: Colors.black),
)),
DataColumn(
label: Text(
simInfo == null ? '' : simInfo.operator,
style: TextStyle(color: Colors.black),
),
),
],
rows: [
DataRow(cells: [
DataCell(Row(
children: <Widget>[
Text('MCC'),
],
)),
DataCell(
Text(simInfo == null
? ''
: simInfo.mcc.toString()),
),
]),
DataRow(cells: [
DataCell(Text('MNC')),
DataCell(
Text(simInfo == null
? ''
: simInfo.mnc.toString()),
),
]),
],
),
],
),
),
//Serving Cell
Padding(
padding: const EdgeInsets.only(
top: 20,
left: 10,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Text(
'Serving Cell',
style: TextStyle(fontWeight: FontWeight.bold),
),
DataTable(
columnSpacing: 120,
headingRowHeight: 20,
dataRowHeight: double.parse('20'),
columns: [
DataColumn(
label: Text(
'Data type',
style: TextStyle(color: Colors.black),
)),
DataColumn(
label: Text(
_baseStation == null
? ''
: _baseStation.type.toString(),
style: TextStyle(color: Colors.black),
),
),
],
rows: [
DataRow(cells: [
DataCell(
Text('TYPE'),
),
DataCell(
Text(_baseStation.type.toString()),
),
]),
DataRow(cells: [
DataCell(
Text('CId'),
),
DataCell(
Text(_baseStation.cid.toString()),
),
]),
DataRow(cells: [
DataCell(
Text('TAC'),
),
DataCell(
Text(_baseStation == null
? ''
: _baseStation.tac.toString()),
),
]),
DataRow(cells: [
DataCell(
Text('PCI'),
),
DataCell(
Text(_baseStation.bsicPscPci.toString()),
),
]),
DataRow(cells: [
DataCell(
Text('LAC'),
),
DataCell(
Text(_baseStation.lac.toString()),
),
]),
DataRow(cells: [
DataCell(
Text('MCC'),
),
DataCell(
Text(_baseStation.mcc.toString()),
),
]),
DataRow(cells: [
DataCell(
Text('MNC'),
),
DataCell(
Text(_baseStation.mnc.toString()),
),
]),
]),
if (_baseStation.type == 'GSM')
Padding(
padding: const EdgeInsets.only(
left: 0,
),
child: GSMStationFields(_baseStation),
),
if (_baseStation.type == 'LTE')
Padding(
padding: const EdgeInsets.only(
left: 0,
),
child: LTEStationFields(_baseStation),
),
],
),
),
Padding(
padding: const EdgeInsets.only(top: 20),
child: SignalStrengthGraph(),
),
],
),
),
),
if (activeSlotsSize > 1)
Positioned(
bottom: 0,
child: SizedBox(
width: MediaQuery.of(context).size.width,
child: RadioBtnSim(changeSlot),
),
),
],
),
);
这是我称之为问题的小部件部分:
Padding(
padding: const EdgeInsets.only(top: 20),
child: SignalStrengthGraph(),
),
那么,还有其他解决方案或想法可以解决此问题吗?
我希望这足够清楚,有人建议我:)

最佳答案

您可以将Visibility小部件与动画一起使用,并为可见性动画提供时间。

关于flutter - 使用Flutter向下滚动时如何隐藏带有动画的小部件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63596727/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com