Skip to content

Commit

Permalink
Merge pull request #24 from praptisharma28/preview
Browse files Browse the repository at this point in the history
preview added
  • Loading branch information
Pavel401 authored Jan 27, 2024
2 parents b196e6c + 8c66d8b commit 2b6cceb
Show file tree
Hide file tree
Showing 4 changed files with 377 additions and 24 deletions.
104 changes: 95 additions & 9 deletions lib/views/Bookmark/bookmarks_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,109 @@ class _BookmarksScreenState extends State<BookmarksScreen> {
return Padding(
padding: EdgeInsets.symmetric(vertical: 4, horizontal: 8),
child: ListView.builder(
key: ValueKey(jobs.length),
itemCount: jobs.length,
itemBuilder: (context, index) {
JobModel job = jobs[index];
return GestureDetector(
onTap: () {
_launchURL(job.applyUrl);
},
child: Card(
child: ListTile(
trailing: IconButton(
onPressed: () {
bookmarkBloc.add(DeleteBookmark(job, context));
},
icon: Icon(Icons.delete_outline),
child: Dismissible(
key: Key(jobs[index].toString()),
background: Container(
color: Colors.red.withOpacity(0.25),
child: Icon(Icons.delete, color:Colors.red),
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 20.0),
),
secondaryBackground: Container(
color:Colors.red.withOpacity(0.25),
child: Icon(Icons.delete, color:Colors.red),
alignment: Alignment.centerRight,
padding: EdgeInsets.only(right: 20.0),
),
dismissThresholds: {
DismissDirection.endToStart : 0.25,
DismissDirection.startToEnd : 0.25,
},
onDismissed: (direction) {
if(direction == DismissDirection.horizontal){
setState(() { });
}
bookmarkBloc.add(DeleteBookmark(job, context));
},
child: Card(
elevation: 5,
shadowColor: Colors.grey.shade50,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(16),
bottomLeft: Radius.circular(16),
bottomRight: Radius.circular(6)
)
),
child: ListTile(
contentPadding: EdgeInsets.symmetric(horizontal: 12,vertical: 6),
title: Text(job.title,
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
color:Theme.of(context).brightness == Brightness.dark ?
Colors.white
:Colors.grey.shade800
),
),
leading:job.imageUrl.isEmpty
? Icon(Icons.dangerous)
: Container(
width: 70,
height: 70,
decoration: BoxDecoration(
color: Colors.blue.shade100,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(16),
bottomLeft: Radius.circular(16),
bottomRight: Radius.circular(6)
),
image:job.imageUrl != 'null' ? DecorationImage(
image: NetworkImage(job.imageUrl)
) : null
),
),
subtitle: Padding(
padding: const EdgeInsets.only(top: 2),
child: Row(
children: [
Icon(Icons.business,
size: 15,
color: Theme.of(context).brightness == Brightness.dark ?
Colors.white70
:Colors.grey.shade600
),
SizedBox(width: 6),
Text(job.company,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Theme.of(context).brightness == Brightness.dark ?
Colors.white70
:Colors.grey.shade600
)),
],
),
),
trailing: IconButton(
onPressed: () {
bookmarkBloc.add(DeleteBookmark(job, context));
},
icon: Icon(Icons.delete_outline),
),
),
title: Text(job.title),
subtitle: Text(job.company),
),
),
);
Expand Down
Loading

0 comments on commit 2b6cceb

Please sign in to comment.