0

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

4

1 回答 1

0

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

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)),
            )
          ],
        ),
      ),
    );
  }
}
于 2021-01-13T17:51:30.240 回答