【问题标题】:How to plot a list of cards with images and text in flutter如何在颤动中绘制带有图像和文本的卡片列表
【发布时间】:2021-04-18 15:45:09
【问题描述】:

如何根据卡片索引打印带有图像和文本段落的卡片列表?这意味着假设我有一个通知页面,我必须以卡片列表格式显示即将到来的通知。如果我有生日通知,那么我必须向用户显示生日照片以及生日文本。 如果我有提醒,那么我必须在卡片中显示带有日历照片的提醒文本,就像这样

【问题讨论】:

标签: android flutter listview android-image card


【解决方案1】:

这是一个你想要的列表类,只需根据你的逻辑更改图标

class NotificationListTile extends StatelessWidget {
  
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          iconTheme: IconThemeData(color: kTextColor),
          title: Text(
            'Notifications',
            style:
            TextStyle(fontFamily: 'Poppins-regular', color: kTextColor),
          ),
          backgroundColor: kPrimaryLightColor,
        ),
        body: ListView(
          children: <Widget>[
            ListTile(
              title: Text("this is title"),
              subtitle: Text("this is subtitle"),
              leading: CircleAvatar(child: Icon(Icons.account_box)),
            ),
            ListTile(
              title: Text("this is title"),
              subtitle: Text("this is subtitle"),
              leading: CircleAvatar(child: Icon(Icons.account_box)),
            ),
            ListTile(
              title: Text("this is title"),
              subtitle: Text("this is subtitle"),
              leading: CircleAvatar(child: Icon(Icons.account_box)),
            )
          ],
        ),
      ),
    );
  }
}

【讨论】:

    猜你喜欢
    • 2019-08-30
    • 2019-06-26
    • 2021-10-20
    • 2021-02-27
    • 1970-01-01
    • 2018-10-22
    • 1970-01-01
    • 2020-09-29
    • 2020-10-18
    相关资源
    最近更新 更多