我正在使用openContainer动画化FAB到视图/屏幕的过渡-但是,工厂周围似乎有一个盒子。我该如何删除呢?
OpenContainer(
transitionDuration: Duration(milliseconds: 1000),
closedBuilder: (BuildContext c, VoidCallback action) =>
FloatingActionButton(
elevation: 10,
backgroundColor: Colors.pink,
onPressed: () {
action();
},
child: Icon(Icons.add),
),
openBuilder: (BuildContext c, VoidCallback action) {
return MyScreen();
},
tappable: false,
));
答案 0 :(得分:2)
我遇到了同样的问题并找到了解决方案。这是删除框的替代方法-从动画github存储库中的example之后:
OpenContainer(
transitionDuration: Duration(milliseconds: 1000),
closedColor: Colors.pink,
closedBuilder: (BuildContext c, VoidCallback action){
return SizedBox(
height: 56,
width: 56,
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
),
),
);
}
openBuilder: (BuildContext c, VoidCallback action) {
return MyScreen();
},
tappable: false,
closedElevation: 6.0,
closedShape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(56 / 2),
),
),
);