mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
19 lines
633 B
Dart
19 lines
633 B
Dart
/// 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 ?? "";
|
|
}
|
|
}
|