From 2b8b06b3d2abef26cff885aa3f353129d7369606 Mon Sep 17 00:00:00 2001 From: Chen Peng Date: Sun, 24 Sep 2023 15:12:59 +0800 Subject: [PATCH] Note.child bug --- note/lib/src/navigator_v2.dart | 8 ++-- note/lib/src/note_core.dart | 1 + spaces/flutter_note/lib/notes.g.dart | 2 +- .../zdraft/adaptive_navigation/note.g.dart | 41 +++++++++++++++++++ .../note.dart | 4 +- .../zdraft/readable_html_vs_dart/note.g.dart | 41 +++++++++++++++++++ spaces/flutter_note/pubspec.yaml | 2 +- 7 files changed, 91 insertions(+), 8 deletions(-) create mode 100644 spaces/flutter_note/lib/notes/zdraft/adaptive_navigation/note.g.dart rename spaces/flutter_note/lib/notes/zdraft/{readable_question => readable_html_vs_dart}/note.dart (96%) create mode 100644 spaces/flutter_note/lib/notes/zdraft/readable_html_vs_dart/note.g.dart diff --git a/note/lib/src/navigator_v2.dart b/note/lib/src/navigator_v2.dart index 3287282c..55f21b82 100644 --- a/note/lib/src/navigator_v2.dart +++ b/note/lib/src/navigator_v2.dart @@ -52,7 +52,7 @@ class NavigatorV2 extends StatelessWidget { } Future push(String location) { - return _routerDelegate._push(location); + return _routerDelegate._push(Uri.parse(location)); } static RouterConfig config({required Navigable navigable}) { @@ -113,12 +113,12 @@ class _MyRouterDelegate extends RouterDelegate @override Future setNewRoutePath(RouteInformation configuration) { - _push(configuration.location ?? "/"); + _push(configuration.uri ); return SynchronousFuture(null); } - Future _push(String location) { - Screen screen = _navigable.switchTo(location); + Future _push(Uri uri) { + Screen screen = _navigable.switchTo(uri.toString()); _Page page = screen._page; //把completer的完成指责放权给各Screen后,框架需监听其完成后删除Page //并在onPopPage后 diff --git a/note/lib/src/note_core.dart b/note/lib/src/note_core.dart index 3164a367..b2fe8ea2 100644 --- a/note/lib/src/note_core.dart +++ b/note/lib/src/note_core.dart @@ -183,6 +183,7 @@ class Note { return [...parent!.topList(), this]; } + // todo bug Note? child(String path) { Note? result = this; for (var split diff --git a/spaces/flutter_note/lib/notes.g.dart b/spaces/flutter_note/lib/notes.g.dart index c9adc673..47098113 100644 --- a/spaces/flutter_note/lib/notes.g.dart +++ b/spaces/flutter_note/lib/notes.g.dart @@ -265,7 +265,7 @@ abstract class BaseNotes { builder: await zdraft_components_bar_.loadLibrary().then((value) => zdraft_components_bar_.build))); final Note zdraft_readable_question = put( - "/zdraft/readable_question", + "/zdraft/readable_html_vs_dart", zdraft_readable_question_g.noteInfo(), (note) async => note.loadPage( builder: await zdraft_readable_question_.loadLibrary().then((value) => zdraft_readable_question_.build))); diff --git a/spaces/flutter_note/lib/notes/zdraft/adaptive_navigation/note.g.dart b/spaces/flutter_note/lib/notes/zdraft/adaptive_navigation/note.g.dart new file mode 100644 index 00000000..a1f954f7 --- /dev/null +++ b/spaces/flutter_note/lib/notes/zdraft/adaptive_navigation/note.g.dart @@ -0,0 +1,41 @@ +// /// Generated by gen_maters.dart, please don't edit! + +noteInfo() => ( + cells: [ + /// () + ( + cellType: 'header', + offset: 0, + end: 242, + specialNodes: <({ + String nodeType, + int end, + int offset, + })>[], + ), + + /// (print.markdown(''' # adaptive_) + ( + cellType: 'body', + offset: 242, + end: 405, + specialNodes: <({ + String nodeType, + int end, + int offset, + })>[], + ), + + /// () + ( + cellType: 'tail', + offset: 405, + end: 407, + specialNodes: <({ + String nodeType, + int end, + int offset, + })>[], + ) + ], + ); diff --git a/spaces/flutter_note/lib/notes/zdraft/readable_question/note.dart b/spaces/flutter_note/lib/notes/zdraft/readable_html_vs_dart/note.dart similarity index 96% rename from spaces/flutter_note/lib/notes/zdraft/readable_question/note.dart rename to spaces/flutter_note/lib/notes/zdraft/readable_html_vs_dart/note.dart index d3fd1b24..99ce5507 100644 --- a/spaces/flutter_note/lib/notes/zdraft/readable_question/note.dart +++ b/spaces/flutter_note/lib/notes/zdraft/readable_html_vs_dart/note.dart @@ -80,11 +80,11 @@ Scaffold( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ const Text('You have pushed the button this many times:'), - Text('$_counter', style: Theme.of(context).textTheme.headlineMedium), + Text('click cound', style: Theme.of(context).textTheme.headlineMedium), ], ), ), - floatingActionButton: FloatingActionButton(onPressed: _incrementCounter, tooltip: 'Increment', + floatingActionButton: FloatingActionButton(onPressed: (){}), tooltip: 'Increment', child: const Icon(Icons.add), ), ); diff --git a/spaces/flutter_note/lib/notes/zdraft/readable_html_vs_dart/note.g.dart b/spaces/flutter_note/lib/notes/zdraft/readable_html_vs_dart/note.g.dart new file mode 100644 index 00000000..420b5770 --- /dev/null +++ b/spaces/flutter_note/lib/notes/zdraft/readable_html_vs_dart/note.g.dart @@ -0,0 +1,41 @@ +// /// Generated by gen_maters.dart, please don't edit! + +noteInfo() => ( + cells: [ + /// () + ( + cellType: 'header', + offset: 0, + end: 114, + specialNodes: <({ + String nodeType, + int end, + int offset, + })>[], + ), + + /// (print.markdown(r''' # flutter ) + ( + cellType: 'body', + offset: 114, + end: 3006, + specialNodes: <({ + String nodeType, + int end, + int offset, + })>[], + ), + + /// () + ( + cellType: 'tail', + offset: 3006, + end: 3008, + specialNodes: <({ + String nodeType, + int end, + int offset, + })>[], + ) + ], + ); diff --git a/spaces/flutter_note/pubspec.yaml b/spaces/flutter_note/pubspec.yaml index 925aac71..d54c4fcd 100644 --- a/spaces/flutter_note/pubspec.yaml +++ b/spaces/flutter_note/pubspec.yaml @@ -112,7 +112,7 @@ flutter: - lib/notes/samples/stand_alone/button/ - lib/notes/samples/container/bar/ - lib/notes/zdraft/webview/ - - lib/notes/zdraft/readable_question/ + - lib/notes/zdraft/readable_html_vs_dart/ - lib/notes/zdraft/adaptive_navigation/ # An image asset can refer to one or more resolution-specific "variants", see