mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
improve code editor
This commit is contained in:
@@ -55,7 +55,7 @@ class _CodeEditorState extends State<CodeEditor> {
|
||||
|
||||
Widget buildLineNumbers() {
|
||||
return SizedBox(
|
||||
width: 32,
|
||||
width: 36,
|
||||
child: Column(
|
||||
children: [
|
||||
for (var i = 1; i <= lineCount; i++)
|
||||
|
@@ -298,10 +298,10 @@ class _BodyState extends State<_Body> {
|
||||
//
|
||||
}
|
||||
}
|
||||
context.to(() => _EditFilePage(source.filePath)).then((value) async {
|
||||
context.to(() => _EditFilePage(source.filePath, () async {
|
||||
await ComicSource.reload();
|
||||
setState(() {});
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
static Future<void> update(ComicSource source) async {
|
||||
@@ -617,10 +617,12 @@ void _addAllPagesWithComicSource(ComicSource source) {
|
||||
}
|
||||
|
||||
class _EditFilePage extends StatefulWidget {
|
||||
const _EditFilePage(this.path);
|
||||
const _EditFilePage(this.path, this.onExit);
|
||||
|
||||
final String path;
|
||||
|
||||
final void Function() onExit;
|
||||
|
||||
@override
|
||||
State<_EditFilePage> createState() => __EditFilePageState();
|
||||
}
|
||||
@@ -637,6 +639,7 @@ class __EditFilePageState extends State<_EditFilePage> {
|
||||
@override
|
||||
void dispose() {
|
||||
File(widget.path).writeAsStringSync(current);
|
||||
widget.onExit();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user