opt.: use ValueBuilder

This commit is contained in:
lollipopkit
2023-06-05 16:39:54 +08:00
parent 88cc6542a9
commit d66e570e01
13 changed files with 264 additions and 191 deletions

View File

@@ -87,6 +87,10 @@ class _EditorPageState extends State<EditorPage> with AfterLayoutMixin {
child: CodeField(
focusNode: _focusNode,
controller: _controller,
lineNumberStyle: const LineNumberStyle(
width: 47,
margin: 7,
),
),
),
),
@@ -104,9 +108,7 @@ class _EditorPageState extends State<EditorPage> with AfterLayoutMixin {
if (widget.path != null) {
await Future.delayed(const Duration(milliseconds: 233));
final code = await File(widget.path!).readAsString();
setState(() {
_controller.text = code;
});
_controller.text = code;
}
}
}