欢迎光临
我们一直在努力

The color argument is just a shorthand for “decoration: new BoxDecoration(color: color)”.

发现如下错误

I/flutter ( 6251): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞════
I/flutter ( 6251): The following assertion was thrown building MemberPage(dirty, state: _MemberPageState#b081b):
I/flutter ( 6251): Cannot provide both a color and a decoration
I/flutter ( 6251): The color argument is just a shorthand for "decoration: new BoxDecoration(color: color)".
I/flutter ( 6251): 'package:flutter/src/widgets/container.dart': Failed assertion: line 269 pos 15: 'color == null ||
I/flutter ( 6251): decoration == null'
I/flutter ( 6251):
I/flutter ( 6251): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter ( 6251): more information in this error message to help you determine and fix the underlying cause.
I/flutter ( 6251): In either case, please report this assertion by filing a bug on GitHub:
I/flutter ( 6251):   https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter ( 6251):
I/flutter ( 6251): When the exception was thrown, this was the stack:

解决方案 将下方代码替换掉即可

Container(
   color: ThemeUtils.whiteColor,
   width: ScreenUtil().setWidth(215),
   height: ScreenUtil().setHeight(58),
   decoration: BoxDecoration(
      color: Colors.yellow,
      border: Border.all(color: Colors.black),
   ),
   child: Row( 
       children: <Widget>[
          Icon(IconFont.gerenzhuye),
          Text('个人中心')
      ],
  ),
)
Container(
   width: ScreenUtil().setWidth(215),
   height: ScreenUtil().setHeight(58),
   decoration: BoxDecoration(
      color: ThemeUtils.whiteColor,
      border: Border.all(color: Colors.black),
      borderRadius: new BorderRadius.horizontal(left: Radius.elliptical(30, 30)),
   ),
   child: Row( 
      children: <Widget>[
          Icon(IconFont.gerenzhuye),
          Text('个人中心')
      ],
   ),
)
赞(2) 打赏
未经允许不得转载:卧龙岗 » The color argument is just a shorthand for “decoration: new BoxDecoration(color: color)”.
分享到: 更多 (0)

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏