Flutter 如何使用条形码小部件包在条形码和文本之间留出空间?

Flutter 如何使用条形码小部件包在条形码和文本之间留出空间?,flutter,dart,barcode,Flutter,Dart,Barcode,正如您在图像中看到的,条形码和数据文本没有空间,我不知道如何在我使用的这个条形码小部件中放置空间 这是我的代码和im需要使用代码39类型的条形码 class Barcode extends StatelessWidget { @override Widget build(BuildContext context) { return Column( children: [ BarcodeWidget( barcode: Barcode.code39(),

正如您在图像中看到的,条形码和数据文本没有空间,我不知道如何在我使用的这个条形码小部件中放置空间

这是我的代码和im需要使用代码39类型的条形码

class Barcode extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
  return Column(
  children: [
    BarcodeWidget(
      barcode: Barcode.code39(),
      data: '0912658792',
      width: size(480),
      height: size(120),
      margin: EdgeInsets.only(
        bottom: size(60),
      ),
    ),
    BarcodeWidget(
      barcode: Barcode.code39(),
      data: '195795296',
      width: size(480),
      height: size(120),
      margin: EdgeInsets.only(bottom: size(60)),
    ),
    BarcodeWidget(
      barcode: Barcode.code39(),
      data: '4952687794',
      width: size(480),
      height: size(120),
      margin: EdgeInsets.only(bottom: size(60)),
    ),
  ],
);
}
}`

如果有人帮助我,或者向我推荐其他可以在条形码下留出空间的条形码软件包,我真的很感激。谢谢。

您可以在不同的BarcodeWidget实例之间使用大小框

Use This:    

class Barcode extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
      return Column(
      children: [
        BarcodeWidget(
          barcode: Barcode.code39(),
          data: '\n 0912658792',
          width: size(480),
          height: size(120),
          margin: EdgeInsets.only(
            bottom: size(60),
            top: size(60)
          ),
        ),
        BarcodeWidget(
          barcode: Barcode.code39(),
          data: '\n 195795296',
          width: size(480),
          height: size(120),
          margin: EdgeInsets.only(bottom: size(60),top: size(60)),
        ),
        BarcodeWidget(
          barcode: Barcode.code39(),
          data: '\n 4952687794',
          width: size(480),
          height: size(120),
          margin: EdgeInsets.only(bottom: size(60),top: size(60)),
        ),
      ],
    );
    }
    }`
... (your earlier code here)
...
children: [
    BarcodeWidget(
      barcode: Barcode.code39(),
      data: '0912658792',
      width: size(480),
      height: size(120),
      margin: EdgeInsets.only(
        bottom: size(60),
      ),
    ),
    SizedBox(
      height: 40,
    ),
    BarcodeWidget(
      barcode: Barcode.code39(),
      data: '195795296',
      width: size(480),
      height: size(120),
      margin: EdgeInsets.only(bottom: size(60)),
    ),
...
...

我找到了答案

 BarcodeWidget(
  barcode: Barcode.code39(),
  data: '195795296',
  width: size(480),
  height: size(120),
  margin: EdgeInsets.only(bottom: size(60)),
  style: TextStyle(height: 2.0),
),

添加样式和高度以获得我想要的空间

否,我想要的是条形码和条形码下数据之间的空间,而不是每个条形码之间的空间,这可能是条形码规范的一部分,如果不使标准无效,则无法更改。此页边距仅适用于整个条形码小部件而不是文本小部件,因此如果我使用此页边距,条形码下的条形码和数据文本将不会更改确定然后执行:数据:'\n 4952687794',我还编辑了我的答案,请检查此答案