Skip to content

Commit

Permalink
fix: add missing header handling
Browse files Browse the repository at this point in the history
Signed-off-by: Krysl <[email protected]>
Krysl committed May 18, 2024
1 parent 661ba38 commit e4ed2aa
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@ pub(crate) struct ApiDartOutputSpecItem {
pub funcs: Vec<ApiDartGeneratedFunction>,
pub classes: Vec<ApiDartGeneratedClass>,
pub imports: DartBasicHeaderCode,
pub preamble: String,
pub unused_types: Vec<String>,
pub needs_freezed: bool,
}
@@ -134,6 +135,7 @@ fn generate_item(
funcs,
classes,
imports,
preamble: context.config.dart_preamble.clone(),
unused_types,
needs_freezed,
})
Original file line number Diff line number Diff line change
@@ -59,8 +59,10 @@ fn generate_end_api_text(
// TODO use relative path calculation
let path_frb_generated = "../".repeat(path_chunks_len - 2) + "frb_generated.dart";

let preamble = &item.preamble.as_str();
let mut header = DartBasicHeaderCode {
file_top: generate_code_header()
+ if !preamble.is_empty() {"\n\n"} else {""} + preamble
+ "\n\n// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import\n",
import: format!(
"

0 comments on commit e4ed2aa

Please sign in to comment.