首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在颤动中绘制带有图像和文本的卡片列表

如何在颤动中绘制带有图像和文本的卡片列表
EN

Stack Overflow用户
提问于 2021-01-13 23:42:11
回答 1查看 185关注 0票数 0

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

EN

回答 1

Stack Overflow用户

发布于 2021-01-14 01:51:30

这是一个你想要的list类,只需根据你的逻辑改变图标即可

代码语言:javascript
复制
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)),
            )
          ],
        ),
      ),
    );
  }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65705157

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档