Started init work on source service

This commit is contained in:
Imran Remtulla
2022-08-13 13:45:25 -04:00
parent 50b23da98a
commit 7a0688d358
2 changed files with 29 additions and 0 deletions

10
lib/models.dart Normal file
View File

@ -0,0 +1,10 @@
class App {
late String id;
late String url;
String? installedVersion;
late String latestVersion;
String? readmeHTML;
String? base64Icon;
App(this.id, this.url, this.installedVersion, this.latestVersion,
this.readmeHTML, this.base64Icon);
}

View File

@ -0,0 +1,19 @@
class SourceService {
SourceService();
}
/*
- Make a function that validates and standardizes github URLs, do the same for gitlab (fail = error)
- Make a function that gets the App title and Author name from a github URL, do the same for gitlab (can't fail)
- Make a function that takes a github URL and finds the latest APK release if any (with version), do the same for gitlab (fail = error)
- Make a function that takes a github URL and returns a README HTML if any, do the same for gitlab (fail = "no description")
- Make a function that looks for the first image in a README HTML and returns a small base64 encoded version of it (fail = generic icon)
- Make a function that integrates all above and returns an App object for a given github URL, do the same for gitlab
- Make a function that detects the URL (Github or Gitlab) and runs the right function above
- Make a function that can save/load an App object to/from persistent storage (JSON file with unique App ID as file name)
- Make a function (using the above fn) that loads an array of all Apps
*/