feat: add oauth2 ui and authorzation code grant handling

This commit is contained in:
Udhay-Adithya
2025-07-20 23:07:58 +05:30
parent 4453ac1b2a
commit fd4b05663c
13 changed files with 1039 additions and 15 deletions

View File

@@ -34,6 +34,18 @@ Future<String?> getFileDownloadpath(String? name, String? ext) async {
return null;
}
Future<String?> getTempFilePath(String? name, String? ext) async {
final Directory tempDir = await getApplicationCacheDirectory();
name = name ?? getTempFileName();
ext = (ext != null) ? ".$ext" : "";
String path = '${tempDir.path}/$name$ext';
int num = 1;
while (await File(path).exists()) {
path = '${tempDir.path}/$name (${num++})$ext';
}
return path;
}
Future<void> saveFile(String path, Uint8List content) async {
final file = File(path);
await file.writeAsBytes(content);