-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,535 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# https://dart.dev/guides/libraries/private-files | ||
# Created by `dart pub` | ||
.dart_tool/ |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 ebwood | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# A builder tool to generate RemoteFlutterWidget tree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This file configures the static analysis results for your project (errors, | ||
# warnings, and lints). | ||
# | ||
# This enables the 'recommended' set of lints from `package:lints`. | ||
# This set helps identify many issues that may lead to problems when running | ||
# or consuming Dart code, and enforces writing Dart using a single, idiomatic | ||
# style and format. | ||
# | ||
# If you want a smaller set of lints you can change this to specify | ||
# 'package:lints/core.yaml'. These are just the most critical lints | ||
# (the recommended set includes the core lints). | ||
# The core lints are also what is used by pub.dev for scoring packages. | ||
|
||
include: package:lints/recommended.yaml | ||
|
||
# Uncomment the following section to specify additional rules. | ||
|
||
# linter: | ||
# rules: | ||
# - camel_case_types | ||
|
||
# analyzer: | ||
# exclude: | ||
# - path/to/excluded/files/** | ||
|
||
# For more information about the core and recommended set of lints, see | ||
# https://dart.dev/go/core-lints | ||
|
||
# For additional information about configuring this file, see | ||
# https://dart.dev/guides/language/analysis-options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
import 'package:rfw/formats.dart'; | ||
|
||
abstract class Builder<T> { | ||
void update(void Function(Builder)? updates) { | ||
updates?.call(this); | ||
} | ||
|
||
T build(); | ||
} | ||
|
||
abstract class Spec { | ||
R accept<R>(SpecVisitor<R> visitor, [R? context]); | ||
} | ||
|
||
abstract class SpecVisitor<R> { | ||
R visitDynamicList(DynamicList spec, [R? context]); | ||
|
||
R visitDynamicMap(DynamicMap spec, [R? context]); | ||
|
||
R visitLibraryName(LibraryName spec, [R? context]); | ||
|
||
R visitFullyQualifiedWidgetName(FullyQualifiedWidgetName spec, [R? context]); | ||
|
||
R visitMissing(Missing spec, [R? context]); | ||
|
||
R visitLoop(Loop spec, [R? context]); | ||
|
||
R visitSwitch(Switch spec, [R? context]); | ||
|
||
R visitConstructorCall(ConstructorCall spec, [R? context]); | ||
|
||
R visitWidgetBuilderDeclaration(WidgetBuilderDeclaration spec, [R? context]); | ||
|
||
R visitArgsReference(ArgsReference spec, [R? context]); | ||
|
||
R visitBoundArgsReference(BoundArgsReference spec, [R? context]); | ||
|
||
R visitDataReference(DataReference spec, [R? context]); | ||
|
||
R visitWidgetBuilderArgReference(WidgetBuilderArgReference spec, | ||
[R? context]); | ||
|
||
R visitLoopReference(LoopReference spec, [R? context]); | ||
|
||
R visitBoundLoopReference(BoundLoopReference spec, [R? context]); | ||
|
||
R visitStateReference(StateReference spec, [R? context]); | ||
|
||
R visitBoundStateReference(BoundStateReference spec, [R? context]); | ||
|
||
R visitEventHandler(EventHandler spec, [R? context]); | ||
|
||
R visitSetStateHandler(SetStateHandler spec, [R? context]); | ||
|
||
R visitImport(Import spec, [R? context]); | ||
|
||
R visitWidgetDeclaration(WidgetDeclaration spec, [R? context]); | ||
|
||
R visitRemoteWidgetLibrary(RemoteWidgetLibrary spec, [R? context]); | ||
|
||
R visitOtherReference(Reference spec, [R? context]); | ||
|
||
R visitOtherAnyEventHandler(AnyEventHandler spec, [R? context]); | ||
|
||
R visitOtherBlobNode(BlobNode spec, [R? context]); | ||
} | ||
|
||
abstract mixin class DefaultSpecVisitor<R> implements SpecVisitor<R> { | ||
R get defaultValue; | ||
|
||
@override | ||
R visitDynamicList(DynamicList spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitDynamicMap(DynamicMap spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitArgsReference(ArgsReference spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitBoundArgsReference(BoundArgsReference spec, [R? context]) => | ||
defaultValue; | ||
|
||
@override | ||
R visitDataReference(DataReference spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitWidgetBuilderArgReference(WidgetBuilderArgReference spec, | ||
[R? context]) => | ||
defaultValue; | ||
|
||
@override | ||
R visitLoopReference(LoopReference spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitBoundLoopReference(BoundLoopReference spec, [R? context]) => | ||
defaultValue; | ||
|
||
@override | ||
R visitStateReference(StateReference spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitBoundStateReference(BoundStateReference spec, [R? context]) => | ||
defaultValue; | ||
|
||
@override | ||
R visitEventHandler(EventHandler spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitSetStateHandler(SetStateHandler spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitImport(Import spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitWidgetDeclaration(WidgetDeclaration spec, [R? context]) => | ||
defaultValue; | ||
|
||
@override | ||
R visitRemoteWidgetLibrary(RemoteWidgetLibrary spec, [R? context]) => | ||
defaultValue; | ||
|
||
@override | ||
R visitOtherReference(Reference spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitOtherAnyEventHandler(AnyEventHandler spec, [R? context]) => | ||
defaultValue; | ||
|
||
@override | ||
R visitOtherBlobNode(BlobNode spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitLibraryName(LibraryName spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitFullyQualifiedWidgetName(FullyQualifiedWidgetName spec, | ||
[R? context]) => | ||
defaultValue; | ||
|
||
@override | ||
R visitMissing(Missing spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitLoop(Loop spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitSwitch(Switch spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitConstructorCall(ConstructorCall spec, [R? context]) => defaultValue; | ||
|
||
@override | ||
R visitWidgetBuilderDeclaration(WidgetBuilderDeclaration spec, | ||
[R? context]) => | ||
defaultValue; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
// import 'package:rfw/src/dart/model.dart'; | ||
// import 'package:rfw_builder/base.dart'; | ||
|
||
// class JsonVisitor extends DefaultSpecVisitor<Map<String, dynamic>> { | ||
// @override | ||
// Map<String, dynamic> visitArgsReference(ArgsReference spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitArgsReference | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitBoundArgsReference(BoundArgsReference spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitBoundArgsReference | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitBoundLoopReference(BoundLoopReference spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitBoundLoopReference | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitBoundStateReference(BoundStateReference spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitBoundStateReference | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitConstructorCall(ConstructorCall spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitConstructorCall | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitDataReference(DataReference spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitDataReference | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitDynamicList(DynamicList spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitDynamicList | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitDynamicMap(DynamicMap spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitDynamicMap | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitEventHandler(EventHandler spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitEventHandler | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitFullyQualifiedWidgetName(FullyQualifiedWidgetName spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitFullyQualifiedWidgetName | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitImport(Import spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitImport | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitLibraryName(LibraryName spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitLibraryName | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitLoop(Loop spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitLoop | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitLoopReference(LoopReference spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitLoopReference | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitMissing(Missing spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitMissing | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitRemoteWidgetLibrary(RemoteWidgetLibrary spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitRemoteWidgetLibrary | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitSetStateHandler(SetStateHandler spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitSetStateHandler | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitStateReference(StateReference spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitStateReference | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitSwitch(Switch spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitSwitch | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitWidgetBuilderArgReference(WidgetBuilderArgReference spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitWidgetBuilderArgReference | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitWidgetBuilderDeclaration(WidgetBuilderDeclaration spec, [Map<String, dynamic>? context]) { | ||
// // TODO: implement visitWidgetBuilderDeclaration | ||
// throw UnimplementedError(); | ||
// } | ||
|
||
// @override | ||
// Map<String, dynamic> visitWidgetDeclaration(WidgetDeclaration spec, [Map<String, dynamic>? context]) { | ||
// return { | ||
// 'name': spec.name, | ||
// 'type': '${spec.runtimeType}', | ||
// 'root': spec.root.accept(this), | ||
// }; | ||
// } | ||
// } |
Oops, something went wrong.