Skip to content

Commit

Permalink
Fixed a tiny bug
Browse files Browse the repository at this point in the history
  • Loading branch information
insfirred committed Sep 14, 2022
1 parent ba5c61d commit 1ef99f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
22 changes: 0 additions & 22 deletions lib/Screens/bookmarks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,37 +58,15 @@ class _BookmarksState extends State<Bookmarks> {
},
icon: const FaIcon(FontAwesomeIcons.trash,size: 20)
),
// IconTheme(
// data: _iconTheme,
// child: IconButton(
// onPressed: () async{
// int i = await DatabaseClass.instance.delete(list[newIndex]['url']);
// displayNews();
// },
// icon: const FaIcon(FontAwesomeIcons.trash,)
// ),
// )
],
),
Text( list[newIndex]['title'] ,style: _textTheme.headline6),
const SizedBox(height: 10,),
// Text( list[newIndex]['_id'].toString() ,style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),),
// const SizedBox(height: 10,),
// Text( list[newIndex]['_description'] ,style: const TextStyle(
// color: Colors.grey[600],
// fontSize: 17)
// ),
// const SizedBox(height: 10,),

Align(
alignment: Alignment.centerRight,
child: Text(
list[newIndex]['date'],
// style: const TextStyle(
// color: Colors.grey,
// fontSize: 16,
// fontStyle: FontStyle.italic
// )
style: _textTheme.subtitle2,
),
),
Expand Down
9 changes: 7 additions & 2 deletions lib/Screens/newsList.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class _NewsListState extends State<NewsList>
}

List<Map<String,dynamic>> list = [];

Widget NewsDetails(index) {
TextTheme _textTheme = Theme.of(context).textTheme;
return Expanded(
Expand All @@ -73,12 +73,17 @@ class _NewsListState extends State<NewsList>
onTap: () async{
// Tapping on title

// print("first =$list");
list = await DatabaseClass.instance.read();
print(list);

bool isPresent = false;
for(int i=0 ; i<list.length; i++){
if(widget.jsonData["articles"][i]["url"] == widget.jsonData["articles"][index]["url"] ){
// print( "$index = ${widget.jsonData["articles"][index]["url"]}" );
// print(list[i]);
if(list[i]["url"] == widget.jsonData["articles"][index]["url"] ){
isPresent = true;
// print(isPresent);
}
}

Expand Down

0 comments on commit 1ef99f0

Please sign in to comment.