Flutter IllegalFloatingActionButtonSizeException浮动操作按钮必须是圆形

Flutter IllegalFloatingActionButtonSizeException浮动操作按钮必须是圆形,flutter,dart,widget,floating-action-button,Flutter,Dart,Widget,Floating Action Button,我得到以下错误: IllegalFloatingActionButtonSizeException:浮动操作按钮必须 是一个圆形文件“圆形切口”和“切角器.省道”,第25行, 在CircularNotchedCorneredRectangleClipper.getClip文件中 “proxy_box.dart”,第1314行,在\u rendercutostomclip.\u updateClip文件中 RenderPhysicalShape.paint文件中的第1935行“proxy_box.

我得到以下错误:

IllegalFloatingActionButtonSizeException:浮动操作按钮必须 是一个圆形文件“圆形切口”和“切角器.省道”,第25行, 在CircularNotchedCorneredRectangleClipper.getClip文件中 “proxy_box.dart”,第1314行,在\u rendercutostomclip.\u updateClip文件中 RenderPhysicalShape.paint文件中的第1935行“proxy_box.dart” RenderObject中的第2311行“object.dart.\u paintWithContext文件 “object.dart”,第189行,在PaintingContext.paintChild文件中 RenderBoxExcontainerDefaultSmixin.defaultPaint中的第2826行“box.dart” 文件“custom_layout.dart”,第407行,在 RenderCustomMultiChildLayoutBox.paint文件“object.dart”,第2311行, 在RenderObject中。使用上下文文件“object.dart”绘制,第189行,在 PaintingContext.paintChild文件“proxy_box.dart”,第131行,在 RenderProxyBoxMixin.paint文件“material.dart”,第555行,中 _RenderInkFeatures.paint文件“object.dart”,第2311行,在RenderObject中。\u使用上下文文件“object.dart”,第189行,在 PaintingContext.paintChild文件“proxy_box.dart”,第131行,在 RenderProxyBoxMixin.paint文件“object.dart”,第396行,在中 PaintingContext.pushLayer文件“proxy_box.dart”,第1862行,在 RenderPhysicalModel.paint文件“object.dart”,第2311行,中 RenderObject.\u使用上下文文件“object.dart”绘制,第189行,在 PaintingContext.paintChild文件“proxy_box.dart”,第131行,在 RenderProxyBoxMixin.paint文件“object.dart”,第2311行,在中 RenderObject.\u使用上下文文件“object.dart”绘制,第189行,在 PaintingContext.paintChild文件“proxy_box.dart”,第131行,在 RenderProxyBoxMixin.paint文件“object.dart”,第2311行,在中 RenderObject.\u使用上下文文件“object.dart”绘制,第189行,在 PaintingContext.paintChild文件“proxy_box.dart”,第131行,在 RenderProxyBoxMixin.paint文件“object.dart”,第2311行,在中 RenderObject.\u使用上下文文件“object.dart”绘制,第140行,在 PaintingContext.\u重新绘制合成子文件“object.dart”,第行 100,在PaintingContext.repaincompositedchild文件“object.dart”中, 第978行,在PipelineOwner.flushPaint文件“binding.dart”的第438行中, 在RenderBinding.drawFrame文件“binding.dart”中,第914行,在 WidgetsBinding.drawFrame文件“binding.dart”,第302行,中 RenderBinding.\u handlePersistentFrameCallback文件“binding.dart”, 第1117行,在SchedulerBinding中。\u调用远程回调文件 SchedulerBinding.handleDrawFrame文件中的第1055行“binding.dart” “binding.dart”,第971行,在SchedulerBinding.\u handleDrawFrame文件中 “zone.dart”,第1190行,在根运行文件“zone.dart”中,第1093行,在 _CustomZone.run文件“zone.dart”,第997行,在\u CustomZone.runguard文件“hooks.dart”中,第251行,在\u调用文件“hooks.dart”中,第209行,在\u并条机中

我想可能与设备类型有关,但我不确定。这里是我看到错误的设备之一:

品牌:“三星”,设备:“皇冠”,型号:“SM-N960F”

有关守则:

import'package:animated_bottom_navigation_bar/animated_bottom_navigation_bar.dart';
AnimationController _AnimationController;
动画;
@凌驾
void initState(){
_animationController=animationController(
持续时间:持续时间(秒数:1),
vsync:这个,,
);
曲线化曲线=曲线化(
父项:_animationController,
曲线:区间(
0.5,
1.0,
曲线:Curves.FastOutSwowin,
),
);
动画=吐温(
开始:0,
完:1,,
).制作(曲线)动画;
WidgetsBinding.instance.addPostFrameCallback(
(_) {
_handleInternetConnection();
推迟(
持续时间(秒:1),
() {
如果(已安装)u animationController.forward();
},
);
},
);
super.initState();
}
...
floatingActionButton:(_currentIndex!=3&&showFAB)
? 刻度转换(
比例:动画,
子:浮动操作按钮(
立面图:8,
前底色:颜色。白色,
子:图标(
_currentIndex==0
?图标。编辑
:Icons.face_修饰_natural,
尺码:36,
),
按下时:()=>\u当前索引==0
?NewStory.show(上下文,空)
:NewMood.show(上下文,null),
),
)
:null,
浮动操作按钮位置:
浮动ActionButtonLocation.centerDocked,
底部导航栏:动画底部导航栏(
图标:allDestinations()
.map((导航选项目标)=>destination.icon)
.toList(),
activeColor:Colors.white,
splashColor:Theme.of(context).primaryColor,
activeIndex:\u currentIndex,
gapLocation:gapLocation.center,
不活动颜色:颜色。白色60,
非动画:动画,
背景色:主题。背景色,
notchSmoothness:notchSmoothness.softEdge,
onTap:(索引)=>setState(()=>_currentIndex=index),
),
),

首先,尝试使用最新版本的库和flatter运行它。如果它仍然存在,请告诉我。我不能复制它,所以如果你可以这样做,请给一个最小的可复制的样品

第二,关于“我想它可能与设备类型有关,但我不确定。”,它可能与设备无关,因为颤振是跨平台的,您的代码似乎与本机代码无关

第三,尝试使用“二进制搜索调试”技术。例如,尝试从AnimatedBottomNavigationBar()中删除所有参数,并查看其是否有效。如果是,请添加一些参数并重试。如果再次工作,请添加更多参数