diff --git a/lib/ui/widgets/notification_tile b/lib/ui/widgets/notification_tile new file mode 100644 index 0000000..27a37ec --- /dev/null +++ b/lib/ui/widgets/notification_tile @@ -0,0 +1,95 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +class NotificationTile extends StatefulWidget { + final String thumbnailURL; + final String iconURL; + final String date; + final String title; + + + NotificationTile({this.data}); + + @override + _NotificationTileState createState() => _NotificationTileState(); +} + +class _NotificationTileState extends State { + @override + Widget build(BuildContext context) { + + + List notsData= widget.data.values.toList(); + return Card( + margin: EdgeInsets.symmetric(horizontal: 10,vertical: 2), + color: Color(0xFF2d3447), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Wrap( + children: [ + Visibility( + visible: widget.thumbnailURL!="", + child: Container( + padding: EdgeInsets.all(8.0), + child: Center( + child: ClipRRect( + borderRadius: BorderRadius.circular(10.0), + child: CachedNetworkImage( + imageUrl:widget.thumbnailURL, + fit: BoxFit.cover, + progressIndicatorBuilder: (context, url, + downloadProgress) => + Center( + child: CircularProgressIndicator( + value: downloadProgress.progress), + ), + errorWidget: (context, url, error) => + Icon(Icons.error), + ) + ), + ), + ), + ), + ListTile( + leading: Visibility( + visible: widget.iconURL!="", + child: CircleAvatar( + backgroundColor: Colors.transparent, + child: CachedNetworkImage( + imageUrl: widget.iconURL, + fit: BoxFit.cover, + progressIndicatorBuilder: (context, url, + downloadProgress) => + Center( + child: CircularProgressIndicator( + value: downloadProgress.progress), + ), + errorWidget: (context, url, error) => + Icon(Icons.error), + ), + ), + ), + title: Text( + widget.title, + style: TextStyle( + color: Colors.white70, + fontSize: 17 + ), + ), + subtitle:Text( + widget.date.toString(), + style: TextStyle( + color: Colors.blue, + fontSize: 15 + ), + ), + ) + ], + ) + ], + ), + ); + } +} +