mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
add function
This commit is contained in:
18
lib/base/code_editor/FileEditor.dart
Normal file
18
lib/base/code_editor/FileEditor.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
/// A file in the editor, used by EditorModel [model.code].
|
||||
///
|
||||
/// * [name] is the name of the file shown in the navbar.
|
||||
/// * [language] is the language used by the theme
|
||||
/// * [code] is the content of the file, the code
|
||||
///
|
||||
/// Tip: to simplify writing code in a String,
|
||||
/// write line by line your code in a list List<String> and pass as argument list.join("\n").
|
||||
class FileEditor {
|
||||
late String name;
|
||||
String? language;
|
||||
String? code;
|
||||
FileEditor({String? name, String? language, String? code}) {
|
||||
this.name = name ?? "file.${language ?? 'txt'}";
|
||||
this.language = language ?? "text";
|
||||
this.code = code ?? "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user