首页 > 解决方案 > 如何使用条形码小部件包在条形码和文本之间放置空格?

问题描述

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

在此处输入图像描述

这是我的代码,我需要使用 code39 类型的条形码

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)),
    ),
  ],
);
}
}`

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

标签: flutterdartbarcode

解决方案


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)),
        ),
      ],
    );
    }
    }`

推荐阅读