Closed y129may9th closed 1 year ago
PageViewではなくListViewを横にスライドしていくのはどうでしょうか?
SizedBox(
height: 195,
child: ListView(
scrollDirection: Axis.horizontal,
children: articleList
.map(
(item) => ArticleCard(
imagePath: item['imagePath'],
title: item['title'],
timestamp: item['timestamp'],
width: MediaQuery.of(context).size.width * 0.4,
),
)
.toList(),
),
),
class ArticleCard extends StatelessWidget {
const ArticleCard(
{super.key,
required this.imagePath,
required this.title,
required this.timestamp,
this.onPressed, // TODO: 遷移の実装はまだです
required this.width});
final String imagePath;
final String title;
final String timestamp;
final VoidCallback? onPressed;
final double width;
@override
Widget build(BuildContext context) {
return Card(
elevation: 0.1,
child: SizedBox(
width: width,
child: Padding(
padding: const EdgeInsets.only(
right: 9.5, left: 9.5, top: 9.6, bottom: 7.7),
こんな感じにしして、ArticleCardに幅を指定して見るのはどうでしょう? ただこの方法だとPageViewみたいにコンテンツを見やすいように止めてくれないのでちょっと検討かもしれません... 実現したいニュアンスと違いましたら申し訳ありません!
放置しちゃっていてごめんなさい! 🙏 今から見ますね!
https://github.com/Mayumi-Nakabayashi/withTone/pull/40#issuecomment-1714046723 @ken-ty いえいえー!ありがとうございます!ちょうどいま ListView の修正試しているとこでしたので、明日とかでも大丈夫ですので〜🙏🏻 また修正後のレビュー依頼を Slack で投げます!
全然後で対応すれば良いんですが、タグが多いと突き抜けてレンダリングエラーが発生しますね。
TextOverflow.ellipsis
などで解決しそうです。
次PR以降でフローティングボタンを配置した時、画面下半分のリストの見え方が気になりました。 このPRマージした後の定例MTGとかに @Mayumi-Nakabayashi とデザインの確認できればと 🙏 (今回の修正する箇所の指摘ではないです)
@ken-ty 承知いたしました!
https://github.com/Mayumi-Nakabayashi/withTone/pull/40#issuecomment-1714728513
@ken-ty
ありがとうございます!TextOverflow.ellipsis
で対応しました! fbd5acb
before | after |
---|---|
https://github.com/Mayumi-Nakabayashi/withTone/pull/40#issuecomment-1714731509
次PR以降でフローティングボタンを配置した時、画面下半分のリストの見え方が気になりました。
@ken-ty たしかにですね〜ありがとうございます!
@Mayumi-Nakabayashi ちょっとボタン配置したバージョンを作ってみますので、それ見ながらご相談させてください!
@y129may9th 承知いたしました、ありがとう〜!
https://github.com/Mayumi-Nakabayashi/withTone/pull/40#issuecomment-1709350425 @sodateya アドバイスありがとうございましたー!ListView でできました🙌🏻 ede9216
みんなとのやりとり見てるだけで勉強になるわー! コメントのやりとりパクりまーす!笑
FIgma
やったこと
learning community home
へのカードリスト部分やっていないこと
みてほしいです
viewportFraction
プロパティでカードが画面に占める割合を指定しています。記事カードの width を指定できず、こちらの割合で調整してます。他の方法があれば教えてください🙏🏻 cf.キャプチャ
メモ