Lint all files

This commit is contained in:
Imran Remtulla
2025-06-13 16:53:36 -04:00
parent 5f971dcddb
commit e0c69b9cf4
42 changed files with 6864 additions and 5334 deletions

View File

@@ -14,11 +14,15 @@ class GitHubStars implements MassAppUrlSource {
late List<String> requiredArgs = [tr('uname')];
Future<Map<String, List<String>>> getOnePageOfUserStarredUrlsWithDescriptions(
String username, int page) async {
String username,
int page,
) async {
Response res = await get(
Uri.parse(
'https://api.github.com/users/$username/starred?per_page=100&page=$page'),
headers: await GitHub().getRequestHeaders({}));
Uri.parse(
'https://api.github.com/users/$username/starred?per_page=100&page=$page',
),
headers: await GitHub().getRequestHeaders({}),
);
if (res.statusCode == 200) {
Map<String, List<String>> urlsWithDescriptions = {};
for (var e in (jsonDecode(res.body) as List<dynamic>)) {
@@ -27,8 +31,8 @@ class GitHubStars implements MassAppUrlSource {
e['full_name'] as String,
e['description'] != null
? e['description'] as String
: tr('noDescription')
]
: tr('noDescription'),
],
});
}
return urlsWithDescriptions;
@@ -41,15 +45,18 @@ class GitHubStars implements MassAppUrlSource {
@override
Future<Map<String, List<String>>> getUrlsWithDescriptions(
List<String> args) async {
List<String> args,
) async {
if (args.length != requiredArgs.length) {
throw ObtainiumError(tr('wrongArgNum'));
}
Map<String, List<String>> urlsWithDescriptions = {};
var page = 1;
while (true) {
var pageUrls =
await getOnePageOfUserStarredUrlsWithDescriptions(args[0], page++);
var pageUrls = await getOnePageOfUserStarredUrlsWithDescriptions(
args[0],
page++,
);
urlsWithDescriptions.addAll(pageUrls);
if (pageUrls.length < 100) {
break;