Skip to content

Commit 3dc57d2

Browse files
committed
Add "format" option to FlutterFlowApi.exportCode()
1 parent 2bc976c commit 3dc57d2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/src/flutterflow_api_client.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class FlutterFlowApi {
2222
/// * [unzipToParentFolder] flag indicates whether to unzip the exported code
2323
/// to the parent folder.
2424
/// * [fix] flag indicates whether to fix any issues in the exported code.
25+
/// * [exportAsModule] flag indicates whether to export the code as a module.
26+
/// * [format] flag indicates whether to format the exported code.
2527
///
2628
/// Returns a [Future] that completes with the path to the exported code, or
2729
/// throws an error if the export fails.
@@ -35,6 +37,7 @@ class FlutterFlowApi {
3537
bool unzipToParentFolder = false,
3638
bool fix = false,
3739
bool exportAsModule = false,
40+
bool format = true,
3841
}) =>
3942
exportCode(
4043
token: token,
@@ -46,6 +49,7 @@ class FlutterFlowApi {
4649
unzipToParentFolder: unzipToParentFolder,
4750
fix: fix,
4851
exportAsModule: exportAsModule,
52+
format: format,
4953
);
5054
}
5155

@@ -58,6 +62,7 @@ Future<String?> exportCode({
5862
required bool unzipToParentFolder,
5963
required bool fix,
6064
required bool exportAsModule,
65+
bool format = true,
6166
String? branchName,
6267
}) async {
6368
final endpointUrl = Uri.parse(endpoint);
@@ -72,6 +77,7 @@ Future<String?> exportCode({
7277
branchName: branchName,
7378
exportAsModule: exportAsModule,
7479
includeAssets: includeAssets,
80+
format: format,
7581
);
7682
// Download actual code
7783
final projectZipBytes = base64Decode(result['project_zip']);
@@ -143,6 +149,7 @@ Future<dynamic> _callExport({
143149
String? branchName,
144150
required bool exportAsModule,
145151
required bool includeAssets,
152+
required bool format,
146153
}) async {
147154
final body = jsonEncode({
148155
'project': {
@@ -151,6 +158,7 @@ Future<dynamic> _callExport({
151158
if (branchName != null) 'branch_name': branchName,
152159
'export_as_module': exportAsModule,
153160
'include_assets_map': includeAssets,
161+
'format': format,
154162
});
155163
final response = await client.post(
156164
Uri.https(endpoint.host, '${endpoint.path}/exportCode'),

0 commit comments

Comments
 (0)