add function

This commit is contained in:
jyuesong
2022-01-17 14:21:41 +08:00
parent 96b9d720a5
commit c7b98a04db
23 changed files with 807 additions and 105 deletions

View 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 ?? "";
}
}