INDEX / JOURNAL / LOG-008
VOL. 2026 · ENGINEERING
SERIES 1 / 8
LOG-008 · LAYOUT

制約は上から、サイズは下から

PUBLISHED
2026 · 07 · 31
AUTHOR
MIGIWAYA
READ
約 7 分
TAGS
#flutter#dart
▸ TERMINALTERMINAL
A RenderFlex overflowed by 42 pixels on the right.
Vertical viewport was given unbounded height.

§ 01CONSTRAINTS

§ 02FLEX

主軸交差軸
lib/widgets/product_row.dartDART
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Icon(Icons.inventory_2_outlined),
const SizedBox(width: 8),
Text(product.name),
],
)

§ 03EXPANDED

lib/widgets/product_row.dartDART
Row(
children: [
const Icon(Icons.inventory_2_outlined),
const SizedBox(width: 8),
Expanded(
child: Text(product.name, overflow: TextOverflow.ellipsis),
),
Text('¥${product.price}'),
],
)

§ 04SPACING

§ 05SCROLL

DART
Column(
children: [
const Header(),
ListView(children: items), // ここで落ちる
],
)
lib/screens/stock_list_screen.dartDART
Expanded(
child: ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) => StockTile(item: items[index]),
),
)

§ 06STACK

lib/widgets/badge_avatar.dartDART
Stack(
children: [
const Avatar(), // これが Stack のサイズを決める
Positioned(right: 0, top: 0, child: const UnreadDot()),
],
)

§ 07RESPONSIVE

DART
final width = MediaQuery.sizeOf(context).width;
lib/widgets/responsive_content.dartDART
LayoutBuilder(
builder: (context, constraints) {
return constraints.maxWidth >= 600
? const TwoColumnLayout()
: const SingleColumnLayout();
},
)

§ 08SUMMARY

脚注 · NOTES
  1. [1]
  2. [2]
  3. [3]
  4. [4]
  5. [5]
  6. [6]
同シリーズ · Flutter の基礎を実コードで学ぶ II
§ + RELATED すべて見る →
INQUIRY
CONTACT
LOCATION
STATUS
Active / Open
ESTABLISHED
2024 · 5 · 5
FORM