0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VerticalDividerをRowに配置したらすべきこと.

Posted at

対処できる配置

Rowで何かしらのアイテム間にVerticalDividerを配置しているパターン。

以下のような場合だと表示されない

.dart
Row(
  children: const [
    Felxible(child: Text('Item 1')),
    VerticalDivider(),
    Flexible(child: Text('Item 1')),
  ],
)

正解はIntrinsicHeightで囲む。
何をしているかというと、このアイテムの高さを揃えるということをしている。
VerticalDividerの高さについての指定はないためこのような記法で他のアイテムと高さを揃えることを明示する必要がある。

IntrinsicHeight(
  child: Row(
    children: const [
      Felxible(child: Text('Item 1')),
      VerticalDivider(),
      Flexible(child: Text('Item 1')),
    ],
  ),
)

30分ほど時間を費やしたので記事にしました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?