@@ -24,6 +24,8 @@ class FlutterFlowApi {
24
24
/// * [fix] flag indicates whether to fix any issues in the exported code.
25
25
/// * [exportAsModule] flag indicates whether to export the code as a module.
26
26
/// * [format] flag indicates whether to format the exported code.
27
+ /// * [exportAsDebug] flag indicates whether to export the code as debug for
28
+ /// local run.
27
29
///
28
30
/// Returns a [Future] that completes with the path to the exported code, or
29
31
/// throws an error if the export fails.
@@ -38,6 +40,7 @@ class FlutterFlowApi {
38
40
bool fix = false ,
39
41
bool exportAsModule = false ,
40
42
bool format = true ,
43
+ bool exportAsDebug = false ,
41
44
}) =>
42
45
exportCode (
43
46
token: token,
@@ -50,6 +53,7 @@ class FlutterFlowApi {
50
53
fix: fix,
51
54
exportAsModule: exportAsModule,
52
55
format: format,
56
+ exportAsDebug: exportAsDebug,
53
57
);
54
58
}
55
59
@@ -64,7 +68,11 @@ Future<String?> exportCode({
64
68
required bool exportAsModule,
65
69
bool format = true ,
66
70
String ? branchName,
71
+ bool exportAsDebug = false ,
67
72
}) async {
73
+ if (exportAsDebug && exportAsModule) {
74
+ throw 'Cannot export as module and debug at the same time.' ;
75
+ }
68
76
final endpointUrl = Uri .parse (endpoint);
69
77
final client = http.Client ();
70
78
String ? folderName;
@@ -78,6 +86,7 @@ Future<String?> exportCode({
78
86
exportAsModule: exportAsModule,
79
87
includeAssets: includeAssets,
80
88
format: format,
89
+ exportAsDebug: exportAsDebug,
81
90
);
82
91
// Download actual code
83
92
final projectZipBytes = base64Decode (result['project_zip' ]);
@@ -150,6 +159,7 @@ Future<dynamic> _callExport({
150
159
required bool exportAsModule,
151
160
required bool includeAssets,
152
161
required bool format,
162
+ required bool exportAsDebug,
153
163
}) async {
154
164
final body = jsonEncode ({
155
165
'project' : {
@@ -159,6 +169,7 @@ Future<dynamic> _callExport({
159
169
'export_as_module' : exportAsModule,
160
170
'include_assets_map' : includeAssets,
161
171
'format' : format,
172
+ 'export_as_debug' : exportAsDebug,
162
173
});
163
174
return await _callEndpoint (
164
175
client: client,
0 commit comments