Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create notification_tile #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions lib/ui/widgets/notification_tile
Original file line number Diff line number Diff line change
@@ -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<NotificationTile> {
@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
),
),
)
],
)
],
),
);
}
}