UI improvement in APKPicker

This commit is contained in:
Imran Remtulla
2022-11-07 15:32:42 -05:00
parent ed955ac6a2
commit 139f44d31d
2 changed files with 42 additions and 19 deletions

View File

@@ -96,3 +96,19 @@ showError(dynamic e, BuildContext context) {
});
}
}
String list2FriendlyString(List<String> list) {
return list.length == 2
? '${list[0]} and ${list[1]}'
: list
.asMap()
.entries
.map((e) =>
e.value +
(e.key == list.length - 1
? ''
: e.key == list.length - 2
? ', and '
: ', '))
.join('');
}