无法获取SvgPicture呈现在TableCell类中吗?

时间:2019-02-04 18:19:21

标签: dart flutter

我正在使用flutter_svg软件包。我有以下方法

TableCell makeGridCell(String name, SvgPicture picture ) { ..}

然后我调用该方法来构建我的表:

Table(
                border: TableBorder.all(width: 0, color: Colors.transparent),
                children: [
                  TableRow(
                      children: [
                        makeGridCell('Medals', SvgPicture.asset("assets/icon/username.svg",height: 30)),
                        makeGridCell('Merchandise', SvgPicture.asset('assets/icon/username.svg',height:30)),
                        makeGridCell('Upgrade', SvgPicture.asset('assets/icon/username.svg',height: 30)),
                      ]
                  ),
                  TableRow(
                      children: [
                        makeGridCell('About', SvgPicture.asset('assets/icon/ico_submenu_about.svg', height: 30,)),
                        makeGridCell('Share',SvgPicture.asset('assets/icon/username.svg',height: 30,)),
                        makeGridCell('Medals', SvgPicture.asset('assets/icon/ico_menu_home.svg', height: 50)),
                      ]
                  ),
                ]
            ),

资产路径正确,我的pubspec.yaml文件也正确。

0 个答案:

没有答案