├── linux ├── .gitignore ├── main.cc ├── flutter │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ ├── generated_plugins.cmake │ └── CMakeLists.txt ├── my_application.h ├── my_application.cc └── CMakeLists.txt ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── Runner-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist └── .gitignore ├── macos ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner │ ├── Configs │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ ├── Warnings.xcconfig │ │ └── AppInfo.xcconfig │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_64.png │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_512.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Release.entitlements │ ├── DebugProfile.entitlements │ ├── MainFlutterWindow.swift │ └── Info.plist ├── .gitignore ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner.xcodeproj │ ├── project.xcworkspace │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ └── xcschemes │ └── Runner.xcscheme ├── generator ├── third_party │ └── flutter_ast │ │ ├── third_party │ │ └── flutter_ast_core │ │ │ ├── LICENSE │ │ │ ├── CHANGELOG.md │ │ │ ├── README.md │ │ │ ├── lib │ │ │ ├── flutter_ast_core.dart │ │ │ └── src │ │ │ │ ├── enum.dart │ │ │ │ ├── constructor.dart │ │ │ │ ├── comment.dart │ │ │ │ ├── comment.g.dart │ │ │ │ ├── enum.g.dart │ │ │ │ ├── file.dart │ │ │ │ ├── class.dart │ │ │ │ ├── constructor.g.dart │ │ │ │ ├── method.dart │ │ │ │ ├── file.g.dart │ │ │ │ ├── core.dart │ │ │ │ ├── class.g.dart │ │ │ │ ├── core.g.dart │ │ │ │ ├── method.g.dart │ │ │ │ ├── comment.freezed.dart │ │ │ │ ├── enum.freezed.dart │ │ │ │ └── constructor.freezed.dart │ │ │ ├── .metadata │ │ │ ├── pubspec.yaml │ │ │ ├── build.yaml │ │ │ └── .gitignore │ │ ├── analysis_options.yaml │ │ ├── .npmignore │ │ ├── .gitmodules │ │ ├── lib │ │ ├── src │ │ │ ├── index.dart │ │ │ ├── analyzer.dart │ │ │ ├── extensions.dart │ │ │ ├── enum.dart │ │ │ ├── comment.dart │ │ │ ├── constructor.dart │ │ │ ├── core.dart │ │ │ ├── class.dart │ │ │ ├── file.dart │ │ │ ├── generator │ │ │ │ └── parser.dart │ │ │ ├── field.dart │ │ │ └── method.dart │ │ ├── cli │ │ │ └── generator.g.dart │ │ └── flutter_ast.dart │ │ ├── .devcontainer │ │ ├── library-scripts │ │ │ └── README.md │ │ ├── devcontainer.json │ │ └── Dockerfile │ │ ├── pubspec.yaml │ │ ├── templates │ │ ├── type.dart.mustache │ │ ├── object.dart.mustache │ │ ├── enum.dart.mustache │ │ ├── widget.dart.mustache │ │ ├── core.dart.mustache │ │ └── base.dart.mustache │ │ ├── .vscode │ │ └── launch.json │ │ ├── .gitignore │ │ ├── LICENSE │ │ └── samples │ │ └── example.dart ├── pubspec.yaml └── pubspec.lock ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── manifest.json └── index.html ├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable-v21 │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── values-night │ │ │ │ │ └── styles.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── flutter_file_based_routing │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle └── build.gradle ├── windows ├── runner │ ├── resources │ │ └── app_icon.ico │ ├── resource.h │ ├── CMakeLists.txt │ ├── utils.h │ ├── runner.exe.manifest │ ├── flutter_window.h │ ├── main.cpp │ ├── utils.cpp │ ├── flutter_window.cpp │ ├── Runner.rc │ └── win32_window.h ├── flutter │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ ├── generated_plugins.cmake │ └── CMakeLists.txt ├── .gitignore └── CMakeLists.txt ├── .gitmodules ├── lib ├── main.dart └── pages │ ├── about │ ├── guest.dart │ ├── index.dart │ └── :id.dart │ ├── about.dart │ ├── index.dart │ ├── settings.dart │ └── root.dart ├── .metadata ├── pubspec.yaml ├── .github └── workflows │ └── main.yml ├── .gitignore ├── CONTRIBUTING.md ├── analysis_options.yaml ├── pubspec.lock └── README.md /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/web/icons/Icon-512.png -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | exclude: 3 | - "build/**" 4 | - "samples/*.g.dart" 5 | -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "third_party/flutter_ast"] 2 | path = generator/third_party/flutter_ast 3 | url = https://github.com/rodydavis/flutter_ast 4 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.0.1] - TODO: Add release date. 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/README.md: -------------------------------------------------------------------------------- 1 | # flutter_ast_core 2 | 3 | Dart Classes Used By Flutter AST for Serialization and Modification. -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/.npmignore: -------------------------------------------------------------------------------- 1 | README.md 2 | flutter_gen 3 | definition-manifest.json 4 | .devcontainer/library-scripts/README.md 5 | .vscode 6 | .npmignore 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "third_party/flutter_ast_core"] 2 | path = third_party/flutter_ast_core 3 | url = https://rodydavis@github.com/rodydavis/flutter_ast_core 4 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_file_based_routing/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | 9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 10 | } 11 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/flutter_file_based_routing/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_file_based_routing 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'generated.g.dart'; 4 | 5 | void main() { 6 | runApp(GeneratedApp( 7 | themeMode: ThemeMode.system, 8 | theme: ThemeData.light(), 9 | darkTheme: ThemeData.dark(), 10 | )); 11 | } 12 | -------------------------------------------------------------------------------- /generator/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_file_based_routing 2 | description: A new Flutter project. 3 | publish_to: "none" 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ">=2.0.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter_ast: 11 | path: third_party/flutter_ast 12 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/flutter_ast_core.dart: -------------------------------------------------------------------------------- 1 | library flutter_ast_core; 2 | 3 | export 'src/enum.dart'; 4 | export 'src/comment.dart'; 5 | export 'src/core.dart'; 6 | export 'src/constructor.dart'; 7 | export 'src/method.dart'; 8 | export 'src/class.dart'; 9 | export 'src/file.dart'; -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/src/index.dart: -------------------------------------------------------------------------------- 1 | export 'analyzer.dart'; 2 | export 'class.dart'; 3 | export 'comment.dart'; 4 | export 'constructor.dart'; 5 | export 'core.dart'; 6 | export 'enum.dart'; 7 | export 'extensions.dart'; 8 | export 'field.dart'; 9 | export 'file.dart'; 10 | export 'method.dart'; 11 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/pages/about/guest.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../generated.g.dart'; 4 | 5 | class GuestPage extends UiRoute { 6 | @override 7 | Widget builder(BuildContext context, void data, Widget? child) { 8 | return const Center( 9 | child: Text('Guest'), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/pages/about/index.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../generated.g.dart'; 4 | 5 | class AboutDetails extends UiRoute { 6 | @override 7 | Widget builder(BuildContext context, void data, Widget? child) { 8 | return const Center( 9 | child: Text('About'), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: d77bc51856606551dab3758e0ff866c8a5c4a7d9 8 | channel: master 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/src/analyzer.dart: -------------------------------------------------------------------------------- 1 | export 'package:analyzer/dart/ast/ast.dart'; 2 | export 'package:analyzer/src/dart/ast/ast.dart'; 3 | export 'package:analyzer/dart/analysis/utilities.dart'; 4 | export 'package:analyzer/dart/ast/syntactic_entity.dart'; 5 | export 'package:_fe_analyzer_shared/src/scanner/token_impl.dart'; 6 | export 'package:analyzer/dart/analysis/results.dart'; -------------------------------------------------------------------------------- /lib/pages/about.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../generated.g.dart'; 4 | 5 | class AboutPage extends UiRoute { 6 | @override 7 | Widget builder(BuildContext context, void data, Widget? child) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: const Text('About'), 11 | ), 12 | body: child, 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/pages/index.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../generated.g.dart'; 4 | 5 | class HomePage extends UiRoute { 6 | @override 7 | Widget builder(BuildContext context, void data, Widget? child) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: const Text('Home'), 11 | ), 12 | body: child, 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/pages/settings.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../generated.g.dart'; 4 | 5 | class SettingsPage extends UiRoute { 6 | @override 7 | Widget builder(BuildContext context, void data, Widget? child) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: const Text('Settings'), 11 | ), 12 | body: child, 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/src/extensions.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | extension Utils on Object { 4 | String get description => '${this.runtimeType} -> $this'; 5 | void debug() => print(description); 6 | } 7 | 8 | extension MapUtils on Map { 9 | String prettyPrint() { 10 | JsonEncoder encoder = new JsonEncoder.withIndent(' '); 11 | return encoder.convert(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: e8ac66893ce298d885396ef5f2b159b7b7adc62f 8 | channel: master 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_ast_core 2 | description: A new Flutter package project. 3 | version: 0.0.1 4 | author: 5 | homepage: 6 | 7 | environment: 8 | sdk: ">=2.7.0 <3.0.0" 9 | 10 | dependencies: 11 | freezed_annotation: any 12 | json_annotation: any 13 | 14 | dev_dependencies: 15 | build_runner: any 16 | freezed: any 17 | json_serializable: any 18 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/pages/about/:id.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../generated.g.dart'; 4 | 5 | class AccountPage extends UiRoute> { 6 | @override 7 | loader(route, args) => args; 8 | 9 | @override 10 | Widget builder( 11 | BuildContext context, Map data, Widget? child) { 12 | return Center( 13 | child: Text('ID: ${data['id']}'), 14 | ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/src/enum.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_ast_core/flutter_ast_core.dart'; 2 | 3 | import 'analyzer.dart'; 4 | import 'index.dart'; 5 | 6 | extension EnumDeclarationImplUtils on EnumDeclarationImpl { 7 | DartEnum toDartEnum() { 8 | final _name = this.name.toString(); 9 | final _values = this.constants.map((e) => e.name.toString()).toList(); 10 | return DartEnum( 11 | name: _name, 12 | values: _values, 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/enum.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | 3 | part 'enum.freezed.dart'; 4 | part 'enum.g.dart'; 5 | 6 | @freezed 7 | abstract class DartEnum with _$DartEnum { 8 | const factory DartEnum({ 9 | @required String name, 10 | @required List values, 11 | }) = _DartEnum; 12 | 13 | factory DartEnum.fromJson(Map json) => 14 | _$DartEnumFromJson(json); 15 | } 16 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_file_based_routing 2 | description: A new Flutter project. 3 | 4 | publish_to: "none" 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.15.0-285.0.dev <3.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | cupertino_icons: ^1.0.2 16 | 17 | dev_dependencies: 18 | flutter_test: 19 | sdk: flutter 20 | 21 | flutter_lints: ^1.0.0 22 | 23 | flutter: 24 | uses-material-design: true 25 | 26 | router_config: 27 | generated_file: lib/ 28 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/.devcontainer/library-scripts/README.md: -------------------------------------------------------------------------------- 1 | # Warning: Folder contents may be replaced 2 | 3 | The contents of this folder will be automatically replaced with a file of the same name in the [vscode-dev-containers](https://github.com/microsoft/vscode-dev-containers) repository's [script-library folder](https://github.com/microsoft/vscode-dev-containers/tree/master/script-library) whenever the repository is packaged. 4 | 5 | To retain your edits, move the file to a different location. You may also delete the files if they are not needed. -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | set(PLUGIN_BUNDLED_LIBRARIES) 9 | 10 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 11 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 12 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 13 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 15 | endforeach(plugin) 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | set(PLUGIN_BUNDLED_LIBRARIES) 9 | 10 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 11 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 12 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 13 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 15 | endforeach(plugin) 16 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | builders: 4 | json_serializable: 5 | options: 6 | any_map: false 7 | checked: false 8 | create_factory: true 9 | create_to_json: true 10 | disallow_unrecognized_keys: false 11 | explicit_to_json: false 12 | field_rename: none 13 | generic_argument_factories: false 14 | ignore_unannotated: false 15 | include_if_null: true 16 | nullable: true 17 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_ast 2 | description: A Pure Dart File to Ast Serializer/Deserializer. 3 | publish_to: "none" 4 | version: 1.0.0+1 5 | environment: 6 | sdk: ">=2.7.0 <3.0.0" 7 | 8 | dependencies: 9 | build_cli_annotations: ^1.0.0 10 | analyzer: ^0.39.0 11 | path: ^1.7.0 12 | console: ^3.1.0 13 | mustache_template: ^1.0.0+1 14 | _fe_analyzer_shared: ^9.0.0 15 | recase: ^3.0.0 16 | flutter_ast_core: 17 | path: third_party/flutter_ast_core 18 | 19 | dev_dependencies: 20 | build_runner: ^1.6.7 21 | build_cli: ^1.3.9 22 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/constructor.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | 3 | import 'core.dart'; 4 | 5 | part 'constructor.freezed.dart'; 6 | part 'constructor.g.dart'; 7 | 8 | @freezed 9 | abstract class DartConstructor with _$DartConstructor { 10 | const factory DartConstructor({ 11 | @required String name, 12 | @Default([]) List properties, 13 | }) = _DartConstructor; 14 | 15 | factory DartConstructor.fromJson(Map json) => 16 | _$DartConstructorFromJson(json); 17 | } 18 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/src/comment.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_ast_core/flutter_ast_core.dart'; 2 | 3 | import 'analyzer.dart'; 4 | import 'index.dart'; 5 | 6 | extension DartCommentUtils on CommentImpl { 7 | DartComment toDartComment() { 8 | final _lines = []; 9 | for (final child in this.childEntities) { 10 | final _desc = child.toString(); 11 | if (_desc.contains('///')) { 12 | final line = _desc.replaceFirst('/// ', '').replaceFirst('///', ''); 13 | _lines.add(line); 14 | } 15 | } 16 | return DartComment(lines: _lines); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/comment.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | 3 | part 'comment.freezed.dart'; 4 | part 'comment.g.dart'; 5 | 6 | @freezed 7 | abstract class DartComment with _$DartComment { 8 | const factory DartComment({ 9 | @Default([]) List lines, 10 | }) = _DartComment; 11 | 12 | factory DartComment.fromJson(Map json) => 13 | _$DartCommentFromJson(json); 14 | } 15 | 16 | extension DartCommentUtils on DartComment { 17 | String get comment => this?.lines == null ? '' : this.lines.join('\n'); 18 | } 19 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "utils.cpp" 8 | "win32_window.cpp" 9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 10 | "Runner.rc" 11 | "runner.exe.manifest" 12 | ) 13 | apply_standard_settings(${BINARY_NAME}) 14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 17 | add_dependencies(${BINARY_NAME} flutter_assemble) 18 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/comment.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'comment.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_DartComment _$_$_DartCommentFromJson(Map json) { 10 | return _$_DartComment( 11 | lines: (json['lines'] as List)?.map((e) => e as String)?.toList() ?? [], 12 | ); 13 | } 14 | 15 | Map _$_$_DartCommentToJson(_$_DartComment instance) => 16 | { 17 | 'lines': instance.lines, 18 | }; 19 | -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = flutter_file_based_routing 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterFileBasedRouting 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/templates/type.dart.mustache: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/rendering.dart'; 4 | import 'package:flutter/gestures.dart'; 5 | 6 | class {{name}}Object<{{type}}> { 7 | {{name}}Object(this._data, this._changed); 8 | 9 | final Map _data; 10 | final VoidCallback _changed; 11 | 12 | {{type}} get value { 13 | if (_data == null) { 14 | return null; 15 | } 16 | return _data['value']; 17 | } 18 | 19 | set value({{type}} val) { 20 | if (val == value) { 21 | return; 22 | } 23 | _data['value'] = val; 24 | _changed(); 25 | } 26 | } -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/enum.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'enum.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_DartEnum _$_$_DartEnumFromJson(Map json) { 10 | return _$_DartEnum( 11 | name: json['name'] as String, 12 | values: (json['values'] as List)?.map((e) => e as String)?.toList(), 13 | ); 14 | } 15 | 16 | Map _$_$_DartEnumToJson(_$_DartEnum instance) => 17 | { 18 | 'name': instance.name, 19 | 'values': instance.values, 20 | }; 21 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: github pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | deploy: 10 | runs-on: ubuntu-18.04 11 | steps: 12 | - uses: actions/checkout@v2 13 | 14 | - name: Setup Flutter 15 | uses: subosito/flutter-action@v1 16 | with: 17 | channel: 'dev' 18 | 19 | - name: Install 20 | run: | 21 | flutter config --enable-web 22 | flutter pub get 23 | - name: Build 24 | run: flutter build web --base-href /flutter_file_based_routing/ 25 | 26 | - name: Deploy 27 | uses: peaceiris/actions-gh-pages@v3 28 | with: 29 | github_token: ${{ secrets.GITHUB_TOKEN }} 30 | publish_dir: ./build/web 31 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/file.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | 3 | import 'class.dart'; 4 | import 'core.dart'; 5 | import 'enum.dart'; 6 | import 'method.dart'; 7 | 8 | part 'file.freezed.dart'; 9 | part 'file.g.dart'; 10 | 11 | @freezed 12 | abstract class DartFile with _$DartFile { 13 | const factory DartFile({ 14 | String path, 15 | @Default([]) List classes, 16 | @Default([]) List enums, 17 | @Default([]) List fields, 18 | @Default([]) List imports, 19 | @Default([]) List methods, 20 | }) = _DartFile; 21 | 22 | factory DartFile.fromJson(Map json) => 23 | _$DartFileFromJson(json); 24 | } 25 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Launch Server", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/server.dart", 12 | "cwd": "flutter_gen", 13 | "serverReadyAction": { 14 | "pattern": "Listening on localhost:([0-9]+)", 15 | "uriFormat": "http://localhost:%s", 16 | "action": "openExternally" 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | third_party/flutter -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/class.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | 3 | import 'comment.dart'; 4 | import 'constructor.dart'; 5 | import 'core.dart'; 6 | import 'method.dart'; 7 | 8 | part 'class.freezed.dart'; 9 | part 'class.g.dart'; 10 | 11 | @freezed 12 | abstract class DartClass with _$DartClass { 13 | const factory DartClass({ 14 | @Default([]) List constructors, 15 | @Default([]) List comments, 16 | @Default([]) List fields, 17 | @Default([]) List methods, 18 | @required String name, 19 | bool isAbstract, 20 | String extendsClause, 21 | String implementsClause, 22 | String withClause, 23 | }) = _DartClass; 24 | 25 | factory DartClass.fromJson(Map json) => 26 | _$DartClassFromJson(json); 27 | } 28 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dart", 3 | "build": { 4 | "dockerfile": "Dockerfile", 5 | // Update VARIANT to pick a Dart version 6 | "args": { "VARIANT": "2" } 7 | }, 8 | 9 | // Set *default* container specific settings.json values on container create. 10 | "settings": { 11 | "terminal.integrated.shell.linux": "/bin/bash" 12 | }, 13 | 14 | // Add the IDs of extensions you want installed when the container is created. 15 | "extensions": [ 16 | "dart-code.dart-code" 17 | ] 18 | 19 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 20 | // "forwardPorts": [], 21 | 22 | // Use 'postCreateCommand' to run commands after the container is created. 23 | // "postCreateCommand": "uname -a", 24 | 25 | // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. 26 | // "remoteUser": "vscode" 27 | } 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/constructor.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'constructor.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_DartConstructor _$_$_DartConstructorFromJson(Map json) { 10 | return _$_DartConstructor( 11 | name: json['name'] as String, 12 | properties: (json['properties'] as List) 13 | ?.map((e) => e == null 14 | ? null 15 | : DartProperty.fromJson(e as Map)) 16 | ?.toList() ?? 17 | [], 18 | ); 19 | } 20 | 21 | Map _$_$_DartConstructorToJson(_$_DartConstructor instance) => 22 | { 23 | 'name': instance.name, 24 | 'properties': instance.properties, 25 | }; 26 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/templates/object.dart.mustache: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/rendering.dart'; 4 | import 'package:flutter/gestures.dart'; 5 | 6 | import 'core.dart'; 7 | 8 | class {{name}}Object extends Core<{{type}}> { 9 | {{name}}Object(this.data, this.changed); 10 | 11 | @override 12 | final Map data; 13 | 14 | @override 15 | final ValueChanged> changed; 16 | 17 | T get fallback = {{fallback}}; 18 | 19 | @override 20 | {{type}} get value { 21 | if (data == null || data['value'] == null) { 22 | return fallback; 23 | } 24 | final _value = parseValue<{{type}}>(data['value']); 25 | return _value; 26 | } 27 | 28 | @override 29 | set value({{type}} val) { 30 | if (val == value) { 31 | return; 32 | } 33 | final _value = serializeValue<{{type}}>(val); 34 | changed({'type': type, 'value': _value}); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/templates/enum.dart.mustache: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/rendering.dart'; 4 | import 'package:flutter/gestures.dart'; 5 | 6 | import 'core.dart'; 7 | 8 | class EnumObject extends Core { 9 | EnumObject(this.data, this.values, this.changed); 10 | 11 | @override 12 | final Map data; 13 | 14 | @override 15 | final ValueChanged> changed; 16 | 17 | final List values; 18 | 19 | T get fallback = {{fallback}}; 20 | 21 | @override 22 | {{type}} get value { 23 | if (data == null || data['value'] == null) { 24 | return fallback; 25 | } 26 | final _value = parseValue<{{type}}>(data['value']); 27 | return _value; 28 | } 29 | 30 | @override 31 | set value({{type}} val) { 32 | if (val == value) { 33 | return; 34 | } 35 | final _value = serializeValue<{{type}}>(val); 36 | changed({'type': type, 'value': _value}); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/cli/generator.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'generator.dart'; 4 | 5 | // ************************************************************************** 6 | // CliGenerator 7 | // ************************************************************************** 8 | 9 | Options _$parseOptionsResult(ArgResults result) => 10 | Options(result['path'] as String, result['output'] as String) 11 | ..help = result['help'] as bool; 12 | 13 | ArgParser _$populateOptionsParser(ArgParser parser) => parser 14 | ..addOption('path', 15 | abbr: 'p', help: 'Required. The path to the Directory of widgets.') 16 | ..addOption('output', 17 | abbr: 'o', help: 'The path to the Directory output.', defaultsTo: 'build') 18 | ..addFlag('help', help: 'Prints usage information.', negatable: false); 19 | 20 | final _$parserForOptions = _$populateOptionsParser(ArgParser()); 21 | 22 | Options parseOptions(List args) { 23 | final result = _$parserForOptions.parse(args); 24 | return _$parseOptionsResult(result); 25 | } 26 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/src/constructor.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_ast_core/flutter_ast_core.dart'; 2 | 3 | import 'analyzer.dart'; 4 | import 'index.dart'; 5 | 6 | extension ConstructorDeclarationImplUtils on ConstructorDeclarationImpl { 7 | DartConstructor toDartConstructor(DartClass parent) { 8 | DartConstructor base; 9 | String _name = ''; 10 | for (final node in this.childEntities) { 11 | if (node is SimpleIdentifierImpl) { 12 | _name = node.name; 13 | } 14 | if (node is DeclaredSimpleIdentifier) { 15 | _name = node.name; 16 | } 17 | base = DartConstructor(name: _name); 18 | if (node is FormalParameterListImpl) { 19 | for (final child in node.childEntities) { 20 | if (child is DefaultFormalParameterImpl) { 21 | final _props = List.from(base.properties); 22 | _props.add(child.toDartProperty(parent.fields)); 23 | base = base.copyWith(properties: _props); 24 | } 25 | } 26 | } 27 | } 28 | return base; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_file_based_routing", 3 | "short_name": "flutter_file_based_routing", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Rody Davis 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement. You (or your employer) retain the copyright to your contribution; 10 | this simply gives us permission to use and redistribute your contributions as 11 | part of the project. Head over to to see 12 | your current agreements on file or to sign a new one. 13 | 14 | You generally only need to submit a CLA once, so if you've already submitted one 15 | (even if it was for a different project), you probably don't need to do it 16 | again. 17 | 18 | ## Code Reviews 19 | 20 | All submissions, including submissions by project members, require review. We 21 | use GitHub pull requests for this purpose. Consult 22 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 23 | information on using pull requests. 24 | 25 | ## Community Guidelines 26 | 27 | This project follows [Google's Open Source Community 28 | Guidelines](https://opensource.google/conduct/). -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/src/core.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_ast_core/flutter_ast_core.dart'; 2 | 3 | import 'analyzer.dart'; 4 | 5 | extension LiteralImplUtils on LiteralImpl { 6 | DartCore toDartCore() { 7 | final value = this; 8 | if (value is BooleanLiteralImpl) { 9 | return DartCore( 10 | type: 'bool', 11 | value: value.value.toString(), 12 | ); 13 | } 14 | if (value is IntegerLiteralImpl) { 15 | return DartCore( 16 | type: 'int', 17 | value: value.value.toString(), 18 | ); 19 | } 20 | if (value is DoubleLiteralImpl) { 21 | return DartCore( 22 | type: 'double', 23 | value: value.value.toString(), 24 | ); 25 | } 26 | if (value is StringLiteralImpl) { 27 | return DartCore( 28 | type: 'String', 29 | value: value.stringValue.toString(), 30 | ); 31 | } 32 | if (value is SetOrMapLiteralImpl) { 33 | return DartCore( 34 | type: 'Map', 35 | value: value.toString(), 36 | ); 37 | } 38 | if (value is ListLiteralImpl) { 39 | return DartCore( 40 | type: 'List', 41 | value: value.toString(), 42 | ); 43 | } 44 | return DartCore( 45 | type: null, 46 | value: value.toString(), 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.CreateAndShow(L"flutter_file_based_routing", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # Update VARIANT in devcontainer.json to pick a Dart version 2 | ARG VARIANT=2 3 | FROM google/dart:${VARIANT} 4 | 5 | # [Option] Install zsh 6 | ARG INSTALL_ZSH="true" 7 | # [Option] Upgrade OS packages to their latest versions 8 | ARG UPGRADE_PACKAGES="false" 9 | 10 | # Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies. 11 | ARG USERNAME=vscode 12 | ARG USER_UID=1000 13 | ARG USER_GID=$USER_UID 14 | COPY library-scripts/*.sh /tmp/library-scripts/ 15 | RUN apt-get update \ 16 | && /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \ 17 | && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts 18 | 19 | # Add bin location to path 20 | ENV PUB_CACHE="/usr/local/share/pub-cache" 21 | ENV PATH="${PATH}:${PUB_CACHE}/bin" 22 | RUN mkdir -p ${PUB_CACHE} \ 23 | && chown ${USERNAME}:root ${PUB_CACHE} \ 24 | && echo "if [ \"\$(stat -c '%U' ${PUB_CACHE})\" != \"${USERNAME}\" ]; then sudo chown -R ${USER_UID}:root ${PUB_CACHE}; fi" \ 25 | | tee -a /root/.bashrc /root/.zshrc /home/${USERNAME}/.bashrc >> /home/${USERNAME}/.zshrc 26 | 27 | # [Optional] Uncomment this section to install additional OS packages. 28 | # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 29 | # && apt-get -y install --no-install-recommends -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/src/class.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_ast_core/flutter_ast_core.dart'; 2 | 3 | import 'analyzer.dart'; 4 | import 'comment.dart'; 5 | import 'index.dart'; 6 | 7 | extension ClauseDeclarationImplUtils on ClassDeclarationImpl { 8 | DartClass toDartClass(DartFile parent) { 9 | DartClass base = DartClass(name: this.name.toString()); 10 | final List fields = []; 11 | for (final item in this.childEntities.whereType()) { 12 | fields.add(item.toDartField()); 13 | } 14 | final List constructors = []; 15 | for (final item 16 | in this.childEntities.whereType()) { 17 | constructors.add(item.toDartConstructor(base)); 18 | } 19 | final List methods = []; 20 | for (final item in this.childEntities.whereType()) { 21 | methods.add(item.toDartMethod(base)); 22 | } 23 | final List comments = []; 24 | for (final item in this.childEntities.whereType()) { 25 | comments.add(item.toDartComment()); 26 | } 27 | return base.copyWith( 28 | isAbstract: this?.abstractKeyword != null, 29 | extendsClause: this?.extendsClause?.toString(), 30 | implementsClause: this?.implementsClause?.toString(), 31 | withClause: this?.withClause?.toString(), 32 | fields: fields, 33 | constructors: constructors, 34 | methods: methods, 35 | comments: comments, 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/method.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | 3 | import 'core.dart'; 4 | 5 | part 'method.freezed.dart'; 6 | part 'method.g.dart'; 7 | 8 | @freezed 9 | abstract class DartMethod with _$DartMethod { 10 | const factory DartMethod({ 11 | @required String name, 12 | @Default([]) List parameters, 13 | @required MethodNode body, 14 | }) = _DartMethod; 15 | 16 | factory DartMethod.fromJson(Map json) => 17 | _$DartMethodFromJson(json); 18 | } 19 | 20 | @freezed 21 | abstract class MethodNode with _$MethodNode { 22 | const factory MethodNode({ 23 | @required String name, 24 | }) = MethodBase; 25 | 26 | const factory MethodNode.values({ 27 | @required String name, 28 | List values, 29 | }) = MethodValues; 30 | 31 | const factory MethodNode.binary({ 32 | @required String name, 33 | @required MethodNode left, 34 | @required MethodNode right, 35 | @required String operation, 36 | }) = MethodBinary; 37 | 38 | const factory MethodNode.constructor({ 39 | @required String name, 40 | @required String value, 41 | @Default({}) Map arguments, 42 | }) = MethodConstructor; 43 | 44 | const factory MethodNode.simple({ 45 | @required String name, 46 | @required dynamic value, 47 | }) = MethodSimple; 48 | 49 | factory MethodNode.fromJson(Map json) => 50 | _$MethodNodeFromJson(json); 51 | } 52 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/file.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'file.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_DartFile _$_$_DartFileFromJson(Map json) { 10 | return _$_DartFile( 11 | path: json['path'] as String, 12 | classes: (json['classes'] as List) 13 | ?.map((e) => e == null 14 | ? null 15 | : DartClass.fromJson(e as Map)) 16 | ?.toList() ?? 17 | [], 18 | enums: (json['enums'] as List) 19 | ?.map((e) => 20 | e == null ? null : DartEnum.fromJson(e as Map)) 21 | ?.toList() ?? 22 | [], 23 | fields: (json['fields'] as List) 24 | ?.map((e) => e == null 25 | ? null 26 | : DartField.fromJson(e as Map)) 27 | ?.toList() ?? 28 | [], 29 | imports: (json['imports'] as List)?.map((e) => e as String)?.toList() ?? [], 30 | methods: (json['methods'] as List) 31 | ?.map((e) => e == null 32 | ? null 33 | : DartMethod.fromJson(e as Map)) 34 | ?.toList() ?? 35 | [], 36 | ); 37 | } 38 | 39 | Map _$_$_DartFileToJson(_$_DartFile instance) => 40 | { 41 | 'path': instance.path, 42 | 'classes': instance.classes, 43 | 'enums': instance.enums, 44 | 'fields': instance.fields, 45 | 'imports': instance.imports, 46 | 'methods': instance.methods, 47 | }; 48 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Flutter File Based Routing 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | flutter_file_based_routing 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | build/ 32 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/src/file.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_ast_core/flutter_ast_core.dart'; 2 | 3 | import 'analyzer.dart'; 4 | import 'index.dart'; 5 | 6 | extension AstNodeUtils on AstNode { 7 | DartFile toDartFile([String path]) { 8 | DartFile base = DartFile(path: path); 9 | 10 | final List imports = []; 11 | for (final node in root.childEntities.whereType()) { 12 | final ImportDirectiveImpl _node = node; 13 | final _url = _node.uri.stringValue; 14 | imports.add(_url); 15 | } 16 | base = base.copyWith(imports: imports); 17 | 18 | final List fields = []; 19 | for (final node 20 | in root.childEntities.whereType()) { 21 | fields.add(node.toDartField()); 22 | } 23 | base = base.copyWith(fields: fields); 24 | 25 | final List methods = []; 26 | for (final node 27 | in root.childEntities.whereType()) { 28 | methods.add(node.toDartMethod()); 29 | } 30 | base = base.copyWith(methods: methods); 31 | 32 | final List classes = []; 33 | for (final node in root.childEntities.whereType()) { 34 | final ClassDeclarationImpl _node = node; 35 | classes.add(_node.toDartClass(base)); 36 | } 37 | base = base.copyWith(classes: classes); 38 | 39 | final List enums = []; 40 | for (final node in root.childEntities.whereType()) { 41 | final EnumDeclarationImpl _node = node; 42 | enums.add(_node.toDartEnum()); 43 | } 44 | base = base.copyWith(enums: enums); 45 | 46 | return base; 47 | } 48 | } 49 | 50 | extension DartFileUtils on DartFile { 51 | String toDart() { 52 | final sb = StringBuffer(); 53 | // TODO: Write back out to Dart 54 | return sb.toString(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/core.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | 3 | part 'core.freezed.dart'; 4 | part 'core.g.dart'; 5 | 6 | @freezed 7 | abstract class DartCore with _$DartCore { 8 | const factory DartCore({ 9 | @required String type, 10 | @required String value, 11 | }) = _DartCore; 12 | 13 | const factory DartCore.property({ 14 | @required String name, 15 | String key, 16 | @required String type, 17 | DartCore value, 18 | @Default(true) bool isOptional, 19 | @Default(false) bool isNamed, 20 | @Default(false) bool isPositional, 21 | @Default(false) bool isRequired, 22 | @Default(false) bool isRequiredPositional, 23 | @Default(false) bool isSynthetic, 24 | @Default(false) bool isRequiredNamed, 25 | @Default(false) bool isOptionalNamed, 26 | int position, 27 | }) = DartProperty; 28 | 29 | const factory DartCore.field({ 30 | @required String name, 31 | @required String type, 32 | DartCore value, 33 | @Default(false) bool isFinal, 34 | @Default(false) bool isConst, 35 | @Default(false) bool isStatic, 36 | }) = DartField; 37 | 38 | factory DartCore.fromJson(Map json) => 39 | _$DartCoreFromJson(json); 40 | } 41 | 42 | extension FieldUtils on DartField { 43 | String toCode() { 44 | final sb = StringBuffer(); 45 | if (isStatic) { 46 | sb.write('static '); 47 | } 48 | if (isFinal) { 49 | sb.write('final '); 50 | } 51 | if (isConst) { 52 | sb.write('const '); 53 | } 54 | if (this.type != null) { 55 | sb.write('${this.type} '); 56 | } else { 57 | if (!isConst) { 58 | sb.write('var '); 59 | } 60 | } 61 | sb.write(' ${this.name}'); 62 | if (value != null) { 63 | sb.write(' = ${this.value}'); 64 | } 65 | sb.write(';'); 66 | return sb.toString(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/samples/example.dart: -------------------------------------------------------------------------------- 1 | // //ignore_for_file: uri_does_not_exist,undefined_class,extends_non_class,undefined_named_parameter,undefined_method,undefined_identifier 2 | // import 'package:flutter/material.dart'; 3 | 4 | // enum MyEnum { one, type, three } 5 | 6 | // const int kGlobalField = 1; 7 | 8 | // /// This is a doc comment 9 | // class MyScreen extends StatelessWidget { 10 | // const MyScreen(this.position, {Key key, this.myField = false, this.mySecondField = 1, 11 | // this.numField = 3, 12 | // this.mapField = const {}, 13 | // this.dateField, 14 | // this.listField = const [], 15 | // }) : super(key: key); 16 | 17 | // const MyScreen.alt(this.position, {Key key, this.mySecondField = double.infinity, 18 | // this.numField = 3, 19 | // this.mapField = const {}, 20 | // this.listField = const [], 21 | // this.dateField, 22 | // }) : this.myField = true, super(key: key); 23 | 24 | // static const String routeName = '/my_route'; 25 | 26 | // final bool myField; 27 | // final double mySecondField; 28 | // final num numField; 29 | // final Map mapField; 30 | // final DateTime dateField; 31 | // final List listField; 32 | 33 | // final int position; 34 | 35 | // // This is a normal comment 36 | // Map toJson() { 37 | // return {}; 38 | // } 39 | 40 | // @override 41 | // Widget build(BuildContext context) { 42 | // if (myField) { 43 | // return mySecondField == 1 ? Container(color: Colors.red) : Container(color: Colors.blue); 44 | // } 45 | // return Container( 46 | // color: Colors.red, 47 | // width: 20, 48 | // child: Center( 49 | // child: Builder((context) { 50 | // return Text('Hello World'); 51 | // }), 52 | // ), 53 | // ); 54 | // } 55 | // } 56 | 57 | // void myGlobalMethod() { 58 | 59 | // } 60 | 61 | // // Ignore this simple comment 62 | // class Simple { 63 | // String value; 64 | // } 65 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/class.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'class.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_DartClass _$_$_DartClassFromJson(Map json) { 10 | return _$_DartClass( 11 | constructors: (json['constructors'] as List) 12 | ?.map((e) => e == null 13 | ? null 14 | : DartConstructor.fromJson(e as Map)) 15 | ?.toList() ?? 16 | [], 17 | comments: (json['comments'] as List) 18 | ?.map((e) => e == null 19 | ? null 20 | : DartComment.fromJson(e as Map)) 21 | ?.toList() ?? 22 | [], 23 | fields: (json['fields'] as List) 24 | ?.map((e) => e == null 25 | ? null 26 | : DartField.fromJson(e as Map)) 27 | ?.toList() ?? 28 | [], 29 | methods: (json['methods'] as List) 30 | ?.map((e) => e == null 31 | ? null 32 | : DartMethod.fromJson(e as Map)) 33 | ?.toList() ?? 34 | [], 35 | name: json['name'] as String, 36 | isAbstract: json['isAbstract'] as bool, 37 | extendsClause: json['extendsClause'] as String, 38 | implementsClause: json['implementsClause'] as String, 39 | withClause: json['withClause'] as String, 40 | ); 41 | } 42 | 43 | Map _$_$_DartClassToJson(_$_DartClass instance) => 44 | { 45 | 'constructors': instance.constructors, 46 | 'comments': instance.comments, 47 | 'fields': instance.fields, 48 | 'methods': instance.methods, 49 | 'name': instance.name, 50 | 'isAbstract': instance.isAbstract, 51 | 'extendsClause': instance.extendsClause, 52 | 'implementsClause': instance.implementsClause, 53 | 'withClause': instance.withClause, 54 | }; 55 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/flutter_ast.dart: -------------------------------------------------------------------------------- 1 | import 'package:analyzer/dart/analysis/utilities.dart'; 2 | import 'package:analyzer/error/error.dart'; 3 | import 'package:flutter_ast_core/flutter_ast_core.dart'; 4 | 5 | import 'src/index.dart'; 6 | export 'src/index.dart'; 7 | 8 | DartResult parseSource(String source, [String path]) { 9 | assert(source != null && source.isNotEmpty); 10 | final result = parseString( 11 | content: source, 12 | path: path, 13 | throwIfDiagnostics: false, 14 | ); 15 | final root = result.unit.root; 16 | final file = root.toDartFile(); 17 | final output = DartResult(file); 18 | if (result.errors.isNotEmpty) { 19 | output.errors.addAll(result.errors); 20 | } 21 | return output; 22 | } 23 | 24 | class DartResult { 25 | DartResult(this.file); 26 | final DartFile file; 27 | final List errors = []; 28 | 29 | Map toJson() { 30 | return { 31 | 'file': file, 32 | 'errors': [ 33 | for (final error in errors) error, 34 | ], 35 | }; 36 | } 37 | 38 | @override 39 | String toString() => toJson().prettyPrint(); 40 | } 41 | 42 | extension AnalysisErrorUtils on AnalysisError { 43 | Map toJson() { 44 | return { 45 | 'message': this.message, 46 | }; 47 | } 48 | } 49 | 50 | void printMembers(CompilationUnit unit) { 51 | for (CompilationUnitMember unitMember in unit.declarations) { 52 | if (unitMember is ClassDeclaration) { 53 | print(unitMember.name.name); 54 | for (ClassMember classMember in unitMember.members) { 55 | if (classMember is MethodDeclaration) { 56 | print(' ${classMember.name}'); 57 | } else if (classMember is FieldDeclaration) { 58 | for (VariableDeclaration field in classMember.fields.variables) { 59 | print(' ${field.name.name}'); 60 | } 61 | } else if (classMember is ConstructorDeclaration) { 62 | if (classMember.name == null) { 63 | print(' ${unitMember.name.name}'); 64 | } else { 65 | print(' ${unitMember.name.name}.${classMember.name.name}'); 66 | } 67 | } 68 | } 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.example.flutter_file_based_routing" 47 | minSdkVersion flutter.minSdkVersion 48 | targetSdkVersion flutter.targetSdkVersion 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | } 52 | 53 | buildTypes { 54 | release { 55 | // TODO: Add your own signing config for the release build. 56 | // Signing with the debug keys for now, so `flutter run --release` works. 57 | signingConfig signingConfigs.debug 58 | } 59 | } 60 | } 61 | 62 | flutter { 63 | source '../..' 64 | } 65 | 66 | dependencies { 67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 68 | } 69 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/src/generator/parser.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_ast_core/flutter_ast_core.dart'; 2 | 3 | import '../../flutter_ast.dart'; 4 | 5 | class GenParser { 6 | GenParser(); 7 | 8 | List get classes => _classes.values.toList(growable: false); 9 | final Map _classes = {}; 10 | DartClass getClass(String key) => 11 | _classes.containsKey(key) ? _classes[key] : null; 12 | 13 | List get enums => _enums.toList(growable: false); 14 | final Set _enums = {}; 15 | 16 | List get fields => _fields.toList(growable: false); 17 | final Set _fields = {}; 18 | 19 | List get methods => _methods.toList(growable: false); 20 | final Set _methods = {}; 21 | 22 | List get imports => _imports.toList(growable: false); 23 | final Set _imports = {}; 24 | 25 | factory GenParser.fromString(String source) { 26 | final base = GenParser(); 27 | base.merge(source); 28 | return base; 29 | } 30 | 31 | factory GenParser.fromListString(List sources) { 32 | final base = GenParser(); 33 | for (final source in sources) { 34 | base.merge(source); 35 | } 36 | return base; 37 | } 38 | 39 | void merge(String source) { 40 | final DartResult result = parseSource(source); 41 | if (result?.file != null) { 42 | if (result?.file?.classes != null) { 43 | for (final item in result.file.classes) { 44 | this._classes.putIfAbsent(item.name, () => item); 45 | } 46 | } 47 | if (result?.file?.enums != null) { 48 | this._enums.addAll(result.file.enums); 49 | } 50 | if (result?.file?.fields != null) { 51 | this._fields.addAll(result.file.fields); 52 | } 53 | if (result?.file?.methods != null) { 54 | this._methods.addAll(result.file.methods); 55 | } 56 | if (result?.file?.imports != null) { 57 | this._imports.addAll(result.file.imports); 58 | } 59 | } 60 | } 61 | 62 | @override 63 | String toString() { 64 | final sb = StringBuffer(); 65 | sb.writeln('-- RESULTS --'); 66 | sb.writeln('Classes: ${this.classes.length}'); 67 | sb.writeln('Enums: ${this.enums.length}'); 68 | sb.writeln('Imports: ${this.imports.length}'); 69 | sb.writeln('Methods: ${this.methods.length}'); 70 | return sb.toString(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/templates/widget.dart.mustache: -------------------------------------------------------------------------------- 1 | {{#imports}} 2 | {{path}} 3 | {{/imports}} 4 | 5 | class {{class}}Base extends BaseWidget { 6 | {{class}}Base({ 7 | @required this.constructor, 8 | {{#fields}} 9 | {{type}} {{name}}, 10 | {{/fields}} 11 | }) {{constructor_divider}} 12 | {{#fields}} 13 | this._{{name}} = {{name}}, 14 | {{/fields}} 15 | { 16 | this.value = this.toJson(); 17 | } 18 | 19 | @override 20 | final String constructor; 21 | 22 | factory {{class}}Base.fromJson(Map data, String constructor) { 23 | return {{class}}Base( 24 | constructor: constructor, 25 | {{#fields}} 26 | {{name}}: {{value}}, 27 | {{/fields}} 28 | ); 29 | } 30 | 31 | factory {{class}}Base.readOnly() { 32 | return {{class}}Base( 33 | constructor: '{{class}}', 34 | {{#fields}} 35 | {{name}}: null, 36 | {{/fields}} 37 | ); 38 | } 39 | 40 | @override 41 | String get description => r""" 42 | {{description}} 43 | """; 44 | 45 | {{#fields}} 46 | {{type}} _{{name}}; 47 | {{/fields}} 48 | 49 | @override 50 | Map get properties => { 51 | {{#fields}} 52 | '{{key}}': '{{type}}', 53 | {{/fields}} 54 | }; 55 | 56 | @override 57 | void setProperty(String name, dynamic value) { 58 | switch(name) { 59 | {{#fields}} 60 | case '{{name}}': 61 | this._{{name}} = value; 62 | break; 63 | {{/fields}} 64 | default: 65 | } 66 | this.value = this.toJson(); 67 | this.notifyListeners(); 68 | } 69 | 70 | @override 71 | dynamic getProperty(String name) { 72 | switch(name) { 73 | {{#fields}} 74 | case '{{name}}': 75 | return this._{{name}}; 76 | {{/fields}} 77 | default: 78 | } 79 | return null; 80 | } 81 | 82 | @override 83 | Map toJson() { 84 | return { 85 | 'name' : '${constructor}', 86 | 'params': { 87 | {{#fields}} 88 | '{{key}}': this._{{name}}, 89 | {{/fields}} 90 | } 91 | }; 92 | } 93 | 94 | @override 95 | Map flavors(BuildContext context) { 96 | return { 97 | {{#constructors}} 98 | '{{name}}': {{widget}}, 99 | {{/constructors}} 100 | }; 101 | } 102 | 103 | @override 104 | List get constructors => [ 105 | {{#constructors}} 106 | '{{name}}', 107 | {{/constructors}} 108 | ]; 109 | } -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/templates/core.dart.mustache: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/rendering.dart'; 4 | import 'package:flutter/gestures.dart'; 5 | 6 | @mustCallSuper 7 | class TrackedWidget extends SingleChildRenderObjectWidget { 8 | TrackedWidget({ 9 | Key key, 10 | @required Widget child, 11 | @required this.controller, 12 | }) : super(key: key, child: child); 13 | 14 | final ValueNotifier controller; 15 | 16 | @override 17 | RenderObject createRenderObject(BuildContext context) { 18 | return WidgetBaseRenderObject(controller); 19 | } 20 | } 21 | 22 | @immutable 23 | class WidgetRect { 24 | final double lastDx; 25 | final double lastDy; 26 | final double lastDw; 27 | final double lastDh; 28 | 29 | WidgetRect({ 30 | this.lastDx = 0.0, 31 | this.lastDy = 0.0, 32 | this.lastDw = 0.0, 33 | this.lastDh = 0.0, 34 | }); 35 | 36 | WidgetRect copyWith({ 37 | double lastDx, 38 | double lastDy, 39 | double lastDw, 40 | double lastDh, 41 | }) { 42 | return WidgetRect( 43 | lastDx: lastDx ?? this.lastDx, 44 | lastDy: lastDy ?? this.lastDy, 45 | lastDw: lastDw ?? this.lastDw, 46 | lastDh: lastDh ?? this.lastDh, 47 | ); 48 | } 49 | } 50 | 51 | class WidgetBaseRenderObject extends RenderProxyBox { 52 | WidgetBaseRenderObject(this.controller); 53 | 54 | final ValueNotifier controller; 55 | 56 | @override 57 | void paint(PaintingContext context, Offset offset) { 58 | assert(!debugNeedsLayout); 59 | final current = controller.value; 60 | controller.value = current.copyWith(lastDx: offset.dx); 61 | controller.value = current.copyWith(lastDy: offset.dy); 62 | controller.value = current.copyWith(lastDw: size.width); 63 | controller.value = current.copyWith(lastDh: size.height); 64 | super.paint(context, offset); 65 | } 66 | } 67 | 68 | 69 | abstract class Core { 70 | dynamic get data; 71 | ValueChanged get changed; 72 | T get fallback; 73 | 74 | T get value; 75 | set value(T val); 76 | 77 | String get name => data == null ? null : data['name']; 78 | String get type => data == null ? null : data['type']; 79 | 80 | dynamic toCode(); 81 | dynamic toJson(); 82 | } 83 | 84 | class BaseCore extends Core { 85 | BaseCore(this.data, this.changed); 86 | 87 | @override 88 | Map data; 89 | 90 | @override 91 | final VoidCallback changed; 92 | 93 | @override 94 | T get value { 95 | if (data == null || data['value'] == null) { 96 | return fallback; 97 | } 98 | return data['value']; 99 | } 100 | 101 | @override 102 | set value(T val) { 103 | if (val == value) { 104 | return; 105 | } 106 | data = {'type': type, 'value': val}; 107 | changed(); 108 | } 109 | } -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | 11 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 12 | # which isn't available in 3.10. 13 | function(list_prepend LIST_NAME PREFIX) 14 | set(NEW_LIST "") 15 | foreach(element ${${LIST_NAME}}) 16 | list(APPEND NEW_LIST "${PREFIX}${element}") 17 | endforeach(element) 18 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 19 | endfunction() 20 | 21 | # === Flutter Library === 22 | # System-level dependencies. 23 | find_package(PkgConfig REQUIRED) 24 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 25 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 26 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 27 | 28 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 29 | 30 | # Published to parent scope for install step. 31 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 32 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 33 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 34 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 35 | 36 | list(APPEND FLUTTER_LIBRARY_HEADERS 37 | "fl_basic_message_channel.h" 38 | "fl_binary_codec.h" 39 | "fl_binary_messenger.h" 40 | "fl_dart_project.h" 41 | "fl_engine.h" 42 | "fl_json_message_codec.h" 43 | "fl_json_method_codec.h" 44 | "fl_message_codec.h" 45 | "fl_method_call.h" 46 | "fl_method_channel.h" 47 | "fl_method_codec.h" 48 | "fl_method_response.h" 49 | "fl_plugin_registrar.h" 50 | "fl_plugin_registry.h" 51 | "fl_standard_message_codec.h" 52 | "fl_standard_method_codec.h" 53 | "fl_string_codec.h" 54 | "fl_value.h" 55 | "fl_view.h" 56 | "flutter_linux.h" 57 | ) 58 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 59 | add_library(flutter INTERFACE) 60 | target_include_directories(flutter INTERFACE 61 | "${EPHEMERAL_DIR}" 62 | ) 63 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 64 | target_link_libraries(flutter INTERFACE 65 | PkgConfig::GTK 66 | PkgConfig::GLIB 67 | PkgConfig::GIO 68 | ) 69 | add_dependencies(flutter flutter_assemble) 70 | 71 | # === Flutter tool backend === 72 | # _phony_ is a non-existent file to force this command to run every time, 73 | # since currently there's no way to get a full input/output list from the 74 | # flutter tool. 75 | add_custom_command( 76 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 77 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 78 | COMMAND ${CMAKE_COMMAND} -E env 79 | ${FLUTTER_TOOL_ENVIRONMENT} 80 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 81 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 82 | VERBATIM 83 | ) 84 | add_custom_target(flutter_assemble DEPENDS 85 | "${FLUTTER_LIBRARY}" 86 | ${FLUTTER_LIBRARY_HEADERS} 87 | ) 88 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/core.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'core.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_DartCore _$_$_DartCoreFromJson(Map json) { 10 | return _$_DartCore( 11 | type: json['type'] as String, 12 | value: json['value'] as String, 13 | ); 14 | } 15 | 16 | Map _$_$_DartCoreToJson(_$_DartCore instance) => 17 | { 18 | 'type': instance.type, 19 | 'value': instance.value, 20 | }; 21 | 22 | _$DartProperty _$_$DartPropertyFromJson(Map json) { 23 | return _$DartProperty( 24 | name: json['name'] as String, 25 | key: json['key'] as String, 26 | type: json['type'] as String, 27 | value: json['value'] == null 28 | ? null 29 | : DartCore.fromJson(json['value'] as Map), 30 | isOptional: json['isOptional'] as bool ?? true, 31 | isNamed: json['isNamed'] as bool ?? false, 32 | isPositional: json['isPositional'] as bool ?? false, 33 | isRequired: json['isRequired'] as bool ?? false, 34 | isRequiredPositional: json['isRequiredPositional'] as bool ?? false, 35 | isSynthetic: json['isSynthetic'] as bool ?? false, 36 | isRequiredNamed: json['isRequiredNamed'] as bool ?? false, 37 | isOptionalNamed: json['isOptionalNamed'] as bool ?? false, 38 | position: json['position'] as int, 39 | ); 40 | } 41 | 42 | Map _$_$DartPropertyToJson(_$DartProperty instance) => 43 | { 44 | 'name': instance.name, 45 | 'key': instance.key, 46 | 'type': instance.type, 47 | 'value': instance.value, 48 | 'isOptional': instance.isOptional, 49 | 'isNamed': instance.isNamed, 50 | 'isPositional': instance.isPositional, 51 | 'isRequired': instance.isRequired, 52 | 'isRequiredPositional': instance.isRequiredPositional, 53 | 'isSynthetic': instance.isSynthetic, 54 | 'isRequiredNamed': instance.isRequiredNamed, 55 | 'isOptionalNamed': instance.isOptionalNamed, 56 | 'position': instance.position, 57 | }; 58 | 59 | _$DartField _$_$DartFieldFromJson(Map json) { 60 | return _$DartField( 61 | name: json['name'] as String, 62 | type: json['type'] as String, 63 | value: json['value'] == null 64 | ? null 65 | : DartCore.fromJson(json['value'] as Map), 66 | isFinal: json['isFinal'] as bool ?? false, 67 | isConst: json['isConst'] as bool ?? false, 68 | isStatic: json['isStatic'] as bool ?? false, 69 | ); 70 | } 71 | 72 | Map _$_$DartFieldToJson(_$DartField instance) => 73 | { 74 | 'name': instance.name, 75 | 'type': instance.type, 76 | 'value': instance.value, 77 | 'isFinal': instance.isFinal, 78 | 'isConst': instance.isConst, 79 | 'isStatic': instance.isStatic, 80 | }; 81 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #ifdef FLUTTER_BUILD_NUMBER 64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0 67 | #endif 68 | 69 | #ifdef FLUTTER_BUILD_NAME 70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "A new Flutter project." "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "flutter_file_based_routing" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "flutter_file_based_routing.exe" "\0" 98 | VALUE "ProductName", "flutter_file_based_routing" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/src/field.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_ast_core/flutter_ast_core.dart'; 2 | 3 | import 'analyzer.dart'; 4 | import 'index.dart'; 5 | 6 | extension FieldDeclarationImplUtils on FieldDeclarationImpl { 7 | DartField toDartField() { 8 | DartField _base; 9 | for (final node in this.root.childEntities) { 10 | if (node is VariableDeclarationListImpl) { 11 | _base = _process(node); 12 | } 13 | } 14 | return _base; 15 | } 16 | } 17 | 18 | extension TopLevelVariableDeclarationImplUtils 19 | on TopLevelVariableDeclarationImpl { 20 | DartField toDartField() { 21 | DartField _base; 22 | for (final node in this.root.childEntities) { 23 | if (node is VariableDeclarationListImpl) { 24 | _base = _process(node); 25 | } 26 | } 27 | return _base; 28 | } 29 | } 30 | 31 | extension DefaultFormalParameterImplUtils on DefaultFormalParameterImpl { 32 | DartProperty toDartProperty(List fields) { 33 | DartProperty base; 34 | bool _hasValue = false; 35 | for (final node in this.root.childEntities) { 36 | if (node is SimpleFormalParameterImpl) { 37 | base = _processProperty(node); 38 | for (final child in node.childEntities) { 39 | if (child is DeclaredSimpleIdentifier) { 40 | base = base.copyWith(name: child.toString()); 41 | } 42 | if (child is TypeNameImpl) { 43 | base = base.copyWith(type: child.toString()); 44 | } 45 | } 46 | } 47 | if (node is FieldFormalParameterImpl) { 48 | base = _processProperty(node); 49 | for (final child in node.childEntities) { 50 | if (child is SimpleIdentifierImpl) { 51 | base = base.copyWith(name: child.toString()); 52 | } 53 | } 54 | if (fields != null) 55 | for (final field in fields) { 56 | if (field.name == base.name) { 57 | base = base.copyWith(type: field.type); 58 | } 59 | } 60 | } 61 | if (node.runtimeType.toString() == 'SimpleToken' && 62 | node.toString() == '=') { 63 | _hasValue = true; 64 | continue; 65 | } 66 | if (_hasValue && node is LiteralImpl) { 67 | base = base.copyWith(value: node.toDartCore()); 68 | } 69 | } 70 | return base; 71 | } 72 | } 73 | 74 | DartField _processField(FormalParameter node) { 75 | return DartField( 76 | name: null, 77 | type: null, 78 | isConst: node.isConst, 79 | isFinal: node.isFinal, 80 | ); 81 | } 82 | 83 | DartProperty _processProperty(FormalParameter node) { 84 | return DartProperty( 85 | name: null, 86 | type: null, 87 | isNamed: node.isNamed, 88 | isOptional: node.isOptional, 89 | isPositional: node.isPositional, 90 | isRequired: node.isRequired, 91 | isRequiredPositional: node.isRequiredPositional, 92 | isSynthetic: node.isSynthetic, 93 | isRequiredNamed: node.isRequiredNamed, 94 | isOptionalNamed: node.isOptionalNamed, 95 | ); 96 | } 97 | 98 | DartField _process(VariableDeclarationListImpl node) { 99 | String _type, _name; 100 | for (final child in node.childEntities) { 101 | if (child is TypeNameImpl) { 102 | final TypeNameImpl _node = child; 103 | _type = _node.toString(); 104 | } 105 | if (child is VariableDeclarationImpl) { 106 | _name = child.name.toString(); 107 | } 108 | } 109 | return DartField( 110 | type: _type, 111 | name: _name, 112 | ); 113 | } 114 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/templates/base.dart.mustache: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/rendering.dart'; 4 | import 'package:flutter/gestures.dart'; 5 | {{#imports}} 6 | {{path}} 7 | {{/imports}} 8 | {{#classes}} 9 | 10 | class {{class}}Render extends StatelessWidget { 11 | 12 | factory {{class}}Render.fromJson(Map data, VoidCallback update) { 13 | return {{class}}Render(update, 14 | {{#fields}} 15 | {{name}}Val: BaseCore<{{type}}>(null, update), 16 | {{/fields}} 17 | ); 18 | } 19 | 20 | {{class}}Render(this._update, { 21 | {{#fields}} 22 | @required this.{{name}}Val, 23 | {{/fields}} 24 | }); 25 | 26 | @override 27 | final VoidCallback _update; 28 | 29 | {{#fields}} 30 | {{core}} {{name}}Val; 31 | 32 | {{type}} get {{name}} { 33 | return {{name}}Val.value; 34 | } 35 | 36 | set {{name}}({{type}} val) { 37 | if (val == this.{{name}}) { 38 | return; 39 | } 40 | {{name}}Val.value = val; 41 | } 42 | 43 | {{/fields}} 44 | 45 | @override 46 | Map get staticFields => { 47 | {{#static}} 48 | '{{name}}': {{value}}, 49 | {{/static}} 50 | }; 51 | 52 | @override 53 | List get props => [ 54 | {{#fields}} 55 | this.{{name}}Val, 56 | {{/fields}} 57 | ]; 58 | 59 | @override 60 | String get description { 61 | final sb = StringBuffer(); 62 | {{#comments}} 63 | sb.writeln("{{comments}}"); 64 | {{/comments}} 65 | return sb.toString(); 66 | } 67 | 68 | @override 69 | Map get constructors { 70 | return { 71 | {{#constructors}} 72 | '{{name}}': {{className}}( 73 | {{#props}} 74 | {{key}}{{separator}} this.{{name}}, 75 | {{/props}} 76 | ), 77 | {{/constructors}} 78 | }; 79 | } 80 | 81 | @override 82 | Map> get properties { 83 | return { 84 | {{#constructors}} 85 | '{{name}}': { 86 | {{#props}} 87 | '{{key}}': this.{{name}}, 88 | {{/props}} 89 | }, 90 | {{/constructors}} 91 | }; 92 | } 93 | 94 | @override 95 | Map toJson() { 96 | return { 97 | 'name': '{{class}}', 98 | 'props': { 99 | {{#fields}} 100 | '{{name}}': this.{{name}}Val.toJson(), 101 | {{/fields}} 102 | } 103 | }; 104 | } 105 | 106 | @override 107 | Map toCode() { 108 | return { 109 | {{#constructors}} 110 | '{{name}}': """{{className}}( 111 | {{#props}} 112 | {{key}}{{separator}} ${this.{{name}}Val.toCode()}, 113 | {{/props}} 114 | )""", 115 | {{/constructors}} 116 | }; 117 | } 118 | 119 | final _controller = ValueNotifier(null); 120 | ValueListenable get stats => _controller; 121 | 122 | @override 123 | Widget build(BuildContext context) { 124 | if (isWidget) return TrackedWidget( 125 | controller: _controller, 126 | child: defaultBase, 127 | ); 128 | return Container(); 129 | } 130 | 131 | @override 132 | bool get isWidget => defaultBase is Widget; 133 | 134 | @override 135 | Object get defaultBase => constructors['default']; 136 | 137 | @override 138 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 139 | super.debugFillProperties(properties); 140 | {{#fields}} 141 | properties.add(DiagnosticsProperty('{{name}}', this.{{name}})); 142 | {{/fields}} 143 | } 144 | } 145 | 146 | {{/classes}} -------------------------------------------------------------------------------- /lib/pages/root.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../generated.g.dart'; 4 | 5 | enum NavIndex { side, bottom } 6 | 7 | class RootPage extends UiRoute> { 8 | @override 9 | loader(route, args) { 10 | shouldCache = false; 11 | int sideIndex = 0; 12 | int bottomIndex = 0; 13 | if (route == '/' || route == '') { 14 | sideIndex = 0; 15 | bottomIndex = 0; 16 | } else if (route.startsWith('/about')) { 17 | sideIndex = 1; 18 | bottomIndex = 1; 19 | } else if (route == '/settings') { 20 | sideIndex = 2; 21 | bottomIndex = 2; 22 | } 23 | return { 24 | NavIndex.side: sideIndex, 25 | NavIndex.bottom: bottomIndex, 26 | }; 27 | } 28 | 29 | @override 30 | Widget builder(BuildContext context, Map data, Widget? child) { 31 | return LayoutBuilder( 32 | builder: (context, dimens) { 33 | final sideIndex = data[NavIndex.side] ?? 0; 34 | final drawer = ListView( 35 | children: [ 36 | ListTile( 37 | selected: sideIndex == 0, 38 | title: const Text('Home'), 39 | onTap: () => RoutingRequest('/').dispatch(context), 40 | trailing: const Icon(Icons.home), 41 | ), 42 | ListTile( 43 | selected: sideIndex == 1, 44 | title: const Text('About'), 45 | onTap: () => RoutingRequest('/about/').dispatch(context), 46 | trailing: InkWell( 47 | child: const Icon(Icons.person_outline), 48 | onTap: () => RoutingRequest('/about/guest').dispatch(context), 49 | ), 50 | ), 51 | ListTile( 52 | selected: sideIndex == 2, 53 | title: const Text('Settings'), 54 | onTap: () => RoutingRequest('/settings').dispatch(context), 55 | trailing: const Icon(Icons.settings), 56 | ), 57 | ], 58 | ); 59 | if (dimens.maxWidth > 720) { 60 | return Row( 61 | children: [ 62 | SizedBox( 63 | width: 300, 64 | child: Scaffold( 65 | appBar: AppBar(title: const Text('Root')), 66 | body: drawer, 67 | ), 68 | ), 69 | Expanded(child: child ?? Container()), 70 | ], 71 | ); 72 | } 73 | return Scaffold( 74 | body: child ?? Container(), 75 | bottomNavigationBar: BottomNavigationBar( 76 | currentIndex: data[NavIndex.bottom] ?? 0, 77 | items: const [ 78 | BottomNavigationBarItem( 79 | icon: Icon(Icons.home), 80 | label: 'Home', 81 | ), 82 | BottomNavigationBarItem( 83 | icon: Icon(Icons.person_outline), 84 | label: 'About', 85 | ), 86 | BottomNavigationBarItem( 87 | icon: Icon(Icons.settings), 88 | label: 'Settings', 89 | ), 90 | ], 91 | onTap: (index) { 92 | if (index == 0) { 93 | RoutingRequest('/').dispatch(context); 94 | } else if (index == 1) { 95 | RoutingRequest('/about/').dispatch(context); 96 | } else if (index == 2) { 97 | RoutingRequest('/settings').dispatch(context); 98 | } 99 | }, 100 | ), 101 | ); 102 | }, 103 | ); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(flutter_file_based_routing LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "flutter_file_based_routing") 5 | 6 | cmake_policy(SET CMP0063 NEW) 7 | 8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 9 | 10 | # Configure build options. 11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 12 | if(IS_MULTICONFIG) 13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 14 | CACHE STRING "" FORCE) 15 | else() 16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 17 | set(CMAKE_BUILD_TYPE "Debug" CACHE 18 | STRING "Flutter build mode" FORCE) 19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 20 | "Debug" "Profile" "Release") 21 | endif() 22 | endif() 23 | 24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 28 | 29 | # Use Unicode for all projects. 30 | add_definitions(-DUNICODE -D_UNICODE) 31 | 32 | # Compilation settings that should be applied to most targets. 33 | function(APPLY_STANDARD_SETTINGS TARGET) 34 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 36 | target_compile_options(${TARGET} PRIVATE /EHsc) 37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 39 | endfunction() 40 | 41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 42 | 43 | # Flutter library and tool build rules. 44 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 45 | 46 | # Application build 47 | add_subdirectory("runner") 48 | 49 | # Generated plugin build rules, which manage building the plugins and adding 50 | # them to the application. 51 | include(flutter/generated_plugins.cmake) 52 | 53 | 54 | # === Installation === 55 | # Support files are copied into place next to the executable, so that it can 56 | # run in place. This is done instead of making a separate bundle (as on Linux) 57 | # so that building and running from within Visual Studio will work. 58 | set(BUILD_BUNDLE_DIR "$") 59 | # Make the "install" step default, as it's required to run. 60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 63 | endif() 64 | 65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 67 | 68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 69 | COMPONENT Runtime) 70 | 71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 72 | COMPONENT Runtime) 73 | 74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 75 | COMPONENT Runtime) 76 | 77 | if(PLUGIN_BUNDLED_LIBRARIES) 78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 80 | COMPONENT Runtime) 81 | endif() 82 | 83 | # Fully re-copy the assets directory on each build to avoid having stale files 84 | # from a previous install. 85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 86 | install(CODE " 87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 88 | " COMPONENT Runtime) 89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 91 | 92 | # Install the AOT library on non-Debug builds only. 93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 94 | CONFIGURATIONS Profile;Release 95 | COMPONENT Runtime) 96 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/method.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'method.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_DartMethod _$_$_DartMethodFromJson(Map json) { 10 | return _$_DartMethod( 11 | name: json['name'] as String, 12 | parameters: (json['parameters'] as List) 13 | ?.map((e) => e == null 14 | ? null 15 | : DartProperty.fromJson(e as Map)) 16 | ?.toList() ?? 17 | [], 18 | body: json['body'] == null 19 | ? null 20 | : MethodNode.fromJson(json['body'] as Map), 21 | ); 22 | } 23 | 24 | Map _$_$_DartMethodToJson(_$_DartMethod instance) => 25 | { 26 | 'name': instance.name, 27 | 'parameters': instance.parameters, 28 | 'body': instance.body, 29 | }; 30 | 31 | _$MethodBase _$_$MethodBaseFromJson(Map json) { 32 | return _$MethodBase( 33 | name: json['name'] as String, 34 | ); 35 | } 36 | 37 | Map _$_$MethodBaseToJson(_$MethodBase instance) => 38 | { 39 | 'name': instance.name, 40 | }; 41 | 42 | _$MethodValues _$_$MethodValuesFromJson(Map json) { 43 | return _$MethodValues( 44 | name: json['name'] as String, 45 | values: (json['values'] as List) 46 | ?.map((e) => 47 | e == null ? null : MethodNode.fromJson(e as Map)) 48 | ?.toList(), 49 | ); 50 | } 51 | 52 | Map _$_$MethodValuesToJson(_$MethodValues instance) => 53 | { 54 | 'name': instance.name, 55 | 'values': instance.values, 56 | }; 57 | 58 | _$MethodBinary _$_$MethodBinaryFromJson(Map json) { 59 | return _$MethodBinary( 60 | name: json['name'] as String, 61 | left: json['left'] == null 62 | ? null 63 | : MethodNode.fromJson(json['left'] as Map), 64 | right: json['right'] == null 65 | ? null 66 | : MethodNode.fromJson(json['right'] as Map), 67 | operation: json['operation'] as String, 68 | ); 69 | } 70 | 71 | Map _$_$MethodBinaryToJson(_$MethodBinary instance) => 72 | { 73 | 'name': instance.name, 74 | 'left': instance.left, 75 | 'right': instance.right, 76 | 'operation': instance.operation, 77 | }; 78 | 79 | _$MethodConstructor _$_$MethodConstructorFromJson(Map json) { 80 | return _$MethodConstructor( 81 | name: json['name'] as String, 82 | value: json['value'] as String, 83 | arguments: (json['arguments'] as Map)?.map( 84 | (k, e) => MapEntry( 85 | k, 86 | e == null 87 | ? null 88 | : MethodNode.fromJson(e as Map)), 89 | ) ?? 90 | {}, 91 | ); 92 | } 93 | 94 | Map _$_$MethodConstructorToJson( 95 | _$MethodConstructor instance) => 96 | { 97 | 'name': instance.name, 98 | 'value': instance.value, 99 | 'arguments': instance.arguments, 100 | }; 101 | 102 | _$MethodSimple _$_$MethodSimpleFromJson(Map json) { 103 | return _$MethodSimple( 104 | name: json['name'] as String, 105 | value: json['value'], 106 | ); 107 | } 108 | 109 | Map _$_$MethodSimpleToJson(_$MethodSimple instance) => 110 | { 111 | 'name': instance.name, 112 | 'value': instance.value, 113 | }; 114 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 11 | 12 | # === Flutter Library === 13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 14 | 15 | # Published to parent scope for install step. 16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 20 | 21 | list(APPEND FLUTTER_LIBRARY_HEADERS 22 | "flutter_export.h" 23 | "flutter_windows.h" 24 | "flutter_messenger.h" 25 | "flutter_plugin_registrar.h" 26 | "flutter_texture_registrar.h" 27 | ) 28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 29 | add_library(flutter INTERFACE) 30 | target_include_directories(flutter INTERFACE 31 | "${EPHEMERAL_DIR}" 32 | ) 33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 34 | add_dependencies(flutter flutter_assemble) 35 | 36 | # === Wrapper === 37 | list(APPEND CPP_WRAPPER_SOURCES_CORE 38 | "core_implementations.cc" 39 | "standard_codec.cc" 40 | ) 41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 43 | "plugin_registrar.cc" 44 | ) 45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 46 | list(APPEND CPP_WRAPPER_SOURCES_APP 47 | "flutter_engine.cc" 48 | "flutter_view_controller.cc" 49 | ) 50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 51 | 52 | # Wrapper sources needed for a plugin. 53 | add_library(flutter_wrapper_plugin STATIC 54 | ${CPP_WRAPPER_SOURCES_CORE} 55 | ${CPP_WRAPPER_SOURCES_PLUGIN} 56 | ) 57 | apply_standard_settings(flutter_wrapper_plugin) 58 | set_target_properties(flutter_wrapper_plugin PROPERTIES 59 | POSITION_INDEPENDENT_CODE ON) 60 | set_target_properties(flutter_wrapper_plugin PROPERTIES 61 | CXX_VISIBILITY_PRESET hidden) 62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 63 | target_include_directories(flutter_wrapper_plugin PUBLIC 64 | "${WRAPPER_ROOT}/include" 65 | ) 66 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 67 | 68 | # Wrapper sources needed for the runner. 69 | add_library(flutter_wrapper_app STATIC 70 | ${CPP_WRAPPER_SOURCES_CORE} 71 | ${CPP_WRAPPER_SOURCES_APP} 72 | ) 73 | apply_standard_settings(flutter_wrapper_app) 74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 75 | target_include_directories(flutter_wrapper_app PUBLIC 76 | "${WRAPPER_ROOT}/include" 77 | ) 78 | add_dependencies(flutter_wrapper_app flutter_assemble) 79 | 80 | # === Flutter tool backend === 81 | # _phony_ is a non-existent file to force this command to run every time, 82 | # since currently there's no way to get a full input/output list from the 83 | # flutter tool. 84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 86 | add_custom_command( 87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 89 | ${CPP_WRAPPER_SOURCES_APP} 90 | ${PHONY_OUTPUT} 91 | COMMAND ${CMAKE_COMMAND} -E env 92 | ${FLUTTER_TOOL_ENVIRONMENT} 93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 94 | windows-x64 $ 95 | VERBATIM 96 | ) 97 | add_custom_target(flutter_assemble DEPENDS 98 | "${FLUTTER_LIBRARY}" 99 | ${FLUTTER_LIBRARY_HEADERS} 100 | ${CPP_WRAPPER_SOURCES_CORE} 101 | ${CPP_WRAPPER_SOURCES_PLUGIN} 102 | ${CPP_WRAPPER_SOURCES_APP} 103 | ) 104 | -------------------------------------------------------------------------------- /linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "flutter_file_based_routing"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "flutter_file_based_routing"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GObject::dispose. 85 | static void my_application_dispose(GObject* object) { 86 | MyApplication* self = MY_APPLICATION(object); 87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 89 | } 90 | 91 | static void my_application_class_init(MyApplicationClass* klass) { 92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 95 | } 96 | 97 | static void my_application_init(MyApplication* self) {} 98 | 99 | MyApplication* my_application_new() { 100 | return MY_APPLICATION(g_object_new(my_application_get_type(), 101 | "application-id", APPLICATION_ID, 102 | "flags", G_APPLICATION_NON_UNIQUE, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | flutter_file_based_routing 33 | 34 | 35 | 36 | 39 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.8.2" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.1.0" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.2.0" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.3.1" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.0" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.15.0" 46 | cupertino_icons: 47 | dependency: "direct main" 48 | description: 49 | name: cupertino_icons 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.0.4" 53 | fake_async: 54 | dependency: transitive 55 | description: 56 | name: fake_async 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.2.0" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_lints: 66 | dependency: "direct dev" 67 | description: 68 | name: flutter_lints 69 | url: "https://pub.dartlang.org" 70 | source: hosted 71 | version: "1.0.4" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | lints: 78 | dependency: transitive 79 | description: 80 | name: lints 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "1.0.1" 84 | matcher: 85 | dependency: transitive 86 | description: 87 | name: matcher 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "0.12.11" 91 | meta: 92 | dependency: transitive 93 | description: 94 | name: meta 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "1.7.0" 98 | path: 99 | dependency: transitive 100 | description: 101 | name: path 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.8.0" 105 | sky_engine: 106 | dependency: transitive 107 | description: flutter 108 | source: sdk 109 | version: "0.0.99" 110 | source_span: 111 | dependency: transitive 112 | description: 113 | name: source_span 114 | url: "https://pub.dartlang.org" 115 | source: hosted 116 | version: "1.8.1" 117 | stack_trace: 118 | dependency: transitive 119 | description: 120 | name: stack_trace 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "1.10.0" 124 | stream_channel: 125 | dependency: transitive 126 | description: 127 | name: stream_channel 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "2.1.0" 131 | string_scanner: 132 | dependency: transitive 133 | description: 134 | name: string_scanner 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "1.1.0" 138 | term_glyph: 139 | dependency: transitive 140 | description: 141 | name: term_glyph 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "1.2.0" 145 | test_api: 146 | dependency: transitive 147 | description: 148 | name: test_api 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "0.4.7" 152 | typed_data: 153 | dependency: transitive 154 | description: 155 | name: typed_data 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "1.3.0" 159 | vector_math: 160 | dependency: transitive 161 | description: 162 | name: vector_math 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "2.1.1" 166 | sdks: 167 | dart: ">=2.15.0-285.0.dev <3.0.0" 168 | -------------------------------------------------------------------------------- /linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(runner LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "flutter_file_based_routing") 5 | set(APPLICATION_ID "com.example.flutter_file_based_routing") 6 | 7 | cmake_policy(SET CMP0063 NEW) 8 | 9 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 10 | 11 | # Root filesystem for cross-building. 12 | if(FLUTTER_TARGET_PLATFORM_SYSROOT) 13 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) 14 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) 15 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 16 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 17 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 18 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 19 | endif() 20 | 21 | # Configure build options. 22 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 23 | set(CMAKE_BUILD_TYPE "Debug" CACHE 24 | STRING "Flutter build mode" FORCE) 25 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 26 | "Debug" "Profile" "Release") 27 | endif() 28 | 29 | # Compilation settings that should be applied to most targets. 30 | function(APPLY_STANDARD_SETTINGS TARGET) 31 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 32 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 33 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 34 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 35 | endfunction() 36 | 37 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 38 | 39 | # Flutter library and tool build rules. 40 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 41 | 42 | # System-level dependencies. 43 | find_package(PkgConfig REQUIRED) 44 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 45 | 46 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 47 | 48 | # Application build 49 | add_executable(${BINARY_NAME} 50 | "main.cc" 51 | "my_application.cc" 52 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 53 | ) 54 | apply_standard_settings(${BINARY_NAME}) 55 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 56 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 57 | add_dependencies(${BINARY_NAME} flutter_assemble) 58 | # Only the install-generated bundle's copy of the executable will launch 59 | # correctly, since the resources must in the right relative locations. To avoid 60 | # people trying to run the unbundled copy, put it in a subdirectory instead of 61 | # the default top-level location. 62 | set_target_properties(${BINARY_NAME} 63 | PROPERTIES 64 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" 65 | ) 66 | 67 | # Generated plugin build rules, which manage building the plugins and adding 68 | # them to the application. 69 | include(flutter/generated_plugins.cmake) 70 | 71 | 72 | # === Installation === 73 | # By default, "installing" just makes a relocatable bundle in the build 74 | # directory. 75 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 76 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 77 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 78 | endif() 79 | 80 | # Start with a clean build bundle directory every time. 81 | install(CODE " 82 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 83 | " COMPONENT Runtime) 84 | 85 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 86 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 87 | 88 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 89 | COMPONENT Runtime) 90 | 91 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 92 | COMPONENT Runtime) 93 | 94 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 95 | COMPONENT Runtime) 96 | 97 | if(PLUGIN_BUNDLED_LIBRARIES) 98 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 99 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 100 | COMPONENT Runtime) 101 | endif() 102 | 103 | # Fully re-copy the assets directory on each build to avoid having stale files 104 | # from a previous install. 105 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 106 | install(CODE " 107 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 108 | " COMPONENT Runtime) 109 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 110 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 111 | 112 | # Install the AOT library on non-Debug builds only. 113 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 114 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 115 | COMPONENT Runtime) 116 | endif() 117 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/comment.freezed.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | // ignore_for_file: deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies 3 | 4 | part of 'comment.dart'; 5 | 6 | // ************************************************************************** 7 | // FreezedGenerator 8 | // ************************************************************************** 9 | 10 | T _$identity(T value) => value; 11 | DartComment _$DartCommentFromJson(Map json) { 12 | return _DartComment.fromJson(json); 13 | } 14 | 15 | /// @nodoc 16 | class _$DartCommentTearOff { 17 | const _$DartCommentTearOff(); 18 | 19 | // ignore: unused_element 20 | _DartComment call({List lines = const []}) { 21 | return _DartComment( 22 | lines: lines, 23 | ); 24 | } 25 | 26 | // ignore: unused_element 27 | DartComment fromJson(Map json) { 28 | return DartComment.fromJson(json); 29 | } 30 | } 31 | 32 | /// @nodoc 33 | // ignore: unused_element 34 | const $DartComment = _$DartCommentTearOff(); 35 | 36 | /// @nodoc 37 | mixin _$DartComment { 38 | List get lines; 39 | 40 | Map toJson(); 41 | $DartCommentCopyWith get copyWith; 42 | } 43 | 44 | /// @nodoc 45 | abstract class $DartCommentCopyWith<$Res> { 46 | factory $DartCommentCopyWith( 47 | DartComment value, $Res Function(DartComment) then) = 48 | _$DartCommentCopyWithImpl<$Res>; 49 | $Res call({List lines}); 50 | } 51 | 52 | /// @nodoc 53 | class _$DartCommentCopyWithImpl<$Res> implements $DartCommentCopyWith<$Res> { 54 | _$DartCommentCopyWithImpl(this._value, this._then); 55 | 56 | final DartComment _value; 57 | // ignore: unused_field 58 | final $Res Function(DartComment) _then; 59 | 60 | @override 61 | $Res call({ 62 | Object lines = freezed, 63 | }) { 64 | return _then(_value.copyWith( 65 | lines: lines == freezed ? _value.lines : lines as List, 66 | )); 67 | } 68 | } 69 | 70 | /// @nodoc 71 | abstract class _$DartCommentCopyWith<$Res> 72 | implements $DartCommentCopyWith<$Res> { 73 | factory _$DartCommentCopyWith( 74 | _DartComment value, $Res Function(_DartComment) then) = 75 | __$DartCommentCopyWithImpl<$Res>; 76 | @override 77 | $Res call({List lines}); 78 | } 79 | 80 | /// @nodoc 81 | class __$DartCommentCopyWithImpl<$Res> extends _$DartCommentCopyWithImpl<$Res> 82 | implements _$DartCommentCopyWith<$Res> { 83 | __$DartCommentCopyWithImpl( 84 | _DartComment _value, $Res Function(_DartComment) _then) 85 | : super(_value, (v) => _then(v as _DartComment)); 86 | 87 | @override 88 | _DartComment get _value => super._value as _DartComment; 89 | 90 | @override 91 | $Res call({ 92 | Object lines = freezed, 93 | }) { 94 | return _then(_DartComment( 95 | lines: lines == freezed ? _value.lines : lines as List, 96 | )); 97 | } 98 | } 99 | 100 | @JsonSerializable() 101 | 102 | /// @nodoc 103 | class _$_DartComment implements _DartComment { 104 | const _$_DartComment({this.lines = const []}) : assert(lines != null); 105 | 106 | factory _$_DartComment.fromJson(Map json) => 107 | _$_$_DartCommentFromJson(json); 108 | 109 | @JsonKey(defaultValue: const []) 110 | @override 111 | final List lines; 112 | 113 | @override 114 | String toString() { 115 | return 'DartComment(lines: $lines)'; 116 | } 117 | 118 | @override 119 | bool operator ==(dynamic other) { 120 | return identical(this, other) || 121 | (other is _DartComment && 122 | (identical(other.lines, lines) || 123 | const DeepCollectionEquality().equals(other.lines, lines))); 124 | } 125 | 126 | @override 127 | int get hashCode => 128 | runtimeType.hashCode ^ const DeepCollectionEquality().hash(lines); 129 | 130 | @override 131 | _$DartCommentCopyWith<_DartComment> get copyWith => 132 | __$DartCommentCopyWithImpl<_DartComment>(this, _$identity); 133 | 134 | @override 135 | Map toJson() { 136 | return _$_$_DartCommentToJson(this); 137 | } 138 | } 139 | 140 | abstract class _DartComment implements DartComment { 141 | const factory _DartComment({List lines}) = _$_DartComment; 142 | 143 | factory _DartComment.fromJson(Map json) = 144 | _$_DartComment.fromJson; 145 | 146 | @override 147 | List get lines; 148 | @override 149 | _$DartCommentCopyWith<_DartComment> get copyWith; 150 | } 151 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![github pages](https://github.com/rodydavis/flutter_file_based_routing/actions/workflows/main.yml/badge.svg)](https://github.com/rodydavis/flutter_file_based_routing/actions/workflows/main.yml) 2 | 3 | # Flutter File Based Routing 4 | 5 | I was inspired by the routing in [remix.run](https://remix.run/) with nested layouts and server side components so I decided to experiment with flutter. 6 | 7 | Since this needs to be at compile time I wrote a generator to parse the pages directory for file based routing path names to define the regex like [regex_router](https://pub.dev/packages/regex_router). 8 | 9 | [Demo](https://rodydavis.github.io/flutter_file_based_routing/) 10 | 11 | Archived in favor of: https://github.com/rodydavis/vscode-router-generator 12 | 13 | ## Installation 14 | 15 | You need to install dart locally on your machine then you can run the following at your project directory: 16 | 17 | ``` 18 | dart generator/bin/main.dart 19 | ``` 20 | 21 | This will generate a `generated.g.dart` which can be used to import the generated widget to run the application. 22 | 23 | ```dart 24 | import 'package:flutter/material.dart'; 25 | 26 | import 'generated.g.dart'; 27 | 28 | void main() { 29 | runApp(GeneratedApp( 30 | themeMode: ThemeMode.system, 31 | theme: ThemeData.light(), 32 | darkTheme: ThemeData.dark(), 33 | )); 34 | } 35 | 36 | ``` 37 | 38 | I also included a `router.dart` that is needed by the generator and all local widgets. 39 | 40 | ## Defining a base layout 41 | 42 | You can define a base layout with the root name. For example: `about.dart` 43 | 44 | ```dart 45 | import 'package:flutter/material.dart'; 46 | 47 | import '../generated.g.dart'; 48 | 49 | class AboutPage extends UiRoute { 50 | @override 51 | Widget builder(BuildContext context, void data, Widget? child) { 52 | return Scaffold( 53 | appBar: AppBar( 54 | title: const Text('About'), 55 | ), 56 | body: child, 57 | ); 58 | } 59 | } 60 | 61 | ``` 62 | 63 | If you notice the child can be null and is used for the nested layout. 64 | 65 | This is not a widget but instead a class we can use to optionally load data in. 66 | 67 | ## Defining the index route 68 | 69 | You can define the index route for when there are no args needed. For example: `about/index.dart` 70 | 71 | ```dart 72 | import 'package:flutter/material.dart'; 73 | 74 | import '../../generated.g.dart'; 75 | 76 | class AboutDetails extends UiRoute { 77 | @override 78 | Widget builder(BuildContext context, void data, Widget? child) { 79 | return const Center( 80 | child: Text('About'), 81 | ); 82 | } 83 | } 84 | 85 | ``` 86 | 87 | Since this is a nested layout all you need to do is provide the component and it will inherit from the parent layout (about.dart). 88 | 89 | ## Defining a named arg 90 | 91 | You can define a named arg for a route if there is something that does not need data fetched for. For example: `/about/guest.dart` 92 | 93 | ```dart 94 | import 'package:flutter/material.dart'; 95 | 96 | import '../../generated.g.dart'; 97 | 98 | class GuestPage extends UiRoute { 99 | @override 100 | Widget builder(BuildContext context, void data, Widget? child) { 101 | return const Center( 102 | child: Text('Guest'), 103 | ); 104 | } 105 | } 106 | 107 | ``` 108 | 109 | This is also just a component. 110 | 111 | ## Defining a dynamic arg 112 | 113 | Sometimes the arg is generated at runtime or needs to be pulled from a database. For example: `about/:id.dart` 114 | 115 | ```dart 116 | import 'package:flutter/material.dart'; 117 | 118 | import '../../generated.g.dart'; 119 | 120 | class AccountPage extends UiRoute> { 121 | @override 122 | loader(route, args) => args; 123 | 124 | @override 125 | Widget builder( 126 | BuildContext context, Map data, Widget? child) { 127 | return Center( 128 | child: Text('ID: ${data['id']}'), 129 | ); 130 | } 131 | } 132 | 133 | ``` 134 | 135 | You can see we set the file name with a prefix of `:` to define an arg to look for and match against. This will be provided in a map. 136 | 137 | The loader can be used to pull data from a database but in this case it returns the arg map. By default it returns null. 138 | 139 | The loader runs before the widget is built. 140 | 141 | ## Routing 142 | 143 | To navigate to another page, instead of using `Navigator.of(context)` you will need to dispatch the following event: 144 | 145 | ```dart 146 | RoutingRequest('ROUTE_HERE').dispatch(context) 147 | ``` 148 | 149 | `ROUTE_HERE` should be the named of your route like `/about/30`. 150 | 151 | ## Storing state 152 | 153 | Everything should be stateless, but in the example you can see that even bottom tab navigation index can be done just with the route. 154 | 155 | ## Conclusion 156 | 157 | This solves a variety of layout issues and can provide pretty urls while also only loading the data once and caching if needed. 158 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/enum.freezed.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | // ignore_for_file: deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies 3 | 4 | part of 'enum.dart'; 5 | 6 | // ************************************************************************** 7 | // FreezedGenerator 8 | // ************************************************************************** 9 | 10 | T _$identity(T value) => value; 11 | DartEnum _$DartEnumFromJson(Map json) { 12 | return _DartEnum.fromJson(json); 13 | } 14 | 15 | /// @nodoc 16 | class _$DartEnumTearOff { 17 | const _$DartEnumTearOff(); 18 | 19 | // ignore: unused_element 20 | _DartEnum call({@required String name, @required List values}) { 21 | return _DartEnum( 22 | name: name, 23 | values: values, 24 | ); 25 | } 26 | 27 | // ignore: unused_element 28 | DartEnum fromJson(Map json) { 29 | return DartEnum.fromJson(json); 30 | } 31 | } 32 | 33 | /// @nodoc 34 | // ignore: unused_element 35 | const $DartEnum = _$DartEnumTearOff(); 36 | 37 | /// @nodoc 38 | mixin _$DartEnum { 39 | String get name; 40 | List get values; 41 | 42 | Map toJson(); 43 | $DartEnumCopyWith get copyWith; 44 | } 45 | 46 | /// @nodoc 47 | abstract class $DartEnumCopyWith<$Res> { 48 | factory $DartEnumCopyWith(DartEnum value, $Res Function(DartEnum) then) = 49 | _$DartEnumCopyWithImpl<$Res>; 50 | $Res call({String name, List values}); 51 | } 52 | 53 | /// @nodoc 54 | class _$DartEnumCopyWithImpl<$Res> implements $DartEnumCopyWith<$Res> { 55 | _$DartEnumCopyWithImpl(this._value, this._then); 56 | 57 | final DartEnum _value; 58 | // ignore: unused_field 59 | final $Res Function(DartEnum) _then; 60 | 61 | @override 62 | $Res call({ 63 | Object name = freezed, 64 | Object values = freezed, 65 | }) { 66 | return _then(_value.copyWith( 67 | name: name == freezed ? _value.name : name as String, 68 | values: values == freezed ? _value.values : values as List, 69 | )); 70 | } 71 | } 72 | 73 | /// @nodoc 74 | abstract class _$DartEnumCopyWith<$Res> implements $DartEnumCopyWith<$Res> { 75 | factory _$DartEnumCopyWith(_DartEnum value, $Res Function(_DartEnum) then) = 76 | __$DartEnumCopyWithImpl<$Res>; 77 | @override 78 | $Res call({String name, List values}); 79 | } 80 | 81 | /// @nodoc 82 | class __$DartEnumCopyWithImpl<$Res> extends _$DartEnumCopyWithImpl<$Res> 83 | implements _$DartEnumCopyWith<$Res> { 84 | __$DartEnumCopyWithImpl(_DartEnum _value, $Res Function(_DartEnum) _then) 85 | : super(_value, (v) => _then(v as _DartEnum)); 86 | 87 | @override 88 | _DartEnum get _value => super._value as _DartEnum; 89 | 90 | @override 91 | $Res call({ 92 | Object name = freezed, 93 | Object values = freezed, 94 | }) { 95 | return _then(_DartEnum( 96 | name: name == freezed ? _value.name : name as String, 97 | values: values == freezed ? _value.values : values as List, 98 | )); 99 | } 100 | } 101 | 102 | @JsonSerializable() 103 | 104 | /// @nodoc 105 | class _$_DartEnum implements _DartEnum { 106 | const _$_DartEnum({@required this.name, @required this.values}) 107 | : assert(name != null), 108 | assert(values != null); 109 | 110 | factory _$_DartEnum.fromJson(Map json) => 111 | _$_$_DartEnumFromJson(json); 112 | 113 | @override 114 | final String name; 115 | @override 116 | final List values; 117 | 118 | @override 119 | String toString() { 120 | return 'DartEnum(name: $name, values: $values)'; 121 | } 122 | 123 | @override 124 | bool operator ==(dynamic other) { 125 | return identical(this, other) || 126 | (other is _DartEnum && 127 | (identical(other.name, name) || 128 | const DeepCollectionEquality().equals(other.name, name)) && 129 | (identical(other.values, values) || 130 | const DeepCollectionEquality().equals(other.values, values))); 131 | } 132 | 133 | @override 134 | int get hashCode => 135 | runtimeType.hashCode ^ 136 | const DeepCollectionEquality().hash(name) ^ 137 | const DeepCollectionEquality().hash(values); 138 | 139 | @override 140 | _$DartEnumCopyWith<_DartEnum> get copyWith => 141 | __$DartEnumCopyWithImpl<_DartEnum>(this, _$identity); 142 | 143 | @override 144 | Map toJson() { 145 | return _$_$_DartEnumToJson(this); 146 | } 147 | } 148 | 149 | abstract class _DartEnum implements DartEnum { 150 | const factory _DartEnum( 151 | {@required String name, @required List values}) = _$_DartEnum; 152 | 153 | factory _DartEnum.fromJson(Map json) = _$_DartEnum.fromJson; 154 | 155 | @override 156 | String get name; 157 | @override 158 | List get values; 159 | @override 160 | _$DartEnumCopyWith<_DartEnum> get copyWith; 161 | } 162 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/third_party/flutter_ast_core/lib/src/constructor.freezed.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | // ignore_for_file: deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies 3 | 4 | part of 'constructor.dart'; 5 | 6 | // ************************************************************************** 7 | // FreezedGenerator 8 | // ************************************************************************** 9 | 10 | T _$identity(T value) => value; 11 | DartConstructor _$DartConstructorFromJson(Map json) { 12 | return _DartConstructor.fromJson(json); 13 | } 14 | 15 | /// @nodoc 16 | class _$DartConstructorTearOff { 17 | const _$DartConstructorTearOff(); 18 | 19 | // ignore: unused_element 20 | _DartConstructor call( 21 | {@required String name, List properties = const []}) { 22 | return _DartConstructor( 23 | name: name, 24 | properties: properties, 25 | ); 26 | } 27 | 28 | // ignore: unused_element 29 | DartConstructor fromJson(Map json) { 30 | return DartConstructor.fromJson(json); 31 | } 32 | } 33 | 34 | /// @nodoc 35 | // ignore: unused_element 36 | const $DartConstructor = _$DartConstructorTearOff(); 37 | 38 | /// @nodoc 39 | mixin _$DartConstructor { 40 | String get name; 41 | List get properties; 42 | 43 | Map toJson(); 44 | $DartConstructorCopyWith get copyWith; 45 | } 46 | 47 | /// @nodoc 48 | abstract class $DartConstructorCopyWith<$Res> { 49 | factory $DartConstructorCopyWith( 50 | DartConstructor value, $Res Function(DartConstructor) then) = 51 | _$DartConstructorCopyWithImpl<$Res>; 52 | $Res call({String name, List properties}); 53 | } 54 | 55 | /// @nodoc 56 | class _$DartConstructorCopyWithImpl<$Res> 57 | implements $DartConstructorCopyWith<$Res> { 58 | _$DartConstructorCopyWithImpl(this._value, this._then); 59 | 60 | final DartConstructor _value; 61 | // ignore: unused_field 62 | final $Res Function(DartConstructor) _then; 63 | 64 | @override 65 | $Res call({ 66 | Object name = freezed, 67 | Object properties = freezed, 68 | }) { 69 | return _then(_value.copyWith( 70 | name: name == freezed ? _value.name : name as String, 71 | properties: properties == freezed 72 | ? _value.properties 73 | : properties as List, 74 | )); 75 | } 76 | } 77 | 78 | /// @nodoc 79 | abstract class _$DartConstructorCopyWith<$Res> 80 | implements $DartConstructorCopyWith<$Res> { 81 | factory _$DartConstructorCopyWith( 82 | _DartConstructor value, $Res Function(_DartConstructor) then) = 83 | __$DartConstructorCopyWithImpl<$Res>; 84 | @override 85 | $Res call({String name, List properties}); 86 | } 87 | 88 | /// @nodoc 89 | class __$DartConstructorCopyWithImpl<$Res> 90 | extends _$DartConstructorCopyWithImpl<$Res> 91 | implements _$DartConstructorCopyWith<$Res> { 92 | __$DartConstructorCopyWithImpl( 93 | _DartConstructor _value, $Res Function(_DartConstructor) _then) 94 | : super(_value, (v) => _then(v as _DartConstructor)); 95 | 96 | @override 97 | _DartConstructor get _value => super._value as _DartConstructor; 98 | 99 | @override 100 | $Res call({ 101 | Object name = freezed, 102 | Object properties = freezed, 103 | }) { 104 | return _then(_DartConstructor( 105 | name: name == freezed ? _value.name : name as String, 106 | properties: properties == freezed 107 | ? _value.properties 108 | : properties as List, 109 | )); 110 | } 111 | } 112 | 113 | @JsonSerializable() 114 | 115 | /// @nodoc 116 | class _$_DartConstructor implements _DartConstructor { 117 | const _$_DartConstructor({@required this.name, this.properties = const []}) 118 | : assert(name != null), 119 | assert(properties != null); 120 | 121 | factory _$_DartConstructor.fromJson(Map json) => 122 | _$_$_DartConstructorFromJson(json); 123 | 124 | @override 125 | final String name; 126 | @JsonKey(defaultValue: const []) 127 | @override 128 | final List properties; 129 | 130 | @override 131 | String toString() { 132 | return 'DartConstructor(name: $name, properties: $properties)'; 133 | } 134 | 135 | @override 136 | bool operator ==(dynamic other) { 137 | return identical(this, other) || 138 | (other is _DartConstructor && 139 | (identical(other.name, name) || 140 | const DeepCollectionEquality().equals(other.name, name)) && 141 | (identical(other.properties, properties) || 142 | const DeepCollectionEquality() 143 | .equals(other.properties, properties))); 144 | } 145 | 146 | @override 147 | int get hashCode => 148 | runtimeType.hashCode ^ 149 | const DeepCollectionEquality().hash(name) ^ 150 | const DeepCollectionEquality().hash(properties); 151 | 152 | @override 153 | _$DartConstructorCopyWith<_DartConstructor> get copyWith => 154 | __$DartConstructorCopyWithImpl<_DartConstructor>(this, _$identity); 155 | 156 | @override 157 | Map toJson() { 158 | return _$_$_DartConstructorToJson(this); 159 | } 160 | } 161 | 162 | abstract class _DartConstructor implements DartConstructor { 163 | const factory _DartConstructor( 164 | {@required String name, 165 | List properties}) = _$_DartConstructor; 166 | 167 | factory _DartConstructor.fromJson(Map json) = 168 | _$_DartConstructor.fromJson; 169 | 170 | @override 171 | String get name; 172 | @override 173 | List get properties; 174 | @override 175 | _$DartConstructorCopyWith<_DartConstructor> get copyWith; 176 | } 177 | -------------------------------------------------------------------------------- /generator/third_party/flutter_ast/lib/src/method.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_ast_core/flutter_ast_core.dart'; 2 | 3 | import 'analyzer.dart'; 4 | import 'core.dart'; 5 | 6 | extension MethodDeclarationImplUtils on MethodDeclarationImpl { 7 | DartMethod toDartMethod(DartClass parent) { 8 | return DartMethod( 9 | name: this.name.toString(), 10 | body: _check(this), 11 | ); 12 | } 13 | } 14 | 15 | extension FunctionBodyImplUtils on FunctionBodyImpl { 16 | DartMethod toDartMethod(DartClass parent) { 17 | return DartMethod( 18 | name: null, 19 | body: _check(this), 20 | ); 21 | } 22 | } 23 | 24 | extension FunctionDeclarationImplUtils on FunctionDeclarationImpl { 25 | DartMethod toDartMethod() { 26 | return DartMethod( 27 | name: this.name.toString(), 28 | body: _check(this), 29 | ); 30 | } 31 | } 32 | 33 | MethodNode _check(SyntacticEntity node) { 34 | if (node is FunctionDeclarationImpl) { 35 | return _processFunctionDeclaration(node); 36 | } 37 | if (node is MethodDeclarationImpl) { 38 | return _processMethodDeclarationImpl(node); 39 | } 40 | if (node is FunctionExpressionImpl) { 41 | return _processFunction(node); 42 | } 43 | if (node is DeclaredSimpleIdentifier) { 44 | return _processDeclaration(node); 45 | } 46 | if (node is MethodInvocationImpl) { 47 | return _processMethod(node); 48 | } 49 | if (node is ReturnStatementImpl) { 50 | return _processReturn(node); 51 | } 52 | if (node is IfStatementImpl) { 53 | return _processIfStatement(node); 54 | } 55 | if (node is ConditionalExpressionImpl) { 56 | return _processConditional(node); 57 | } 58 | if (node is BlockFunctionBodyImpl) { 59 | return _processBlockBody(node); 60 | } 61 | if (node is BlockImpl) { 62 | return _processBlock(node); 63 | } 64 | if (node is BinaryExpressionImpl) { 65 | return _processBinary(node); 66 | } 67 | if (node is SimpleIdentifierImpl) { 68 | return MethodNode.simple( 69 | name: 'name', 70 | value: node.name, 71 | ); 72 | } 73 | if (node is LiteralImpl) { 74 | return MethodNode.simple( 75 | name: 'value', 76 | value: node.toDartCore(), 77 | ); 78 | } 79 | if (node is TypeNameImpl) { 80 | return MethodNode.simple( 81 | name: 'type', 82 | value: node.toString(), 83 | ); 84 | } 85 | return null; 86 | } 87 | 88 | MethodNode _processFunctionDeclaration(FunctionDeclarationImpl node) { 89 | final List values = []; 90 | for (final child in node.childEntities) { 91 | _checkAndAdd(child, values); 92 | } 93 | return MethodNode.values( 94 | name: 'function_declaration', 95 | values: values, 96 | ); 97 | } 98 | 99 | MethodNode _processMethodDeclarationImpl(MethodDeclarationImpl node) { 100 | final List values = []; 101 | for (final child in node.childEntities) { 102 | _checkAndAdd(child, values); 103 | } 104 | return MethodNode.values( 105 | name: 'method_declaration', 106 | values: values, 107 | ); 108 | } 109 | 110 | MethodNode _processIfStatement(IfStatementImpl node) { 111 | final List values = []; 112 | for (final child in node.childEntities) { 113 | _checkAndAdd(child, values); 114 | } 115 | return MethodNode.values( 116 | name: 'if', 117 | values: values, 118 | ); 119 | } 120 | 121 | MethodNode _processFunction(FunctionExpressionImpl node) { 122 | final List values = []; 123 | for (final child in node.childEntities) { 124 | _checkAndAdd(child, values); 125 | } 126 | return MethodNode.values( 127 | name: 'function', 128 | values: values, 129 | ); 130 | } 131 | 132 | MethodNode _processDeclaration(DeclaredSimpleIdentifier node) { 133 | final List values = []; 134 | // Check name meta getter/setter 135 | for (final child in node.childEntities) { 136 | _checkAndAdd(child, values); 137 | } 138 | return MethodNode.values( 139 | name: 'declaration', 140 | values: values, 141 | ); 142 | } 143 | 144 | MethodNode _processMethod(MethodInvocationImpl node) { 145 | final Map arguments = {}; 146 | final args = node.argumentList; 147 | for (var i = 0; i < args.arguments.length; i++) { 148 | final arg = args.arguments[i]; 149 | if (arg is LiteralImpl) { 150 | arguments['$i'] = MethodNode.simple( 151 | name: 'value', 152 | value: arg.toDartCore(), 153 | ); 154 | } 155 | if (arg is NamedExpressionImpl) { 156 | arguments[arg.name.label.toString()] = _check(arg.expression); 157 | } 158 | } 159 | return MethodNode.constructor( 160 | name: 'constructor', 161 | value: node.methodName.name, 162 | arguments: arguments, 163 | ); 164 | } 165 | 166 | MethodNode _processBinary(BinaryExpressionImpl node) { 167 | final _children = node.childEntities.toList(); 168 | return MethodNode.binary( 169 | name: 'binary', 170 | left: _check(_children[0]), 171 | right: _check(_children[2]), 172 | operation: _children[1].toString(), 173 | ); 174 | } 175 | 176 | MethodNode _processConditional(ConditionalExpressionImpl node) { 177 | final List values = []; 178 | for (final child in node.childEntities) { 179 | _checkAndAdd(child, values); 180 | } 181 | return MethodNode.values( 182 | name: 'conditional', 183 | values: values, 184 | ); 185 | } 186 | 187 | MethodNode _processReturn(ReturnStatementImpl node) { 188 | final List values = []; 189 | for (final child in node.childEntities) { 190 | _checkAndAdd(child, values); 191 | } 192 | return MethodNode.values( 193 | name: 'return', 194 | values: values, 195 | ); 196 | } 197 | 198 | MethodNode _processBlock(BlockImpl node) { 199 | final List values = []; 200 | for (final child in node.childEntities) { 201 | _checkAndAdd(child, values); 202 | } 203 | return MethodNode.values( 204 | name: 'block', 205 | values: values, 206 | ); 207 | } 208 | 209 | MethodNode _processBlockBody(BlockFunctionBodyImpl node) { 210 | final List values = []; 211 | for (final child in node.childEntities) { 212 | _checkAndAdd(child, values); 213 | } 214 | return MethodNode.values( 215 | name: 'block_body', 216 | values: values, 217 | ); 218 | } 219 | 220 | void _checkAndAdd(SyntacticEntity child, List values) { 221 | final _value = _check(child); 222 | if (_value != null && _value.name != null) { 223 | values.add(_value); 224 | } 225 | } 226 | -------------------------------------------------------------------------------- /generator/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "9.0.0" 11 | analyzer: 12 | dependency: transitive 13 | description: 14 | name: analyzer 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "0.39.0" 18 | args: 19 | dependency: transitive 20 | description: 21 | name: args 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.6.0" 25 | async: 26 | dependency: transitive 27 | description: 28 | name: async 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.8.2" 32 | build_cli_annotations: 33 | dependency: transitive 34 | description: 35 | name: build_cli_annotations 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.2.0" 39 | charcode: 40 | dependency: transitive 41 | description: 42 | name: charcode 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.3.1" 46 | clock: 47 | dependency: transitive 48 | description: 49 | name: clock 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.1.0" 53 | collection: 54 | dependency: transitive 55 | description: 56 | name: collection 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.15.0" 60 | console: 61 | dependency: transitive 62 | description: 63 | name: console 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "3.1.0" 67 | convert: 68 | dependency: transitive 69 | description: 70 | name: convert 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "2.1.1" 74 | crypto: 75 | dependency: transitive 76 | description: 77 | name: crypto 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "2.1.5" 81 | csslib: 82 | dependency: transitive 83 | description: 84 | name: csslib 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "0.16.2" 88 | file: 89 | dependency: transitive 90 | description: 91 | name: file 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "5.2.1" 95 | flutter_ast: 96 | dependency: "direct main" 97 | description: 98 | path: "third_party/flutter_ast" 99 | relative: true 100 | source: path 101 | version: "1.0.0+1" 102 | flutter_ast_core: 103 | dependency: transitive 104 | description: 105 | path: "third_party/flutter_ast/third_party/flutter_ast_core" 106 | relative: true 107 | source: path 108 | version: "0.0.1" 109 | freezed_annotation: 110 | dependency: transitive 111 | description: 112 | name: freezed_annotation 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "1.1.0" 116 | front_end: 117 | dependency: transitive 118 | description: 119 | name: front_end 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "0.1.28" 123 | glob: 124 | dependency: transitive 125 | description: 126 | name: glob 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "1.2.0" 130 | html: 131 | dependency: transitive 132 | description: 133 | name: html 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "0.14.0+4" 137 | intl: 138 | dependency: transitive 139 | description: 140 | name: intl 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "0.17.0" 144 | js: 145 | dependency: transitive 146 | description: 147 | name: js 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "0.6.3" 151 | json_annotation: 152 | dependency: transitive 153 | description: 154 | name: json_annotation 155 | url: "https://pub.dartlang.org" 156 | source: hosted 157 | version: "4.4.0" 158 | kernel: 159 | dependency: transitive 160 | description: 161 | name: kernel 162 | url: "https://pub.dartlang.org" 163 | source: hosted 164 | version: "0.3.28" 165 | meta: 166 | dependency: transitive 167 | description: 168 | name: meta 169 | url: "https://pub.dartlang.org" 170 | source: hosted 171 | version: "1.7.0" 172 | mustache_template: 173 | dependency: transitive 174 | description: 175 | name: mustache_template 176 | url: "https://pub.dartlang.org" 177 | source: hosted 178 | version: "1.0.0+1" 179 | node_interop: 180 | dependency: transitive 181 | description: 182 | name: node_interop 183 | url: "https://pub.dartlang.org" 184 | source: hosted 185 | version: "1.2.1" 186 | node_io: 187 | dependency: transitive 188 | description: 189 | name: node_io 190 | url: "https://pub.dartlang.org" 191 | source: hosted 192 | version: "1.2.0" 193 | package_config: 194 | dependency: transitive 195 | description: 196 | name: package_config 197 | url: "https://pub.dartlang.org" 198 | source: hosted 199 | version: "1.9.3" 200 | path: 201 | dependency: transitive 202 | description: 203 | name: path 204 | url: "https://pub.dartlang.org" 205 | source: hosted 206 | version: "1.8.1" 207 | pedantic: 208 | dependency: transitive 209 | description: 210 | name: pedantic 211 | url: "https://pub.dartlang.org" 212 | source: hosted 213 | version: "1.11.1" 214 | pub_semver: 215 | dependency: transitive 216 | description: 217 | name: pub_semver 218 | url: "https://pub.dartlang.org" 219 | source: hosted 220 | version: "1.4.4" 221 | recase: 222 | dependency: transitive 223 | description: 224 | name: recase 225 | url: "https://pub.dartlang.org" 226 | source: hosted 227 | version: "3.0.1" 228 | source_span: 229 | dependency: transitive 230 | description: 231 | name: source_span 232 | url: "https://pub.dartlang.org" 233 | source: hosted 234 | version: "1.8.1" 235 | string_scanner: 236 | dependency: transitive 237 | description: 238 | name: string_scanner 239 | url: "https://pub.dartlang.org" 240 | source: hosted 241 | version: "1.1.0" 242 | term_glyph: 243 | dependency: transitive 244 | description: 245 | name: term_glyph 246 | url: "https://pub.dartlang.org" 247 | source: hosted 248 | version: "1.2.0" 249 | typed_data: 250 | dependency: transitive 251 | description: 252 | name: typed_data 253 | url: "https://pub.dartlang.org" 254 | source: hosted 255 | version: "1.3.0" 256 | vector_math: 257 | dependency: transitive 258 | description: 259 | name: vector_math 260 | url: "https://pub.dartlang.org" 261 | source: hosted 262 | version: "2.1.1" 263 | watcher: 264 | dependency: transitive 265 | description: 266 | name: watcher 267 | url: "https://pub.dartlang.org" 268 | source: hosted 269 | version: "0.9.7+15" 270 | yaml: 271 | dependency: transitive 272 | description: 273 | name: yaml 274 | url: "https://pub.dartlang.org" 275 | source: hosted 276 | version: "2.2.1" 277 | sdks: 278 | dart: ">=2.14.0 <3.0.0" 279 | --------------------------------------------------------------------------------