pd4d10 / git-touch

An open-source app for GitHub, GitLab, Bitbucket, Gitea, and Gitee(码云), built with Flutter
Apache License 2.0
1.56k stars 137 forks source link

Files changed screen in a PR #74

Closed shreyas1599 closed 4 years ago

shreyas1599 commented 4 years ago

Hi @pd4d10, So I'm trying to add a Files Changed Screen instead of redirecting to the web. This is an example response.

The modified text is in patch.

\n followed by + indicates an addition and similarly \n followed by - indicates deletion.

My idea is to split it on \n and every list item that starts with a + I'm thinking of wrapping with Text with green color and similarly red color for -. Is this a right approach or would you suggest an alternative way?

Also I'm unable to understand the starting portion of the patch. I know it has something to do with the line number. Take the first item of the example response @@ -313,3 +313,15.

Do you have an idea?

I'll put a list of files with a drop-down for every file which will expand to display the changes.

pd4d10 commented 4 years ago

Perhaps flutter_highlight package could do some help:

HighlightView(
  code: '', // The diff code
  language: 'diff',
)