From 6aeb6f71198e2007b623282d0f4e30ec7b87324c Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Sun, 5 Jul 2020 20:48:03 +0200 Subject: [PATCH] NoteBacklinksRenderer: Add debug logs This renderer occasionally hangs, I'm not 100% sure why, and these logs will help diagnose the issue. --- lib/widgets/notes_backlinks.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/widgets/notes_backlinks.dart b/lib/widgets/notes_backlinks.dart index 469c55db..6b1561cc 100644 --- a/lib/widgets/notes_backlinks.dart +++ b/lib/widgets/notes_backlinks.dart @@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:gitjournal/core/link.dart'; +import 'package:gitjournal/utils/logger.dart'; import 'package:gitjournal/widgets/pro_overlay.dart'; import 'package:path/path.dart' as p; @@ -35,6 +36,8 @@ class _NoteBacklinkRendererState extends State { Future _initStateAsync() async { var predicate = (Note n) async { + Log.d("NoteBacklinkRenderer Predicate", props: {"filePath": n.filePath}); + var links = await n.fetchLinks(); var matchedLink = links.firstWhere( (l) { @@ -48,6 +51,8 @@ class _NoteBacklinkRendererState extends State { }, orElse: () => null, ); + + Log.d("NoteBacklinkRenderer Predicate ${matchedLink != null}"); return matchedLink != null; };