我有一個頁面可以顯示我的體重。問題是現在我在串列中顯示毛重,包裝,凈重。我想在一行中標記它們。這是我的代碼:
SettingsSection(
title: 'Weight',
tiles: [
SettingsTile(
leading: FaIcon(FontAwesomeIcons.weightHanging),
title: 'Gross',
subtitle: '490000',
subtitleTextStyle:TextStyle(fontSize: 17.0, fontWeight: FontWeight.bold, color: Colors.black)
),
SettingsTile(
leading: FaIcon(FontAwesomeIcons.weightHanging),
title: 'Packaging',
subtitle: '19000',
subtitleTextStyle:TextStyle(fontSize: 17.0, fontWeight: FontWeight.bold, color: Colors.black)
),
SettingsTile(
leading: FaIcon(FontAwesomeIcons.weightHanging),
title: 'Net',
subtitle: '30000',
subtitleTextStyle:TextStyle(fontSize: 17.0, fontWeight: FontWeight.bold, color: Colors.black)
),
SettingsTile(
leading: FaIcon(FontAwesomeIcons.weightHanging),
title: 'Gross' ' ' 'Packaging' ' ' 'Net',
subtitle: '490000' ' ' '19000' ' ' '30000',
subtitleTextStyle:TextStyle(fontSize: 17.0, fontWeight: FontWeight.bold, color: Colors.black)
),
],
),
此代碼顯示了我如何顯示重量(前 3 個條目)。但我想在一行中顯示它,就像在上一個版本中一樣。但問題是,當權重發生變化(符號的數量)時,一切都開始移動并看起來不對勁。有沒有可能喝到什么都不動??我的形象:

uj5u.com熱心網友回復:
試試下面的代碼希望對你有幫助。
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Icon(Icons.shopping_bag),
Expanded(
child: ListTile(
title: Text('Gross'),
subtitle: Text('490000'),
),
),
Expanded(
child: ListTile(
title: Text('Packaging'),
subtitle: Text('19000'),
),
),
Expanded(
child: ListTile(
title: Text('Net'),
subtitle: Text('30000'),
),
),
],
),
您的結果螢屏-> 
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/345332.html
