Skip to content

Commit

Permalink
Note.child bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chen56 committed Sep 24, 2023
1 parent fb2f932 commit 2b8b06b
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 8 deletions.
8 changes: 4 additions & 4 deletions note/lib/src/navigator_v2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class NavigatorV2 extends StatelessWidget {
}

Future<R?> push<R>(String location) {
return _routerDelegate._push<R>(location);
return _routerDelegate._push<R>(Uri.parse(location));
}

static RouterConfig<RouteInformation> config({required Navigable navigable}) {
Expand Down Expand Up @@ -113,12 +113,12 @@ class _MyRouterDelegate extends RouterDelegate<RouteInformation>

@override
Future<void> setNewRoutePath(RouteInformation configuration) {
_push(configuration.location ?? "/");
_push(configuration.uri );
return SynchronousFuture(null);
}

Future<R?> _push<R>(String location) {
Screen screen = _navigable.switchTo(location);
Future<R?> _push<R>(Uri uri) {
Screen screen = _navigable.switchTo(uri.toString());
_Page page = screen._page;
//把completer的完成指责放权给各Screen后,框架需监听其完成后删除Page
//并在onPopPage后
Expand Down
1 change: 1 addition & 0 deletions note/lib/src/note_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ class Note {
return [...parent!.topList(), this];
}

// todo bug
Note? child(String path) {
Note? result = this;
for (var split
Expand Down
2 changes: 1 addition & 1 deletion spaces/flutter_note/lib/notes.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
})>[],
)
],
);
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ Scaffold(
child: Column( mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
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),
),
);
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
})>[],
)
],
);
2 changes: 1 addition & 1 deletion spaces/flutter_note/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2b8b06b

Please sign in to comment.