diff --git a/lib/components/code.dart b/lib/components/code.dart index 11d4b13..8d18d68 100644 --- a/lib/components/code.dart +++ b/lib/components/code.dart @@ -55,7 +55,7 @@ class _CodeEditorState extends State { Widget buildLineNumbers() { return SizedBox( - width: 32, + width: 36, child: Column( children: [ for (var i = 1; i <= lineCount; i++) diff --git a/lib/pages/comic_source_page.dart b/lib/pages/comic_source_page.dart index dccc945..ff394ff 100644 --- a/lib/pages/comic_source_page.dart +++ b/lib/pages/comic_source_page.dart @@ -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 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(); }