flutter - 如何使用条形码小部件包在条形码和文本之间放置空格?
问题描述
正如您在图像中看到的那样,条形码和数据文本没有空间,我不知道如何在此条形码小部件中放置空间我正在使用条形码小部件
这是我的代码,我需要使用 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)),
),
],
);
}
}`
如果有人帮助我,我真的很感激,或者向我推荐其他可以在条码下放置空间的条码包,谢谢。
解决方案
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)),
),
],
);
}
}`
推荐阅读
- perl - 在 Tree::DAGNode 模块中使用 Walkdown 方法的问题
- c++ - 如何检查调用了哪种类型的下标运算符,左值还是右值?
- javascript - 发送图像时的PHP cors问题
- python - 当两个值都是字符串时,为什么我的 df.replace 不起作用?无法比较类型 'ndarray(dtype=object)' 和 'str'
- angular-cli - 如何从外部原理图中调用 ng add
- python - 将绘图值保存到 .dat 文件
- php - php中的数据库查询失败
- ruby - Kotlin's With,用于红宝石
- python - 为什么 mpld3 条形图显示一个 python 文件的“版本”,而不是另一个?
- c# - 通过 html 敏捷包从 wiki 获取数据