diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b1644d2..ca711fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,8 +3,8 @@ on: push env: # Keep this in sync with the version used by FlutterFlow. - DART_VERSION: 3.6.1 - FLUTTER_VERSION: 3.27.3 + DART_VERSION: 3.8.1 + FLUTTER_VERSION: 3.32.4 jobs: check: diff --git a/CHANGELOG.md b/CHANGELOG.md index c06fb4c..5e3b40e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.29 + +- Add support for download_url. + ## 0.0.28 - Update path version. diff --git a/lib/src/flutterflow_api_client.dart b/lib/src/flutterflow_api_client.dart index fa3762d..cfc52c0 100644 --- a/lib/src/flutterflow_api_client.dart +++ b/lib/src/flutterflow_api_client.dart @@ -103,7 +103,16 @@ Future exportCode({ exportAsDebug: exportAsDebug, ); // Download actual code - final projectZipBytes = base64Decode(result['project_zip']); + final List projectZipBytes; + if (result['download_url'] != null) { + final response = await client.get(Uri.parse(result['download_url'])); + if (response.statusCode != 200) { + throw 'Failed to download project zip from URL: ${response.statusCode}'; + } + projectZipBytes = response.bodyBytes; + } else { + projectZipBytes = base64Decode(result['project_zip']); + } final projectFolder = ZipDecoder().decodeBytes(projectZipBytes); extractArchiveTo(projectFolder, destinationPath, unzipToParentFolder); diff --git a/pubspec.yaml b/pubspec.yaml index b98ecb4..f40f16f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: flutterflow_cli description: >- Command-line client for FlutterFlow. Export code from FlutterFlow projects. -version: 0.0.28 +version: 0.0.29 homepage: https://github.com/FlutterFlow/flutterflow-cli issue_tracker: https://github.com/flutterflow/flutterflow-issues diff --git a/test/integration_test.dart b/test/integration_test.dart index 46075a0..b20a1d8 100644 --- a/test/integration_test.dart +++ b/test/integration_test.dart @@ -12,6 +12,10 @@ Future buildProject(String project) async { var result = await Process.run('flutter', ['build', 'web'], workingDirectory: p.normalize(project), runInShell: true); + if (result.exitCode != 0) { + stderr.writeln(result.stderr); + } + return result.exitCode == 0; }