diff --git a/examples/flutter_demo/lib/src/preview_target_1.dart b/examples/flutter_demo/lib/samples/preview_target_1.dart similarity index 100% rename from examples/flutter_demo/lib/src/preview_target_1.dart rename to examples/flutter_demo/lib/samples/preview_target_1.dart diff --git a/examples/flutter_demo/lib/samples/preview_target_2.dart b/examples/flutter_demo/lib/samples/preview_target_2.dart new file mode 100644 index 0000000..b257c9c --- /dev/null +++ b/examples/flutter_demo/lib/samples/preview_target_2.dart @@ -0,0 +1,73 @@ +import 'package:flutter/material.dart'; + +enum WidgetVariant { loading, loaded, error } + +class Data { + final String name; + final String description; + + Data(this.name, this.description); +} + +class Sample2Widget extends StatelessWidget { + final String name; + // final Function() onTap; + final int radius; + final String? description; + final Color? color; + final bool enabled; + final CrossAxisAlignment alignment; + final WidgetVariant variant; + + const Sample2Widget( + this.name, { + // required this.onTap, + required this.radius, + this.description, + this.color, + this.enabled = false, + this.alignment = CrossAxisAlignment.start, + this.variant = WidgetVariant.loaded, + super.key, + }); + + String variantText() { + switch (variant) { + case WidgetVariant.loading: + return "Loading..."; + case WidgetVariant.loaded: + return "Loaded"; + case WidgetVariant.error: + return "Error"; + } + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + // onTap: this.onTap, + child: Opacity( + opacity: enabled ? 1 : 0.5, + child: Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(this.radius.toDouble()), + color: this.color ?? Colors.blue), + child: Column(crossAxisAlignment: this.alignment, children: [ + Text( + this.name, + style: TextStyle(fontSize: 21, color: Colors.white), + ), + SizedBox(height: 8), + Text( + this.description ?? '', + style: TextStyle(fontSize: 14, color: Colors.white), + ), + Text( + this.variantText(), + style: TextStyle(fontSize: 14, color: Colors.white), + ), + ]), + ))); + } +} diff --git a/flutter-ast/flutter-ast-node/index.d.ts b/flutter-ast/flutter-ast-node/index.d.ts index 0842130..86d59dc 100644 --- a/flutter-ast/flutter-ast-node/index.d.ts +++ b/flutter-ast/flutter-ast-node/index.d.ts @@ -80,7 +80,7 @@ interface DartConstructor extends AstNode { interface DartProperty extends DartCore { /** - * @default true + * @default false */ isOptional: boolean; diff --git a/flutter-ast/flutter-ast-node/package.json b/flutter-ast/flutter-ast-node/package.json index 2385661..b8bc2a9 100644 --- a/flutter-ast/flutter-ast-node/package.json +++ b/flutter-ast/flutter-ast-node/package.json @@ -1,6 +1,6 @@ { "name": "flutter-ast", - "version": "0.0.4-3", + "version": "0.0.4-4", "description": "A Pure Dart File to Ast Serializer/Deserializer.", "main": "index.js", "typings": "index.d.ts", diff --git a/flutter-ast/flutter_ast/examples/example.dart b/flutter-ast/flutter_ast/examples/example.dart index b35a422..9bbd97f 100644 --- a/flutter-ast/flutter_ast/examples/example.dart +++ b/flutter-ast/flutter_ast/examples/example.dart @@ -5,7 +5,7 @@ import "package:path/path.dart" show dirname, join; // read file from ./samples/sample.dart -final sample = 'constructor_2'; +final sample = 'constructor_properties_1'; final String source = File(join(dirname(Platform.script.path), "../test_samples/${sample}.dart")) diff --git a/flutter-ast/flutter_ast/pubspec.lock b/flutter-ast/flutter_ast/pubspec.lock index febbfa5..5b78f96 100644 --- a/flutter-ast/flutter_ast/pubspec.lock +++ b/flutter-ast/flutter_ast/pubspec.lock @@ -5,593 +5,519 @@ packages: dependency: "direct main" description: name: _fe_analyzer_shared - sha256: "0c80aeab9bc807ab10022cd3b2f4cf2ecdf231949dc1ddd9442406a003f19201" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "52.0.0" analyzer: dependency: "direct main" description: name: analyzer - sha256: cd8ee83568a77f3ae6b913a36093a1c9b1264e7cb7f834d9ddd2311dade9c1f4 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "5.4.0" args: dependency: transitive description: name: args - sha256: "139d809800a412ebb26a3892da228b2d0ba36f0ef5d9a82166e5e52ec8d61611" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.3.2" + version: "2.4.0" async: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.10.0" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" build: dependency: transitive description: name: build - sha256: "3fbda25365741f8251b39f3917fb3c8e286a96fd068a5a242e11c2012d495777" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.3.1" build_cli: dependency: "direct dev" description: name: build_cli - sha256: "9c9184dab45983b011cdb315f8d3f3ffb5b4088e33f56502b40daa074d3e8ed5" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.2.1" build_cli_annotations: dependency: "direct main" description: name: build_cli_annotations - sha256: b59d2769769efd6c9ff6d4c4cede0be115a566afc591705c2040b707534b1172 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" build_config: dependency: transitive description: name: build_config - sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - sha256: "6bc5544ea6ce4428266e7ea680e945c68806c4aae2da0eb5e9ccf38df8d6acbf" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.1.0" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "7c35a3a7868626257d8aee47b51c26b9dba11eaddf3431117ed2744951416aab" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" build_runner: dependency: "direct dev" description: name: build_runner - sha256: b0a8a7b8a76c493e85f1b84bffa0588859a06197863dba8c9036b15581fd9727 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.3.3" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "14febe0f5bac5ae474117a36099b4de6f1dbc52df6c5e55534b3da9591bf4292" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "7.2.7" built_collection: dependency: transitive description: name: built_collection - sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - sha256: "169565c8ad06adb760c3645bf71f00bff161b00002cace266cad42c5d22a7725" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "8.4.3" checked_yaml: dependency: transitive description: name: checked_yaml - sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" cli_util: dependency: transitive description: name: cli_util - sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "0.3.5" code_builder: dependency: transitive description: name: code_builder - sha256: "0d43dd1288fd145de1ecc9a3948ad4a6d5a82f0a14c4fdd0892260787d975cbe" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "4.4.0" collection: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.17.1" console: dependency: "direct main" description: name: console - sha256: e04e7824384c5b39389acdd6dc7d33f3efe6b232f6f16d7626f194f6a01ad69a - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "4.1.0" convert: dependency: transitive description: name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.1.1" coverage: dependency: transitive description: name: coverage - sha256: "961c4aebd27917269b1896382c7cb1b1ba81629ba669ba09c27a7e5710ec9040" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" + version: "1.6.3" crypto: dependency: transitive description: name: crypto - sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.0.2" dart_style: dependency: transitive description: name: dart_style - sha256: "7a03456c3490394c8e7665890333e91ae8a49be43542b616e414449ac358acd4" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.2.4" file: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "6.1.4" fixnum: dependency: transitive description: name: fixnum - sha256: "04be3e934c52e082558cc9ee21f42f5c1cd7a1262f4c63cd0357c08d5bba81ec" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" flutter_ast_core: dependency: "direct main" description: name: flutter_ast_core - sha256: "3ed3e0edf198d884b4907aaf4054efc9af0b0bd3705c4561ca492e82a1d88b56" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.0.4+1" + version: "0.0.4+3" freezed_annotation: dependency: transitive description: name: freezed_annotation - sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0" frontend_server_client: dependency: transitive description: name: frontend_server_client - sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.2.0" glob: dependency: transitive description: name: glob - sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" graphs: dependency: transitive description: name: graphs - sha256: f9e130f3259f52d26f0cfc0e964513796dafed572fa52e45d2f8d6ca14db39b2 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0" grinder: dependency: "direct dev" description: name: grinder - sha256: b24948a441fc65d07bc8b219d7ee8d6cc0af4cdb13823e0d3be6d848eb787b04 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.9.2" + version: "0.9.3" http_multi_server: dependency: transitive description: name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "4.0.2" io: dependency: transitive description: name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.4" js: dependency: transitive description: name: js - sha256: "323b7c70073cccf6b9b8d8b334be418a3293cfb612a560dc2737160a37bf61bd" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.6.6" + version: "0.6.5" json_annotation: dependency: transitive description: name: json_annotation - sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "4.8.0" logging: dependency: transitive description: name: logging - sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.1.1" matcher: dependency: transitive description: name: matcher - sha256: c94db23593b89766cda57aab9ac311e3616cf87c6fa4e9749df032f66f30dcb8 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "0.12.14" meta: dependency: transitive description: name: meta - sha256: "12307e7f0605ce3da64cf0db90e5fcab0869f3ca03f76be6bb2991ce0a55e82b" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.9.0" mime: dependency: transitive description: name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.4" mustache_template: dependency: "direct main" description: name: mustache_template - sha256: a46e26f91445bfb0b60519be280555b06792460b27b19e2b19ad5b9740df5d1c - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" node_preamble: dependency: "direct dev" description: name: node_preamble - sha256: "8ebdbaa3b96d5285d068f80772390d27c21e1fa10fb2df6627b1b9415043608d" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" package_config: dependency: transitive description: name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" path: dependency: "direct main" description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.8.3" pool: dependency: transitive description: name: pool - sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.5.1" pub_semver: dependency: transitive description: name: pub_semver - sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.3" pubspec_parse: dependency: transitive description: name: pubspec_parse - sha256: "75f6614d6dde2dc68948dffbaa4fe5dae32cd700eb9fb763fe11dfb45a3c4d0a" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.2.1" recase: dependency: "direct main" description: name: recase - sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "4.1.0" shelf: dependency: transitive description: name: shelf - sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.4.0" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler - sha256: aef74dc9195746a384843102142ab65b6a4735bb3beea791e63527b88cc83306 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.0.1" shelf_static: dependency: transitive description: name: shelf_static - sha256: e792b76b96a36d4a41b819da593aff4bdd413576b3ba6150df5d8d9996d2e74c - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.1.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" source_gen: dependency: transitive description: name: source_gen - sha256: c2bea18c95cfa0276a366270afaa2850b09b4a76db95d546f3d003dcc7011298 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.2.7" source_helper: dependency: transitive description: name: source_helper - sha256: "3b67aade1d52416149c633ba1bb36df44d97c6b51830c2198e934e3fca87ca1f" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.3.3" source_map_stack_trace: dependency: transitive description: name: source_map_stack_trace - sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" source_maps: dependency: transitive description: name: source_maps - sha256: "490098075234dcedb83c5d949b4c93dad5e6b7702748de000be2b57b8e6b2427" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.10.11" + version: "0.10.12" source_span: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" stream_transform: dependency: transitive description: name: stream_transform - sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.2.1" test: dependency: "direct dev" description: name: test - sha256: b54d427664c00f2013ffb87797a698883c46aee9288e027a50b46eaee7486fa2 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.22.2" + version: "1.23.1" test_api: dependency: transitive description: name: test_api - sha256: "6182294da5abf431177fccc1ee02401f6df30f766bc6130a0852c6b6d7ee6b2d" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "0.4.18" test_core: dependency: transitive description: name: test_core - sha256: "95ecc12692d0dd59080ab2d38d9cf32c7e9844caba23ff6cd285690398ee8ef4" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.4.22" + version: "0.4.24" timing: dependency: transitive description: name: timing - sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" typed_data: dependency: transitive description: name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.3.1" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.4" vm_service: dependency: transitive description: name: vm_service - sha256: "2277c73618916ae3c2082b6df67b6ebb64b4c69d9bf23b23700707952ac30e60" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "10.1.2" + version: "11.0.1" watcher: dependency: transitive description: name: watcher - sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: ca49c0bc209c687b887f30527fb6a9d80040b072cc2990f34b9bec3e7663101b - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.3.0" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol - sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" yaml: dependency: transitive description: name: yaml - sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.1.1" sdks: - dart: ">=2.19.0-345.0.dev <4.0.0" + dart: ">=2.18.0 <3.0.0" diff --git a/flutter-ast/flutter_ast/pubspec.yaml b/flutter-ast/flutter_ast/pubspec.yaml index 4974051..a24f985 100644 --- a/flutter-ast/flutter_ast/pubspec.yaml +++ b/flutter-ast/flutter_ast/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_ast description: A Pure Dart File to Ast Serializer/Deserializer. -version: 0.0.4+1 +version: 0.0.4+3 homepage: https://github.com/gridaco/flutter-support/tree/main/flutter_ast/ license: MIT @@ -15,7 +15,7 @@ dependencies: mustache_template: ^2.0.0 _fe_analyzer_shared: ^52.0.0 recase: ^4.1.0 - flutter_ast_core: ^0.0.4+1 + flutter_ast_core: ^0.0.4+3 # flutter_ast_core: # path: ../flutter_ast_core diff --git a/flutter-ast/flutter_ast/test_samples/constructor_properties_1.dart b/flutter-ast/flutter_ast/test_samples/constructor_properties_1.dart new file mode 100644 index 0000000..c72a06e --- /dev/null +++ b/flutter-ast/flutter_ast/test_samples/constructor_properties_1.dart @@ -0,0 +1,33 @@ +//ignore_for_file: uri_does_not_exist,undefined_class,extends_non_class,undefined_named_parameter,undefined_method,undefined_identifier,super_formal_parameter_without_associated_named,creation_with_non_type,non_constant_default_value + +import 'package:flutter/material.dart'; + +class PressableCard extends StatefulWidget { + const PressableCard({ + required this.child, + this.borderRadius = const BorderRadius.all(Radius.circular(5)), + this.upElevation = 2, + this.downElevation = 0, + this.shadowColor = CupertinoColors.black, + this.duration = const Duration(milliseconds: 100), + this.onPressed, + super.key, + }); + + final VoidCallback? onPressed; + + final Widget child; + + final BorderRadius borderRadius; + + final double upElevation; + + final double downElevation; + + final Color shadowColor; + + final Duration duration; + + @override + State createState() => _PressableCardState(); +} diff --git a/flutter-ast/flutter_ast/test_samples/constructor_properties_1.json b/flutter-ast/flutter_ast/test_samples/constructor_properties_1.json new file mode 100644 index 0000000..4c828bc --- /dev/null +++ b/flutter-ast/flutter_ast/test_samples/constructor_properties_1.json @@ -0,0 +1,298 @@ +{ + "file": { + "path": null, + "classes": [ + { + "offset": 276, + "end": 920, + "constructors": [ + { + "offset": 323, + "end": 633, + "name": "PressableCard", + "properties": [ + { + "offset": 349, + "end": 368, + "name": "child", + "key": null, + "type": "Widget", + "value": null, + "isOptional": false, + "isNamed": true, + "isPositional": false, + "isRequired": true, + "isRequiredPositional": false, + "isSynthetic": false, + "isRequiredNamed": true, + "isOptionalNamed": false, + "position": null, + "runtimeType": "property" + }, + { + "offset": 374, + "end": 391, + "name": "borderRadius", + "key": null, + "type": "BorderRadius", + "value": null, + "isOptional": true, + "isNamed": true, + "isPositional": false, + "isRequired": false, + "isRequiredPositional": false, + "isSynthetic": false, + "isRequiredNamed": false, + "isOptionalNamed": true, + "position": null, + "runtimeType": "property" + }, + { + "offset": 442, + "end": 458, + "name": "upElevation", + "key": null, + "type": "double", + "value": { + "offset": 461, + "end": 462, + "type": "int", + "value": "2", + "runtimeType": "default" + }, + "isOptional": true, + "isNamed": true, + "isPositional": false, + "isRequired": false, + "isRequiredPositional": false, + "isSynthetic": false, + "isRequiredNamed": false, + "isOptionalNamed": true, + "position": null, + "runtimeType": "property" + }, + { + "offset": 468, + "end": 486, + "name": "downElevation", + "key": null, + "type": "double", + "value": { + "offset": 489, + "end": 490, + "type": "int", + "value": "0", + "runtimeType": "default" + }, + "isOptional": true, + "isNamed": true, + "isPositional": false, + "isRequired": false, + "isRequiredPositional": false, + "isSynthetic": false, + "isRequiredNamed": false, + "isOptionalNamed": true, + "position": null, + "runtimeType": "property" + }, + { + "offset": 496, + "end": 512, + "name": "shadowColor", + "key": null, + "type": "Color", + "value": null, + "isOptional": true, + "isNamed": true, + "isPositional": false, + "isRequired": false, + "isRequiredPositional": false, + "isSynthetic": false, + "isRequiredNamed": false, + "isOptionalNamed": true, + "position": null, + "runtimeType": "property" + }, + { + "offset": 542, + "end": 555, + "name": "duration", + "key": null, + "type": "Duration", + "value": null, + "isOptional": true, + "isNamed": true, + "isPositional": false, + "isRequired": false, + "isRequiredPositional": false, + "isSynthetic": false, + "isRequiredNamed": false, + "isOptionalNamed": true, + "position": null, + "runtimeType": "property" + }, + { + "offset": 597, + "end": 611, + "name": "onPressed", + "key": null, + "type": "VoidCallback?", + "value": null, + "isOptional": true, + "isNamed": true, + "isPositional": false, + "isRequired": false, + "isRequiredPositional": false, + "isSynthetic": false, + "isRequiredNamed": false, + "isOptionalNamed": true, + "position": null, + "runtimeType": "property" + }, + { + "offset": 617, + "end": 626, + "name": "key", + "key": null, + "type": null, + "value": null, + "isOptional": true, + "isNamed": true, + "isPositional": false, + "isRequired": false, + "isRequiredPositional": false, + "isSynthetic": false, + "isRequiredNamed": false, + "isOptionalNamed": true, + "position": null, + "runtimeType": "property" + } + ] + } + ], + "comments": [], + "fields": [ + { + "offset": 637, + "end": 666, + "name": "onPressed", + "type": "VoidCallback?", + "value": null, + "isFinal": false, + "isConst": false, + "isStatic": false, + "runtimeType": "field" + }, + { + "offset": 671, + "end": 689, + "name": "child", + "type": "Widget", + "value": null, + "isFinal": false, + "isConst": false, + "isStatic": false, + "runtimeType": "field" + }, + { + "offset": 694, + "end": 725, + "name": "borderRadius", + "type": "BorderRadius", + "value": null, + "isFinal": false, + "isConst": false, + "isStatic": false, + "runtimeType": "field" + }, + { + "offset": 730, + "end": 754, + "name": "upElevation", + "type": "double", + "value": null, + "isFinal": false, + "isConst": false, + "isStatic": false, + "runtimeType": "field" + }, + { + "offset": 759, + "end": 785, + "name": "downElevation", + "type": "double", + "value": null, + "isFinal": false, + "isConst": false, + "isStatic": false, + "runtimeType": "field" + }, + { + "offset": 790, + "end": 813, + "name": "shadowColor", + "type": "Color", + "value": null, + "isFinal": false, + "isConst": false, + "isStatic": false, + "runtimeType": "field" + }, + { + "offset": 818, + "end": 841, + "name": "duration", + "type": "Duration", + "value": null, + "isFinal": false, + "isConst": false, + "isStatic": false, + "runtimeType": "field" + } + ], + "methods": [ + { + "offset": 846, + "end": 918, + "name": "createState", + "parameters": [], + "body": { + "offset": 846, + "end": 918, + "name": "method_declaration", + "values": [ + { + "offset": 858, + "end": 878, + "name": "type", + "value": "State", + "runtimeType": "simple" + } + ], + "runtimeType": "values" + } + } + ], + "name": "PressableCard", + "isAbstract": false, + "extendsClause": "extends StatefulWidget", + "implementsClause": null, + "withClause": null + } + ], + "enums": [], + "fields": [], + "imports": [ + { + "offset": 235, + "end": 274, + "uri": "package:flutter/material.dart", + "prefix": null, + "show": [], + "hide": [] + } + ], + "methods": [] + }, + "errors": [] +} diff --git a/flutter-ast/flutter_ast/test_samples/constructor_properties_2.dart b/flutter-ast/flutter_ast/test_samples/constructor_properties_2.dart new file mode 100644 index 0000000..7e342d3 --- /dev/null +++ b/flutter-ast/flutter_ast/test_samples/constructor_properties_2.dart @@ -0,0 +1,18 @@ +//ignore_for_file: uri_does_not_exist,undefined_class,extends_non_class,undefined_named_parameter,undefined_method,undefined_identifier,super_formal_parameter_without_associated_named,creation_with_non_type,non_constant_default_value + +import 'package:flutter/material.dart'; + +class VeggieCard extends StatelessWidget { + const VeggieCard(this.veggie, this.isInSeason, this.isPreferredCategory, + {super.key}); + + /// Veggie to be displayed by the card. + final Veggie veggie; + + /// If the veggie is in season, it's displayed more prominently and the + /// image is fully saturated. Otherwise, it's reduced and de-saturated. + final bool isInSeason; + + /// Whether [veggie] falls into one of user's preferred [VeggieCategory]s + final bool isPreferredCategory; +} diff --git a/flutter-ast/flutter_ast/test_samples/constructor_properties_2.json b/flutter-ast/flutter_ast/test_samples/constructor_properties_2.json new file mode 100644 index 0000000..1de4dd2 --- /dev/null +++ b/flutter-ast/flutter_ast/test_samples/constructor_properties_2.json @@ -0,0 +1,148 @@ +{ + "file": { + "path": null, + "classes": [ + { + "offset": 276, + "end": 766, + "constructors": [ + { + "offset": 321, + "end": 413, + "name": "VeggieCard", + "properties": [ + { + "offset": 338, + "end": 349, + "name": "veggie", + "key": null, + "type": "Veggie", + "value": null, + "isOptional": false, + "isNamed": false, + "isPositional": false, + "isRequired": false, + "isRequiredPositional": false, + "isSynthetic": false, + "isRequiredNamed": false, + "isOptionalNamed": false, + "position": null, + "runtimeType": "property" + }, + { + "offset": 351, + "end": 366, + "name": "isInSeason", + "key": null, + "type": "bool", + "value": null, + "isOptional": false, + "isNamed": false, + "isPositional": false, + "isRequired": false, + "isRequiredPositional": false, + "isSynthetic": false, + "isRequiredNamed": false, + "isOptionalNamed": false, + "position": null, + "runtimeType": "property" + }, + { + "offset": 368, + "end": 392, + "name": "isPreferredCategory", + "key": null, + "type": "bool", + "value": null, + "isOptional": false, + "isNamed": false, + "isPositional": false, + "isRequired": false, + "isRequiredPositional": false, + "isSynthetic": false, + "isRequiredNamed": false, + "isOptionalNamed": false, + "position": null, + "runtimeType": "property" + }, + { + "offset": 401, + "end": 410, + "name": "key", + "key": null, + "type": null, + "value": null, + "isOptional": true, + "isNamed": true, + "isPositional": false, + "isRequired": false, + "isRequiredPositional": false, + "isSynthetic": false, + "isRequiredNamed": false, + "isOptionalNamed": true, + "position": null, + "runtimeType": "property" + } + ] + } + ], + "comments": [], + "fields": [ + { + "offset": 459, + "end": 478, + "name": "veggie", + "type": "Veggie", + "value": null, + "isFinal": false, + "isConst": false, + "isStatic": false, + "runtimeType": "field" + }, + { + "offset": 631, + "end": 652, + "name": "isInSeason", + "type": "bool", + "value": null, + "isFinal": false, + "isConst": false, + "isStatic": false, + "runtimeType": "field" + }, + { + "offset": 733, + "end": 763, + "name": "isPreferredCategory", + "type": "bool", + "value": null, + "isFinal": false, + "isConst": false, + "isStatic": false, + "runtimeType": "field" + } + ], + "methods": [], + "name": "VeggieCard", + "isAbstract": false, + "extendsClause": "extends StatelessWidget", + "implementsClause": null, + "withClause": null + } + ], + "enums": [], + "fields": [], + "imports": [ + { + "offset": 235, + "end": 274, + "uri": "package:flutter/material.dart", + "prefix": null, + "show": [], + "hide": [] + } + ], + "methods": [] + }, + "errors": [] +} diff --git a/flutter-ast/flutter_ast_core/lib/src/core.dart b/flutter-ast/flutter_ast_core/lib/src/core.dart index 871fc82..82ad099 100644 --- a/flutter-ast/flutter_ast_core/lib/src/core.dart +++ b/flutter-ast/flutter_ast_core/lib/src/core.dart @@ -19,7 +19,7 @@ abstract class DartCore extends AstNode with _$DartCore { String? key, required String? type, DartCore? value, - @Default(true) bool isOptional, + @Default(false) bool isOptional, @Default(false) bool isNamed, @Default(false) bool isPositional, @Default(false) bool isRequired, diff --git a/flutter-ast/flutter_ast_core/lib/src/core.freezed.dart b/flutter-ast/flutter_ast_core/lib/src/core.freezed.dart index 93bcf11..8206861 100644 --- a/flutter-ast/flutter_ast_core/lib/src/core.freezed.dart +++ b/flutter-ast/flutter_ast_core/lib/src/core.freezed.dart @@ -581,7 +581,7 @@ class _$DartProperty implements DartProperty { this.key, required this.type, this.value, - this.isOptional = true, + this.isOptional = false, this.isNamed = false, this.isPositional = false, this.isRequired = false, diff --git a/flutter-ast/flutter_ast_core/lib/src/core.g.dart b/flutter-ast/flutter_ast_core/lib/src/core.g.dart index 16df9af..db56c30 100644 --- a/flutter-ast/flutter_ast_core/lib/src/core.g.dart +++ b/flutter-ast/flutter_ast_core/lib/src/core.g.dart @@ -33,7 +33,7 @@ _$DartProperty _$$DartPropertyFromJson(Map json) => value: json['value'] == null ? null : DartCore.fromJson(json['value'] as Map), - isOptional: json['isOptional'] as bool? ?? true, + isOptional: json['isOptional'] as bool? ?? false, isNamed: json['isNamed'] as bool? ?? false, isPositional: json['isPositional'] as bool? ?? false, isRequired: json['isRequired'] as bool? ?? false, diff --git a/flutter-ast/flutter_ast_core/pubspec.lock b/flutter-ast/flutter_ast_core/pubspec.lock index 7bbde8d..8f4a935 100644 --- a/flutter-ast/flutter_ast_core/pubspec.lock +++ b/flutter-ast/flutter_ast_core/pubspec.lock @@ -5,441 +5,386 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "0c80aeab9bc807ab10022cd3b2f4cf2ecdf231949dc1ddd9442406a003f19201" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "52.0.0" + version: "53.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: cd8ee83568a77f3ae6b913a36093a1c9b1264e7cb7f834d9ddd2311dade9c1f4 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "5.4.0" + version: "5.5.0" args: dependency: transitive description: name: args - sha256: "139d809800a412ebb26a3892da228b2d0ba36f0ef5d9a82166e5e52ec8d61611" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.3.2" + version: "2.4.0" async: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.10.0" build: dependency: transitive description: name: build - sha256: "3fbda25365741f8251b39f3917fb3c8e286a96fd068a5a242e11c2012d495777" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.3.1" build_config: dependency: transitive description: name: build_config - sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - sha256: "6bc5544ea6ce4428266e7ea680e945c68806c4aae2da0eb5e9ccf38df8d6acbf" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.1.0" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "7c35a3a7868626257d8aee47b51c26b9dba11eaddf3431117ed2744951416aab" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" build_runner: dependency: "direct dev" description: name: build_runner - sha256: b0a8a7b8a76c493e85f1b84bffa0588859a06197863dba8c9036b15581fd9727 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.3.3" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "14febe0f5bac5ae474117a36099b4de6f1dbc52df6c5e55534b3da9591bf4292" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "7.2.7" built_collection: dependency: transitive description: name: built_collection - sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - sha256: "169565c8ad06adb760c3645bf71f00bff161b00002cace266cad42c5d22a7725" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "8.4.3" checked_yaml: dependency: transitive description: name: checked_yaml - sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" code_builder: dependency: transitive description: name: code_builder - sha256: "0d43dd1288fd145de1ecc9a3948ad4a6d5a82f0a14c4fdd0892260787d975cbe" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "4.4.0" collection: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.17.1" convert: dependency: transitive description: name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.1.1" crypto: dependency: transitive description: name: crypto - sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.0.2" dart_style: dependency: transitive description: name: dart_style - sha256: "7a03456c3490394c8e7665890333e91ae8a49be43542b616e414449ac358acd4" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.2.4" file: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "6.1.4" fixnum: dependency: transitive description: name: fixnum - sha256: "04be3e934c52e082558cc9ee21f42f5c1cd7a1262f4c63cd0357c08d5bba81ec" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" freezed: dependency: "direct dev" description: name: freezed - sha256: e819441678f1679b719008ff2ff0ef045d66eed9f9ec81166ca0d9b02a187454 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.3.2" freezed_annotation: dependency: "direct main" description: name: freezed_annotation - sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0" frontend_server_client: dependency: transitive description: name: frontend_server_client - sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.2.0" glob: dependency: transitive description: name: glob - sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" graphs: dependency: transitive description: name: graphs - sha256: f9e130f3259f52d26f0cfc0e964513796dafed572fa52e45d2f8d6ca14db39b2 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0" http_multi_server: dependency: transitive description: name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "4.0.2" io: dependency: transitive description: name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.4" js: dependency: transitive description: name: js - sha256: "323b7c70073cccf6b9b8d8b334be418a3293cfb612a560dc2737160a37bf61bd" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.6.6" + version: "0.6.5" json_annotation: dependency: "direct main" description: name: json_annotation - sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "4.8.0" json_serializable: dependency: "direct dev" description: name: json_serializable - sha256: dadc08bd61f72559f938dd08ec20dbfec6c709bba83515085ea943d2078d187a - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "6.6.1" logging: dependency: transitive description: name: logging - sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.1.1" matcher: dependency: transitive description: name: matcher - sha256: c94db23593b89766cda57aab9ac311e3616cf87c6fa4e9749df032f66f30dcb8 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "0.12.14" meta: dependency: transitive description: name: meta - sha256: "12307e7f0605ce3da64cf0db90e5fcab0869f3ca03f76be6bb2991ce0a55e82b" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.9.0" mime: dependency: transitive description: name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.4" package_config: dependency: transitive description: name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.8.3" pool: dependency: transitive description: name: pool - sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.5.1" pub_semver: dependency: transitive description: name: pub_semver - sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.3" pubspec_parse: dependency: transitive description: name: pubspec_parse - sha256: "75f6614d6dde2dc68948dffbaa4fe5dae32cd700eb9fb763fe11dfb45a3c4d0a" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.2.1" shelf: dependency: transitive description: name: shelf - sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.4.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" source_gen: dependency: transitive description: name: source_gen - sha256: c2bea18c95cfa0276a366270afaa2850b09b4a76db95d546f3d003dcc7011298 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.2.7" source_helper: dependency: transitive description: name: source_helper - sha256: "3b67aade1d52416149c633ba1bb36df44d97c6b51830c2198e934e3fca87ca1f" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.3.3" source_span: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" stream_transform: dependency: transitive description: name: stream_transform - sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.2.1" timing: dependency: transitive description: name: timing - sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" typed_data: dependency: transitive description: name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.3.1" watcher: dependency: transitive description: name: watcher - sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: ca49c0bc209c687b887f30527fb6a9d80040b072cc2990f34b9bec3e7663101b - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.3.0" yaml: dependency: transitive description: name: yaml - sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.1.1" sdks: - dart: ">=2.19.0-345.0.dev <4.0.0" + dart: ">=2.18.0 <3.0.0" diff --git a/flutter-ast/flutter_ast_core/pubspec.yaml b/flutter-ast/flutter_ast_core/pubspec.yaml index 2562e6e..524983e 100644 --- a/flutter-ast/flutter_ast_core/pubspec.yaml +++ b/flutter-ast/flutter_ast_core/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_ast_core description: Flutter AST Parser Core models for flutter_ast -version: 0.0.4+1 +version: 0.0.4+3 homepage: https://github.com/gridaco/flutter-support/tree/main/flutter_ast/flutter_ast_core license: MIT diff --git a/flutter-builder/scripts/package.json b/flutter-builder/scripts/package.json deleted file mode 100644 index d24423b..0000000 --- a/flutter-builder/scripts/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "dart-doc-parser", - "version": "0.0.1", - "repository": "https://github.com/bridgedxyz/flutter-builder", - "author": "Grida, Inc.", - "license": "MIT", - "private": false, - "main": "dist/index.js", - "dependencies": { - "axios": "^0.21.0", - "coli": "^0.0.2", - "xmldom": "^0.6.0", - "xpath": "^0.0.32" - }, - "devDependencies": { - "@types/node": "^16.10.1", - "typescript": "^4.0.5" - }, - "files": [ - "dist", - "README.md", - "LICENSE" - ], - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/flutter-builder/scripts/yarn.lock b/flutter-builder/scripts/yarn.lock deleted file mode 100644 index f2e1bda..0000000 --- a/flutter-builder/scripts/yarn.lock +++ /dev/null @@ -1,40 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@^16.10.1": - version "16.10.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.1.tgz#f3647623199ca920960006b3dccf633ea905f243" - integrity sha512-4/Z9DMPKFexZj/Gn3LylFgamNKHm4K3QDi0gz9B26Uk0c8izYf97B5fxfpspMNkWlFupblKM/nV8+NA9Ffvr+w== - -axios@^0.21.0: - version "0.21.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.0.tgz#26df088803a2350dff2c27f96fef99fe49442aca" - integrity sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw== - dependencies: - follow-redirects "^1.10.0" - -coli@^0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/coli/-/coli-0.0.2.tgz#830bcdbecc5936b8cfe7bfa68621544bdcda0726" - integrity sha512-GDum+hiIcQj8bCV8swxsFzPebfJ57z9on4SapKL4tUN6TQbazxfT6YPZV5NK90mKstP2R+v9rut7lJdfF7p8CQ== - -follow-redirects@^1.10.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" - integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== - -typescript@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.5.tgz#ae9dddfd1069f1cb5beb3ef3b2170dd7c1332389" - integrity sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ== - -xmldom@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.6.0.tgz#43a96ecb8beece991cef382c08397d82d4d0c46f" - integrity sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg== - -xpath@^0.0.32: - version "0.0.32" - resolved "https://registry.yarnpkg.com/xpath/-/xpath-0.0.32.tgz#1b73d3351af736e17ec078d6da4b8175405c48af" - integrity sha512-rxMJhSIoiO8vXcWvSifKqhvV96GjiD5wYb8/QHdoRyQvraTpp4IEv944nhGausZZ3u7dhQXteZuZbaqfpB7uYw== diff --git a/flutter-builder/scripts/dart-doc-parser.ts b/flutter-docs/dart-doc-parser.ts similarity index 100% rename from flutter-builder/scripts/dart-doc-parser.ts rename to flutter-docs/dart-doc-parser.ts diff --git a/flutter-docs/enums/.gitignore b/flutter-docs/enums/.gitignore new file mode 100644 index 0000000..586e3d7 --- /dev/null +++ b/flutter-docs/enums/.gitignore @@ -0,0 +1 @@ +!dist \ No newline at end of file diff --git a/flutter-docs/enums/dist/README.md b/flutter-docs/enums/dist/README.md new file mode 100644 index 0000000..13440f3 --- /dev/null +++ b/flutter-docs/enums/dist/README.md @@ -0,0 +1,25 @@ +# `@flutter-builder/metadata-enums` + +```bash +yarn add @flutter-builder/metadata-enums +``` + +```ts +import type { FlutterEnumType } from "@flutter-builder/metadata-enums"; +import { all } from "@flutter-builder/metadata-enums"; + +console.log(all); + +// [ +// { +// "id": "animation/AnimationBehavior", +// "url": "https://api.flutter.dev/flutter/animation/AnimationBehavior.html", +// "name": "AnimationBehavior", +// "values": [ +// "normal", +// "preserve" +// ] +// }, +// ... +// ] +``` diff --git a/flutter-docs/enums/dist/flutter-enums.d.ts b/flutter-docs/enums/dist/flutter-enums.d.ts new file mode 100644 index 0000000..214e46a --- /dev/null +++ b/flutter-docs/enums/dist/flutter-enums.d.ts @@ -0,0 +1,172 @@ +export type FlutterEnumType = + | "animation/AnimationBehavior" + | "animation/AnimationStatus" + | "widgets/AndroidOverscrollIndicator" + | "dart-ui/AppLifecycleState" + | "widgets/AutofillContextAction" + | "widgets/AutovalidateMode" + | "painting/Axis" + | "painting/AxisDirection" + | "widgets/BannerLocation" + | "dart-ui/BlendMode" + | "dart-ui/BlurStyle" + | "painting/BorderStyle" + | "painting/BoxFit" + | "painting/BoxShape" + | "dart-ui/Brightness" + | "dart-ui/Clip" + | "widgets/ClipboardStatus" + | "widgets/ConnectionState" + | "widgets/ContextMenuButtonType" + | "rendering/CrossAxisAlignment" + | "widgets/CrossFadeState" + | "cupertino/CupertinoDatePickerMode" + | "cupertino/CupertinoListSectionType" + | "cupertino/CupertinoTimerPickerMode" + | "cupertino/CupertinoUserInterfaceLevelData" + | "cupertino/DatePickerDateOrder" + | "cupertino/DatePickerDateTimeOrder" + | "rendering/DecorationPosition" + | "foundation/DiagnosticLevel" + | "widgets/DismissDirection" + | "dart-ui/FilterQuality" + | "rendering/FlexFit" + | "painting/FlutterLogoStyle" + | "widgets/FocusHighlightMode" + | "widgets/FocusHighlightStrategy" + | "dart-ui/FontStyle" + | "rendering/GrowthDirection" + | "widgets/HeroFlightDirection" + | "rendering/HitTestBehavior" + | "painting/ImageRepeat" + | "widgets/KeyEventResult" + | "rendering/MainAxisAlignment" + | "rendering/MainAxisSize" + | "widgets/NavigationMode" + | "widgets/Orientation" + | "widgets/OverflowBarAlignment" + | "cupertino/OverlayVisibilityMode" + | "dart-ui/PaintingStyle" + | "widgets/PanAxis" + | "dart-ui/PathFillType" + | "dart-ui/PathOperation" + | "dart-ui/PlaceholderAlignment" + | "widgets/PlatformProvidedMenuItemType" + | "cupertino/RefreshIndicatorMode" + | "painting/RenderComparison" + | "widgets/RouteInformationReportingType" + | "widgets/RoutePopDisposition" + | "widgets/ScrollbarOrientation" + | "widgets/ScrollDecelerationRate" + | "widgets/ScrollIncrementType" + | "widgets/ScrollPositionAlignmentPolicy" + | "widgets/ScrollViewKeyboardDismissBehavior" + | "services/SelectionChangedCause" + | "services/SmartDashesType" + | "services/SmartQuotesType" + | "widgets/SnapshotMode" + | "rendering/StackFit" + | "dart-ui/StrokeCap" + | "dart-ui/StrokeJoin" + | "rendering/TableCellVerticalAlignment" + | "foundation/TargetPlatform" + | "dart-ui/TextAffinity" + | "dart-ui/TextAlign" + | "dart-ui/TextBaseline" + | "services/TextCapitalization" + | "dart-ui/TextDecorationStyle" + | "dart-ui/TextDirection" + | "services/TextInputAction" + | "dart-ui/TextLeadingDistribution" + | "painting/TextOverflow" + | "rendering/TextSelectionHandleType" + | "painting/TextWidthBasis" + | "dart-ui/TileMode" + | "widgets/TraversalDirection" + | "widgets/UnfocusDisposition" + | "dart-ui/VertexMode" + | "painting/VerticalDirection" + | "widgets/WidgetInspectorServiceExtensions" + | "widgets/WidgetsServiceExtensions" + | "rendering/WrapAlignment" + | "rendering/WrapCrossAlignment" + | "foundation/DiagnosticsTreeStyle" + | "foundation/FoundationServiceExtensions" + | "gestures/DragStartBehavior" + | "gestures/GestureDisposition" + | "gestures/GestureRecognizerState" + | "dart-ui/PointerDeviceKind" + | "material/BottomNavigationBarLandscapeLayout" + | "material/BottomNavigationBarType" + | "material/ButtonBarLayoutBehavior" + | "material/ButtonTextTheme" + | "material/CollapseMode" + | "material/DatePickerEntryMode" + | "material/DatePickerMode" + | "material/DayPeriod" + | "material/DrawerAlignment" + | "material/FloatingLabelBehavior" + | "material/HourFormat" + | "material/ListTileControlAffinity" + | "material/ListTileStyle" + | "material/MaterialBannerClosedReason" + | "material/MaterialState" + | "material/MaterialTapTargetSize" + | "material/MaterialType" + | "material/NavigationDestinationLabelBehavior" + | "material/NavigationRailLabelType" + | "material/PopupMenuPosition" + | "material/RefreshIndicatorTriggerMode" + | "material/ScriptCategory" + | "material/ShowValueIndicator" + | "material/SnackBarBehavior" + | "material/SnackBarClosedReason" + | "material/StepperType" + | "material/StepState" + | "material/StretchMode" + | "material/TabBarIndicatorSize" + | "material/ThemeMode" + | "material/Thumb" + | "material/TimeOfDayFormat" + | "material/TimePickerEntryMode" + | "material/TooltipTriggerMode" + | "physics/SpringType" + | "semantics/Assertiveness" + | "rendering/CacheExtentStyle" + | "semantics/DebugSemanticsDumpOrder" + | "rendering/PerformanceOverlayOption" + | "rendering/PlatformViewHitTestBehavior" + | "rendering/RenderAnimatedSizeState" + | "rendering/RenderingServiceExtensions" + | "rendering/ScrollDirection" + | "rendering/SelectionEventType" + | "rendering/SelectionExtendDirection" + | "rendering/SelectionResult" + | "rendering/SelectionStatus" + | "rendering/TextGranularity" + | "scheduler/SchedulerPhase" + | "scheduler/SchedulerServiceExtensions" + | "services/DeviceOrientation" + | "services/FloatingCursorDragState" + | "services/KeyboardSide" + | "services/KeyDataTransitMode" + | "services/MaxLengthEnforcement" + | "services/ModifierKey" + | "services/ServicesServiceExtensions" + | "services/SystemSoundType" + | "services/SystemUiMode" + | "services/SystemUiOverlay" + | "dart-ui/BoxHeightStyle" + | "dart-ui/BoxWidthStyle" + | "dart-ui/ClipOp" + | "dart-ui/DartPerformanceMode" + | "dart-ui/DisplayFeatureState" + | "dart-ui/DisplayFeatureType" + | "dart-ui/FramePhase" + | "dart-ui/ImageByteFormat" + | "dart-ui/KeyEventType" + | "dart-ui/PixelFormat" + | "dart-ui/PointerChange" + | "dart-ui/PointerSignalKind" + | "dart-ui/PointMode" + | "dart-io/HttpClientResponseCompressionState"; diff --git a/flutter-docs/enums/dist/index.d.ts b/flutter-docs/enums/dist/index.d.ts new file mode 100644 index 0000000..c55153a --- /dev/null +++ b/flutter-docs/enums/dist/index.d.ts @@ -0,0 +1,11 @@ +export type { FlutterEnumType } from "./flutter-enums"; + +export interface FlutterDocEnumDefinition { + name: string; + url: string; + id: string; + values?: Array; +} + +// module.exports = { all : Array } +export const all: Array; diff --git a/flutter-docs/enums/dist/index.js b/flutter-docs/enums/dist/index.js new file mode 100644 index 0000000..7704df1 --- /dev/null +++ b/flutter-docs/enums/dist/index.js @@ -0,0 +1,1307 @@ +module.exports = { + all: [ + { + id: "animation/AnimationBehavior", + url: "https://api.flutter.dev/flutter/animation/AnimationBehavior.html", + name: "AnimationBehavior", + values: ["normal", "preserve"], + }, + { + id: "animation/AnimationStatus", + url: "https://api.flutter.dev/flutter/animation/AnimationStatus.html", + name: "AnimationStatus", + values: ["dismissed", "forward", "reverse", "completed"], + }, + { + id: "widgets/AndroidOverscrollIndicator", + url: "https://api.flutter.dev/flutter/widgets/AndroidOverscrollIndicator.html", + name: "AndroidOverscrollIndicator", + values: ["stretch", "glow"], + }, + { + id: "dart-ui/AppLifecycleState", + url: "https://api.flutter.dev/flutter/dart-ui/AppLifecycleState.html", + name: "AppLifecycleState", + values: ["resumed", "inactive", "paused", "detached"], + }, + { + id: "widgets/AutofillContextAction", + url: "https://api.flutter.dev/flutter/widgets/AutofillContextAction.html", + name: "AutofillContextAction", + values: ["commit", "cancel"], + }, + { + id: "widgets/AutovalidateMode", + url: "https://api.flutter.dev/flutter/widgets/AutovalidateMode.html", + name: "AutovalidateMode", + values: ["disabled", "always", "onUserInteraction"], + }, + { + id: "painting/Axis", + url: "https://api.flutter.dev/flutter/painting/Axis.html", + name: "Axis", + values: ["horizontal", "vertical"], + }, + { + id: "painting/AxisDirection", + url: "https://api.flutter.dev/flutter/painting/AxisDirection.html", + name: "AxisDirection", + values: ["up", "right", "down", "left"], + }, + { + id: "widgets/BannerLocation", + url: "https://api.flutter.dev/flutter/widgets/BannerLocation.html", + name: "BannerLocation", + values: ["topStart", "topEnd", "bottomStart", "bottomEnd"], + }, + { + id: "dart-ui/BlendMode", + url: "https://api.flutter.dev/flutter/dart-ui/BlendMode.html", + name: "BlendMode", + values: [ + "clear", + "src", + "dst", + "srcOver", + "dstOver", + "srcIn", + "dstIn", + "srcOut", + "dstOut", + "srcATop", + "dstATop", + "xor", + "plus", + "modulate", + "screen", + "overlay", + "darken", + "lighten", + "colorDodge", + "colorBurn", + "hardLight", + "softLight", + "difference", + "exclusion", + "multiply", + "hue", + "saturation", + "color", + "luminosity", + ], + }, + { + id: "dart-ui/BlurStyle", + url: "https://api.flutter.dev/flutter/dart-ui/BlurStyle.html", + name: "BlurStyle", + values: ["normal", "solid", "outer", "inner"], + }, + { + id: "painting/BorderStyle", + url: "https://api.flutter.dev/flutter/painting/BorderStyle.html", + name: "BorderStyle", + values: ["none", "solid"], + }, + { + id: "painting/BoxFit", + url: "https://api.flutter.dev/flutter/painting/BoxFit.html", + name: "BoxFit", + values: [ + "fill", + "contain", + "cover", + "fitWidth", + "fitHeight", + "none", + "scaleDown", + ], + }, + { + id: "painting/BoxShape", + url: "https://api.flutter.dev/flutter/painting/BoxShape.html", + name: "BoxShape", + values: ["rectangle", "circle"], + }, + { + id: "dart-ui/Brightness", + url: "https://api.flutter.dev/flutter/dart-ui/Brightness.html", + name: "Brightness", + values: ["dark", "light"], + }, + { + id: "dart-ui/Clip", + url: "https://api.flutter.dev/flutter/dart-ui/Clip.html", + name: "Clip", + values: ["none", "hardEdge", "antiAlias", "antiAliasWithSaveLayer"], + }, + { + id: "widgets/ClipboardStatus", + url: "https://api.flutter.dev/flutter/widgets/ClipboardStatus.html", + name: "ClipboardStatus", + values: ["pasteable", "unknown", "notPasteable"], + }, + { + id: "widgets/ConnectionState", + url: "https://api.flutter.dev/flutter/widgets/ConnectionState.html", + name: "ConnectionState", + values: ["none", "waiting", "active", "done"], + }, + { + id: "widgets/ContextMenuButtonType", + url: "https://api.flutter.dev/flutter/widgets/ContextMenuButtonType.html", + name: "ContextMenuButtonType", + values: ["cut", "copy", "paste", "selectAll", "custom"], + }, + { + id: "rendering/CrossAxisAlignment", + url: "https://api.flutter.dev/flutter/rendering/CrossAxisAlignment.html", + name: "CrossAxisAlignment", + values: ["start", "end", "center", "stretch", "baseline"], + }, + { + id: "widgets/CrossFadeState", + url: "https://api.flutter.dev/flutter/widgets/CrossFadeState.html", + name: "CrossFadeState", + values: ["showFirst", "showSecond"], + }, + { + id: "cupertino/CupertinoDatePickerMode", + url: "https://api.flutter.dev/flutter/cupertino/CupertinoDatePickerMode.html", + name: "CupertinoDatePickerMode", + values: ["time", "date", "dateAndTime"], + }, + { + id: "cupertino/CupertinoListSectionType", + url: "https://api.flutter.dev/flutter/cupertino/CupertinoListSectionType.html", + name: "CupertinoListSectionType", + values: ["base", "insetGrouped"], + }, + { + id: "cupertino/CupertinoTimerPickerMode", + url: "https://api.flutter.dev/flutter/cupertino/CupertinoTimerPickerMode.html", + name: "CupertinoTimerPickerMode", + values: ["hm", "ms", "hms"], + }, + { + id: "cupertino/CupertinoUserInterfaceLevelData", + url: "https://api.flutter.dev/flutter/cupertino/CupertinoUserInterfaceLevelData.html", + name: "CupertinoUserInterfaceLevelData", + values: ["base", "elevated"], + }, + { + id: "cupertino/DatePickerDateOrder", + url: "https://api.flutter.dev/flutter/cupertino/DatePickerDateOrder.html", + name: "DatePickerDateOrder", + values: ["dmy", "mdy", "ymd", "ydm"], + }, + { + id: "cupertino/DatePickerDateTimeOrder", + url: "https://api.flutter.dev/flutter/cupertino/DatePickerDateTimeOrder.html", + name: "DatePickerDateTimeOrder", + values: [ + "date_time_dayPeriod", + "date_dayPeriod_time", + "time_dayPeriod_date", + "dayPeriod_time_date", + ], + }, + { + id: "rendering/DecorationPosition", + url: "https://api.flutter.dev/flutter/rendering/DecorationPosition.html", + name: "DecorationPosition", + values: ["background", "foreground"], + }, + { + id: "foundation/DiagnosticLevel", + url: "https://api.flutter.dev/flutter/foundation/DiagnosticLevel.html", + name: "DiagnosticLevel", + values: [ + "hidden", + "fine", + "debug", + "info", + "warning", + "hint", + "summary", + "error", + "off", + ], + }, + { + id: "widgets/DismissDirection", + url: "https://api.flutter.dev/flutter/widgets/DismissDirection.html", + name: "DismissDirection", + values: [ + "vertical", + "horizontal", + "endToStart", + "startToEnd", + "up", + "down", + "none", + ], + }, + { + id: "dart-ui/FilterQuality", + url: "https://api.flutter.dev/flutter/dart-ui/FilterQuality.html", + name: "FilterQuality", + values: ["none", "low", "medium", "high"], + }, + { + id: "rendering/FlexFit", + url: "https://api.flutter.dev/flutter/rendering/FlexFit.html", + name: "FlexFit", + values: ["tight", "loose"], + }, + { + id: "painting/FlutterLogoStyle", + url: "https://api.flutter.dev/flutter/painting/FlutterLogoStyle.html", + name: "FlutterLogoStyle", + values: ["markOnly", "horizontal", "stacked"], + }, + { + id: "widgets/FocusHighlightMode", + url: "https://api.flutter.dev/flutter/widgets/FocusHighlightMode.html", + name: "FocusHighlightMode", + values: ["touch", "traditional"], + }, + { + id: "widgets/FocusHighlightStrategy", + url: "https://api.flutter.dev/flutter/widgets/FocusHighlightStrategy.html", + name: "FocusHighlightStrategy", + values: ["automatic", "alwaysTouch", "alwaysTraditional"], + }, + { + id: "dart-ui/FontStyle", + url: "https://api.flutter.dev/flutter/dart-ui/FontStyle.html", + name: "FontStyle", + values: ["normal", "italic"], + }, + { + id: "rendering/GrowthDirection", + url: "https://api.flutter.dev/flutter/rendering/GrowthDirection.html", + name: "GrowthDirection", + values: ["forward", "reverse"], + }, + { + id: "widgets/HeroFlightDirection", + url: "https://api.flutter.dev/flutter/widgets/HeroFlightDirection.html", + name: "HeroFlightDirection", + values: ["push", "pop"], + }, + { + id: "rendering/HitTestBehavior", + url: "https://api.flutter.dev/flutter/rendering/HitTestBehavior.html", + name: "HitTestBehavior", + values: ["deferToChild", "opaque", "translucent"], + }, + { + id: "painting/ImageRepeat", + url: "https://api.flutter.dev/flutter/painting/ImageRepeat.html", + name: "ImageRepeat", + values: ["repeat", "repeatX", "repeatY", "noRepeat"], + }, + { + id: "widgets/KeyEventResult", + url: "https://api.flutter.dev/flutter/widgets/KeyEventResult.html", + name: "KeyEventResult", + values: ["handled", "ignored", "skipRemainingHandlers"], + }, + { + id: "rendering/MainAxisAlignment", + url: "https://api.flutter.dev/flutter/rendering/MainAxisAlignment.html", + name: "MainAxisAlignment", + values: [ + "start", + "end", + "center", + "spaceBetween", + "spaceAround", + "spaceEvenly", + ], + }, + { + id: "rendering/MainAxisSize", + url: "https://api.flutter.dev/flutter/rendering/MainAxisSize.html", + name: "MainAxisSize", + values: ["min", "max"], + }, + { + id: "widgets/NavigationMode", + url: "https://api.flutter.dev/flutter/widgets/NavigationMode.html", + name: "NavigationMode", + values: ["traditional", "directional"], + }, + { + id: "widgets/Orientation", + url: "https://api.flutter.dev/flutter/widgets/Orientation.html", + name: "Orientation", + values: ["portrait", "landscape"], + }, + { + id: "widgets/OverflowBarAlignment", + url: "https://api.flutter.dev/flutter/widgets/OverflowBarAlignment.html", + name: "OverflowBarAlignment", + values: ["start", "end", "center"], + }, + { + id: "cupertino/OverlayVisibilityMode", + url: "https://api.flutter.dev/flutter/cupertino/OverlayVisibilityMode.html", + name: "OverlayVisibilityMode", + values: ["never", "editing", "notEditing", "always"], + }, + { + id: "dart-ui/PaintingStyle", + url: "https://api.flutter.dev/flutter/dart-ui/PaintingStyle.html", + name: "PaintingStyle", + values: ["fill", "stroke"], + }, + { + id: "widgets/PanAxis", + url: "https://api.flutter.dev/flutter/widgets/PanAxis.html", + name: "PanAxis", + values: ["horizontal", "vertical", "aligned", "free"], + }, + { + id: "dart-ui/PathFillType", + url: "https://api.flutter.dev/flutter/dart-ui/PathFillType.html", + name: "PathFillType", + values: ["nonZero", "evenOdd"], + }, + { + id: "dart-ui/PathOperation", + url: "https://api.flutter.dev/flutter/dart-ui/PathOperation.html", + name: "PathOperation", + values: ["difference", "intersect", "union", "xor", "reverseDifference"], + }, + { + id: "dart-ui/PlaceholderAlignment", + url: "https://api.flutter.dev/flutter/dart-ui/PlaceholderAlignment.html", + name: "PlaceholderAlignment", + values: [ + "baseline", + "aboveBaseline", + "belowBaseline", + "top", + "bottom", + "middle", + ], + }, + { + id: "widgets/PlatformProvidedMenuItemType", + url: "https://api.flutter.dev/flutter/widgets/PlatformProvidedMenuItemType.html", + name: "PlatformProvidedMenuItemType", + values: [ + "about", + "quit", + "servicesSubmenu", + "hide", + "hideOtherApplications", + "showAllApplications", + "startSpeaking", + "stopSpeaking", + "toggleFullScreen", + "minimizeWindow", + "zoomWindow", + "arrangeWindowsInFront", + ], + }, + { + id: "cupertino/RefreshIndicatorMode", + url: "https://api.flutter.dev/flutter/cupertino/RefreshIndicatorMode.html", + name: "RefreshIndicatorMode", + values: ["inactive", "drag", "armed", "refresh", "done"], + }, + { + id: "painting/RenderComparison", + url: "https://api.flutter.dev/flutter/painting/RenderComparison.html", + name: "RenderComparison", + values: ["identical", "metadata", "paint", "layout"], + }, + { + id: "widgets/RouteInformationReportingType", + url: "https://api.flutter.dev/flutter/widgets/RouteInformationReportingType.html", + name: "RouteInformationReportingType", + values: ["none", "neglect", "navigate"], + }, + { + id: "widgets/RoutePopDisposition", + url: "https://api.flutter.dev/flutter/widgets/RoutePopDisposition.html", + name: "RoutePopDisposition", + values: ["pop", "doNotPop", "bubble"], + }, + { + id: "widgets/ScrollbarOrientation", + url: "https://api.flutter.dev/flutter/widgets/ScrollbarOrientation.html", + name: "ScrollbarOrientation", + values: ["left", "right", "top", "bottom"], + }, + { + id: "widgets/ScrollDecelerationRate", + url: "https://api.flutter.dev/flutter/widgets/ScrollDecelerationRate.html", + name: "ScrollDecelerationRate", + values: ["normal", "fast"], + }, + { + id: "widgets/ScrollIncrementType", + url: "https://api.flutter.dev/flutter/widgets/ScrollIncrementType.html", + name: "ScrollIncrementType", + values: ["line", "page"], + }, + { + id: "widgets/ScrollPositionAlignmentPolicy", + url: "https://api.flutter.dev/flutter/widgets/ScrollPositionAlignmentPolicy.html", + name: "ScrollPositionAlignmentPolicy", + values: ["explicit", "keepVisibleAtEnd", "keepVisibleAtStart"], + }, + { + id: "widgets/ScrollViewKeyboardDismissBehavior", + url: "https://api.flutter.dev/flutter/widgets/ScrollViewKeyboardDismissBehavior.html", + name: "ScrollViewKeyboardDismissBehavior", + values: ["manual", "onDrag"], + }, + { + id: "services/SelectionChangedCause", + url: "https://api.flutter.dev/flutter/services/SelectionChangedCause.html", + name: "SelectionChangedCause", + values: [ + "tap", + "doubleTap", + "longPress", + "forcePress", + "keyboard", + "toolbar", + "drag", + "scribble", + ], + }, + { + id: "services/SmartDashesType", + url: "https://api.flutter.dev/flutter/services/SmartDashesType.html", + name: "SmartDashesType", + values: ["disabled", "enabled"], + }, + { + id: "services/SmartQuotesType", + url: "https://api.flutter.dev/flutter/services/SmartQuotesType.html", + name: "SmartQuotesType", + values: ["disabled", "enabled"], + }, + { + id: "widgets/SnapshotMode", + url: "https://api.flutter.dev/flutter/widgets/SnapshotMode.html", + name: "SnapshotMode", + values: ["permissive", "normal", "forced"], + }, + { + id: "rendering/StackFit", + url: "https://api.flutter.dev/flutter/rendering/StackFit.html", + name: "StackFit", + values: ["loose", "expand", "passthrough"], + }, + { + id: "dart-ui/StrokeCap", + url: "https://api.flutter.dev/flutter/dart-ui/StrokeCap.html", + name: "StrokeCap", + values: ["butt", "round", "square"], + }, + { + id: "dart-ui/StrokeJoin", + url: "https://api.flutter.dev/flutter/dart-ui/StrokeJoin.html", + name: "StrokeJoin", + values: ["miter", "round", "bevel"], + }, + { + id: "rendering/TableCellVerticalAlignment", + url: "https://api.flutter.dev/flutter/rendering/TableCellVerticalAlignment.html", + name: "TableCellVerticalAlignment", + values: ["top", "middle", "bottom", "baseline", "fill"], + }, + { + id: "foundation/TargetPlatform", + url: "https://api.flutter.dev/flutter/foundation/TargetPlatform.html", + name: "TargetPlatform", + values: ["android", "fuchsia", "iOS", "linux", "macOS", "windows"], + }, + { + id: "dart-ui/TextAffinity", + url: "https://api.flutter.dev/flutter/dart-ui/TextAffinity.html", + name: "TextAffinity", + values: ["upstream", "downstream"], + }, + { + id: "dart-ui/TextAlign", + url: "https://api.flutter.dev/flutter/dart-ui/TextAlign.html", + name: "TextAlign", + values: ["left", "right", "center", "justify", "start", "end"], + }, + { + id: "dart-ui/TextBaseline", + url: "https://api.flutter.dev/flutter/dart-ui/TextBaseline.html", + name: "TextBaseline", + values: ["alphabetic", "ideographic"], + }, + { + id: "services/TextCapitalization", + url: "https://api.flutter.dev/flutter/services/TextCapitalization.html", + name: "TextCapitalization", + values: ["words", "sentences", "characters", "none"], + }, + { + id: "dart-ui/TextDecorationStyle", + url: "https://api.flutter.dev/flutter/dart-ui/TextDecorationStyle.html", + name: "TextDecorationStyle", + values: ["solid", "double", "dotted", "dashed", "wavy"], + }, + { + id: "dart-ui/TextDirection", + url: "https://api.flutter.dev/flutter/dart-ui/TextDirection.html", + name: "TextDirection", + values: ["rtl", "ltr"], + }, + { + id: "services/TextInputAction", + url: "https://api.flutter.dev/flutter/services/TextInputAction.html", + name: "TextInputAction", + values: [ + "none", + "unspecified", + "done", + "go", + "search", + "send", + "next", + "previous", + "continueAction", + "join", + "route", + "emergencyCall", + "newline", + ], + }, + { + id: "dart-ui/TextLeadingDistribution", + url: "https://api.flutter.dev/flutter/dart-ui/TextLeadingDistribution.html", + name: "TextLeadingDistribution", + values: ["proportional", "even"], + }, + { + id: "painting/TextOverflow", + url: "https://api.flutter.dev/flutter/painting/TextOverflow.html", + name: "TextOverflow", + values: ["clip", "fade", "ellipsis", "visible"], + }, + { + id: "rendering/TextSelectionHandleType", + url: "https://api.flutter.dev/flutter/rendering/TextSelectionHandleType.html", + name: "TextSelectionHandleType", + values: ["left", "right", "collapsed"], + }, + { + id: "painting/TextWidthBasis", + url: "https://api.flutter.dev/flutter/painting/TextWidthBasis.html", + name: "TextWidthBasis", + values: ["parent", "longestLine"], + }, + { + id: "dart-ui/TileMode", + url: "https://api.flutter.dev/flutter/dart-ui/TileMode.html", + name: "TileMode", + values: ["clamp", "repeated", "mirror", "decal"], + }, + { + id: "widgets/TraversalDirection", + url: "https://api.flutter.dev/flutter/widgets/TraversalDirection.html", + name: "TraversalDirection", + values: ["up", "right", "down", "left"], + }, + { + id: "widgets/UnfocusDisposition", + url: "https://api.flutter.dev/flutter/widgets/UnfocusDisposition.html", + name: "UnfocusDisposition", + values: ["scope", "previouslyFocusedChild"], + }, + { + id: "dart-ui/VertexMode", + url: "https://api.flutter.dev/flutter/dart-ui/VertexMode.html", + name: "VertexMode", + values: ["triangles", "triangleStrip", "triangleFan"], + }, + { + id: "painting/VerticalDirection", + url: "https://api.flutter.dev/flutter/painting/VerticalDirection.html", + name: "VerticalDirection", + values: ["up", "down"], + }, + { + id: "widgets/WidgetInspectorServiceExtensions", + url: "https://api.flutter.dev/flutter/widgets/WidgetInspectorServiceExtensions.html", + name: "WidgetInspectorServiceExtensions", + values: [ + "structuredErrors", + "show", + "trackRebuildDirtyWidgets", + "trackRepaintWidgets", + "disposeAllGroups", + "disposeGroup", + "isWidgetTreeReady", + "disposeId", + "setPubRootDirectories", + "addPubRootDirectories", + "removePubRootDirectories", + "getPubRootDirectories", + "setSelectionById", + "getParentChain", + "getProperties", + "getChildren", + "getChildrenSummaryTree", + "getChildrenDetailsSubtree", + "getRootWidget", + "getRootRenderObject", + "getRootWidgetSummaryTree", + "getRootWidgetSummaryTreeWithPreviews", + "getDetailsSubtree", + "getSelectedRenderObject", + "getSelectedWidget", + "getSelectedSummaryWidget", + "isWidgetCreationTracked", + "screenshot", + "getLayoutExplorerNode", + "setFlexFit", + "setFlexFactor", + "setFlexProperties", + ], + }, + { + id: "widgets/WidgetsServiceExtensions", + url: "https://api.flutter.dev/flutter/widgets/WidgetsServiceExtensions.html", + name: "WidgetsServiceExtensions", + values: [ + "debugDumpApp", + "showPerformanceOverlay", + "didSendFirstFrameEvent", + "didSendFirstFrameRasterizedEvent", + "fastReassemble", + "profileWidgetBuilds", + "profileUserWidgetBuilds", + "debugAllowBanner", + ], + }, + { + id: "rendering/WrapAlignment", + url: "https://api.flutter.dev/flutter/rendering/WrapAlignment.html", + name: "WrapAlignment", + values: [ + "start", + "end", + "center", + "spaceBetween", + "spaceAround", + "spaceEvenly", + ], + }, + { + id: "rendering/WrapCrossAlignment", + url: "https://api.flutter.dev/flutter/rendering/WrapCrossAlignment.html", + name: "WrapCrossAlignment", + values: ["start", "end", "center"], + }, + { + id: "foundation/DiagnosticsTreeStyle", + url: "https://api.flutter.dev/flutter/foundation/DiagnosticsTreeStyle.html", + name: "DiagnosticsTreeStyle", + values: [ + "none", + "sparse", + "offstage", + "dense", + "transition", + "error", + "whitespace", + "flat", + "singleLine", + "errorProperty", + "shallow", + "truncateChildren", + ], + }, + { + id: "foundation/FoundationServiceExtensions", + url: "https://api.flutter.dev/flutter/foundation/FoundationServiceExtensions.html", + name: "FoundationServiceExtensions", + values: [ + "reassemble", + "exit", + "connectedVmServiceUri", + "activeDevToolsServerAddress", + "platformOverride", + "brightnessOverride", + ], + }, + { + id: "gestures/DragStartBehavior", + url: "https://api.flutter.dev/flutter/gestures/DragStartBehavior.html", + name: "DragStartBehavior", + values: ["down", "start"], + }, + { + id: "gestures/GestureDisposition", + url: "https://api.flutter.dev/flutter/gestures/GestureDisposition.html", + name: "GestureDisposition", + values: ["accepted", "rejected"], + }, + { + id: "gestures/GestureRecognizerState", + url: "https://api.flutter.dev/flutter/gestures/GestureRecognizerState.html", + name: "GestureRecognizerState", + values: ["ready", "possible", "defunct"], + }, + { + id: "dart-ui/PointerDeviceKind", + url: "https://api.flutter.dev/flutter/dart-ui/PointerDeviceKind.html", + name: "PointerDeviceKind", + values: [ + "touch", + "mouse", + "stylus", + "invertedStylus", + "trackpad", + "unknown", + ], + }, + { + id: "material/BottomNavigationBarLandscapeLayout", + url: "https://api.flutter.dev/flutter/material/BottomNavigationBarLandscapeLayout.html", + name: "BottomNavigationBarLandscapeLayout", + values: ["spread", "centered", "linear"], + }, + { + id: "material/BottomNavigationBarType", + url: "https://api.flutter.dev/flutter/material/BottomNavigationBarType.html", + name: "BottomNavigationBarType", + values: ["fixed", "shifting"], + }, + { + id: "material/ButtonBarLayoutBehavior", + url: "https://api.flutter.dev/flutter/material/ButtonBarLayoutBehavior.html", + name: "ButtonBarLayoutBehavior", + values: ["constrained", "padded"], + }, + { + id: "material/ButtonTextTheme", + url: "https://api.flutter.dev/flutter/material/ButtonTextTheme.html", + name: "ButtonTextTheme", + values: ["normal", "accent", "primary"], + }, + { + id: "material/CollapseMode", + url: "https://api.flutter.dev/flutter/material/CollapseMode.html", + name: "CollapseMode", + values: ["parallax", "pin", "none"], + }, + { + id: "material/DatePickerEntryMode", + url: "https://api.flutter.dev/flutter/material/DatePickerEntryMode.html", + name: "DatePickerEntryMode", + values: ["calendar", "input", "calendarOnly", "inputOnly"], + }, + { + id: "material/DatePickerMode", + url: "https://api.flutter.dev/flutter/material/DatePickerMode.html", + name: "DatePickerMode", + values: ["day", "year"], + }, + { + id: "material/DayPeriod", + url: "https://api.flutter.dev/flutter/material/DayPeriod.html", + name: "DayPeriod", + values: ["am", "pm"], + }, + { + id: "material/DrawerAlignment", + url: "https://api.flutter.dev/flutter/material/DrawerAlignment.html", + name: "DrawerAlignment", + values: ["start", "end"], + }, + { + id: "material/FloatingLabelBehavior", + url: "https://api.flutter.dev/flutter/material/FloatingLabelBehavior.html", + name: "FloatingLabelBehavior", + values: ["never", "auto", "always"], + }, + { + id: "material/HourFormat", + url: "https://api.flutter.dev/flutter/material/HourFormat.html", + name: "HourFormat", + values: ["HH", "H", "h"], + }, + { + id: "material/ListTileControlAffinity", + url: "https://api.flutter.dev/flutter/material/ListTileControlAffinity.html", + name: "ListTileControlAffinity", + values: ["leading", "trailing", "platform"], + }, + { + id: "material/ListTileStyle", + url: "https://api.flutter.dev/flutter/material/ListTileStyle.html", + name: "ListTileStyle", + values: ["list", "drawer"], + }, + { + id: "material/MaterialBannerClosedReason", + url: "https://api.flutter.dev/flutter/material/MaterialBannerClosedReason.html", + name: "MaterialBannerClosedReason", + values: ["dismiss", "swipe", "hide", "remove"], + }, + { + id: "material/MaterialState", + url: "https://api.flutter.dev/flutter/material/MaterialState.html", + name: "MaterialState", + values: [ + "hovered", + "focused", + "pressed", + "dragged", + "selected", + "scrolledUnder", + "disabled", + "error", + ], + }, + { + id: "material/MaterialTapTargetSize", + url: "https://api.flutter.dev/flutter/material/MaterialTapTargetSize.html", + name: "MaterialTapTargetSize", + values: ["padded", "shrinkWrap"], + }, + { + id: "material/MaterialType", + url: "https://api.flutter.dev/flutter/material/MaterialType.html", + name: "MaterialType", + values: ["canvas", "card", "circle", "button", "transparency"], + }, + { + id: "material/NavigationDestinationLabelBehavior", + url: "https://api.flutter.dev/flutter/material/NavigationDestinationLabelBehavior.html", + name: "NavigationDestinationLabelBehavior", + values: ["alwaysShow", "alwaysHide", "onlyShowSelected"], + }, + { + id: "material/NavigationRailLabelType", + url: "https://api.flutter.dev/flutter/material/NavigationRailLabelType.html", + name: "NavigationRailLabelType", + values: ["none", "selected", "all"], + }, + { + id: "material/PopupMenuPosition", + url: "https://api.flutter.dev/flutter/material/PopupMenuPosition.html", + name: "PopupMenuPosition", + values: ["over", "under"], + }, + { + id: "material/RefreshIndicatorTriggerMode", + url: "https://api.flutter.dev/flutter/material/RefreshIndicatorTriggerMode.html", + name: "RefreshIndicatorTriggerMode", + values: ["anywhere", "onEdge"], + }, + { + id: "material/ScriptCategory", + url: "https://api.flutter.dev/flutter/material/ScriptCategory.html", + name: "ScriptCategory", + values: ["englishLike", "dense", "tall"], + }, + { + id: "material/ShowValueIndicator", + url: "https://api.flutter.dev/flutter/material/ShowValueIndicator.html", + name: "ShowValueIndicator", + values: ["onlyForDiscrete", "onlyForContinuous", "always", "never"], + }, + { + id: "material/SnackBarBehavior", + url: "https://api.flutter.dev/flutter/material/SnackBarBehavior.html", + name: "SnackBarBehavior", + values: ["fixed", "floating"], + }, + { + id: "material/SnackBarClosedReason", + url: "https://api.flutter.dev/flutter/material/SnackBarClosedReason.html", + name: "SnackBarClosedReason", + values: ["action", "dismiss", "swipe", "hide", "remove", "timeout"], + }, + { + id: "material/StepperType", + url: "https://api.flutter.dev/flutter/material/StepperType.html", + name: "StepperType", + values: ["vertical", "horizontal"], + }, + { + id: "material/StepState", + url: "https://api.flutter.dev/flutter/material/StepState.html", + name: "StepState", + values: ["indexed", "editing", "complete", "disabled", "error"], + }, + { + id: "material/StretchMode", + url: "https://api.flutter.dev/flutter/material/StretchMode.html", + name: "StretchMode", + values: ["zoomBackground", "blurBackground", "fadeTitle"], + }, + { + id: "material/TabBarIndicatorSize", + url: "https://api.flutter.dev/flutter/material/TabBarIndicatorSize.html", + name: "TabBarIndicatorSize", + values: ["tab", "label"], + }, + { + id: "material/ThemeMode", + url: "https://api.flutter.dev/flutter/material/ThemeMode.html", + name: "ThemeMode", + values: ["system", "light", "dark"], + }, + { + id: "material/Thumb", + url: "https://api.flutter.dev/flutter/material/Thumb.html", + name: "Thumb", + values: ["start", "end"], + }, + { + id: "material/TimeOfDayFormat", + url: "https://api.flutter.dev/flutter/material/TimeOfDayFormat.html", + name: "TimeOfDayFormat", + values: [ + "HH_colon_mm", + "HH_dot_mm", + "frenchCanadian", + "H_colon_mm", + "h_colon_mm_space_a", + "a_space_h_colon_mm", + ], + }, + { + id: "material/TimePickerEntryMode", + url: "https://api.flutter.dev/flutter/material/TimePickerEntryMode.html", + name: "TimePickerEntryMode", + values: ["dial", "input", "dialOnly", "inputOnly"], + }, + { + id: "material/TooltipTriggerMode", + url: "https://api.flutter.dev/flutter/material/TooltipTriggerMode.html", + name: "TooltipTriggerMode", + values: ["manual", "longPress", "tap"], + }, + { + id: "physics/SpringType", + url: "https://api.flutter.dev/flutter/physics/SpringType.html", + name: "SpringType", + values: ["criticallyDamped", "underDamped", "overDamped"], + }, + { + id: "semantics/Assertiveness", + url: "https://api.flutter.dev/flutter/semantics/Assertiveness.html", + name: "Assertiveness", + values: ["polite", "assertive"], + }, + { + id: "rendering/CacheExtentStyle", + url: "https://api.flutter.dev/flutter/rendering/CacheExtentStyle.html", + name: "CacheExtentStyle", + values: ["pixel", "viewport"], + }, + { + id: "semantics/DebugSemanticsDumpOrder", + url: "https://api.flutter.dev/flutter/semantics/DebugSemanticsDumpOrder.html", + name: "DebugSemanticsDumpOrder", + values: ["inverseHitTest", "traversalOrder"], + }, + { + id: "rendering/PerformanceOverlayOption", + url: "https://api.flutter.dev/flutter/rendering/PerformanceOverlayOption.html", + name: "PerformanceOverlayOption", + values: [ + "displayRasterizerStatistics", + "visualizeRasterizerStatistics", + "displayEngineStatistics", + "visualizeEngineStatistics", + ], + }, + { + id: "rendering/PlatformViewHitTestBehavior", + url: "https://api.flutter.dev/flutter/rendering/PlatformViewHitTestBehavior.html", + name: "PlatformViewHitTestBehavior", + values: ["opaque", "translucent", "transparent"], + }, + { + id: "rendering/RenderAnimatedSizeState", + url: "https://api.flutter.dev/flutter/rendering/RenderAnimatedSizeState.html", + name: "RenderAnimatedSizeState", + values: ["start", "stable", "changed", "unstable"], + }, + { + id: "rendering/RenderingServiceExtensions", + url: "https://api.flutter.dev/flutter/rendering/RenderingServiceExtensions.html", + name: "RenderingServiceExtensions", + values: [ + "invertOversizedImages", + "debugPaint", + "debugPaintBaselinesEnabled", + "repaintRainbow", + "debugDumpLayerTree", + "debugDisableClipLayers", + "debugDisablePhysicalShapeLayers", + "debugDisableOpacityLayers", + "debugDumpRenderTree", + "debugDumpSemanticsTreeInTraversalOrder", + "debugDumpSemanticsTreeInInverseHitTestOrder", + "profileRenderObjectPaints", + "profileRenderObjectLayouts", + ], + }, + { + id: "rendering/ScrollDirection", + url: "https://api.flutter.dev/flutter/rendering/ScrollDirection.html", + name: "ScrollDirection", + values: ["idle", "forward", "reverse"], + }, + { + id: "rendering/SelectionEventType", + url: "https://api.flutter.dev/flutter/rendering/SelectionEventType.html", + name: "SelectionEventType", + values: [ + "startEdgeUpdate", + "endEdgeUpdate", + "clear", + "selectAll", + "selectWord", + "granularlyExtendSelection", + "directionallyExtendSelection", + ], + }, + { + id: "rendering/SelectionExtendDirection", + url: "https://api.flutter.dev/flutter/rendering/SelectionExtendDirection.html", + name: "SelectionExtendDirection", + values: ["previousLine", "nextLine", "forward", "backward"], + }, + { + id: "rendering/SelectionResult", + url: "https://api.flutter.dev/flutter/rendering/SelectionResult.html", + name: "SelectionResult", + values: ["next", "previous", "end", "pending", "none"], + }, + { + id: "rendering/SelectionStatus", + url: "https://api.flutter.dev/flutter/rendering/SelectionStatus.html", + name: "SelectionStatus", + values: ["uncollapsed", "collapsed", "none"], + }, + { + id: "rendering/TextGranularity", + url: "https://api.flutter.dev/flutter/rendering/TextGranularity.html", + name: "TextGranularity", + values: ["character", "word", "line", "document"], + }, + { + id: "scheduler/SchedulerPhase", + url: "https://api.flutter.dev/flutter/scheduler/SchedulerPhase.html", + name: "SchedulerPhase", + values: [ + "idle", + "transientCallbacks", + "midFrameMicrotasks", + "persistentCallbacks", + "postFrameCallbacks", + ], + }, + { + id: "scheduler/SchedulerServiceExtensions", + url: "https://api.flutter.dev/flutter/scheduler/SchedulerServiceExtensions.html", + name: "SchedulerServiceExtensions", + values: ["timeDilation"], + }, + { + id: "services/DeviceOrientation", + url: "https://api.flutter.dev/flutter/services/DeviceOrientation.html", + name: "DeviceOrientation", + values: ["portraitUp", "landscapeLeft", "portraitDown", "landscapeRight"], + }, + { + id: "services/FloatingCursorDragState", + url: "https://api.flutter.dev/flutter/services/FloatingCursorDragState.html", + name: "FloatingCursorDragState", + values: ["Start", "Update", "End"], + }, + { + id: "services/KeyboardSide", + url: "https://api.flutter.dev/flutter/services/KeyboardSide.html", + name: "KeyboardSide", + values: ["any", "left", "right", "all"], + }, + { + id: "services/KeyDataTransitMode", + url: "https://api.flutter.dev/flutter/services/KeyDataTransitMode.html", + name: "KeyDataTransitMode", + values: ["rawKeyData", "keyDataThenRawKeyData"], + }, + { + id: "services/MaxLengthEnforcement", + url: "https://api.flutter.dev/flutter/services/MaxLengthEnforcement.html", + name: "MaxLengthEnforcement", + values: ["none", "enforced", "truncateAfterCompositionEnds"], + }, + { + id: "services/ModifierKey", + url: "https://api.flutter.dev/flutter/services/ModifierKey.html", + name: "ModifierKey", + values: [ + "controlModifier", + "shiftModifier", + "altModifier", + "metaModifier", + "capsLockModifier", + "numLockModifier", + "scrollLockModifier", + "functionModifier", + "symbolModifier", + ], + }, + { + id: "services/ServicesServiceExtensions", + url: "https://api.flutter.dev/flutter/services/ServicesServiceExtensions.html", + name: "ServicesServiceExtensions", + values: ["evict"], + }, + { + id: "services/SystemSoundType", + url: "https://api.flutter.dev/flutter/services/SystemSoundType.html", + name: "SystemSoundType", + values: ["click", "alert"], + }, + { + id: "services/SystemUiMode", + url: "https://api.flutter.dev/flutter/services/SystemUiMode.html", + name: "SystemUiMode", + values: [ + "leanBack", + "immersive", + "immersiveSticky", + "edgeToEdge", + "manual", + ], + }, + { + id: "services/SystemUiOverlay", + url: "https://api.flutter.dev/flutter/services/SystemUiOverlay.html", + name: "SystemUiOverlay", + values: ["top", "bottom"], + }, + { + id: "dart-ui/BoxHeightStyle", + url: "https://api.flutter.dev/flutter/dart-ui/BoxHeightStyle.html", + name: "BoxHeightStyle", + values: [ + "tight", + "max", + "includeLineSpacingMiddle", + "includeLineSpacingTop", + "includeLineSpacingBottom", + "strut", + ], + }, + { + id: "dart-ui/BoxWidthStyle", + url: "https://api.flutter.dev/flutter/dart-ui/BoxWidthStyle.html", + name: "BoxWidthStyle", + values: ["tight", "max"], + }, + { + id: "dart-ui/ClipOp", + url: "https://api.flutter.dev/flutter/dart-ui/ClipOp.html", + name: "ClipOp", + values: ["difference", "intersect"], + }, + { + id: "dart-ui/DartPerformanceMode", + url: "https://api.flutter.dev/flutter/dart-ui/DartPerformanceMode.html", + name: "DartPerformanceMode", + values: ["balanced", "latency", "throughput", "memory"], + }, + { + id: "dart-ui/DisplayFeatureState", + url: "https://api.flutter.dev/flutter/dart-ui/DisplayFeatureState.html", + name: "DisplayFeatureState", + values: ["unknown", "postureFlat", "postureHalfOpened"], + }, + { + id: "dart-ui/DisplayFeatureType", + url: "https://api.flutter.dev/flutter/dart-ui/DisplayFeatureType.html", + name: "DisplayFeatureType", + values: ["unknown", "fold", "hinge", "cutout"], + }, + { + id: "dart-ui/FramePhase", + url: "https://api.flutter.dev/flutter/dart-ui/FramePhase.html", + name: "FramePhase", + values: [ + "vsyncStart", + "buildStart", + "buildFinish", + "rasterStart", + "rasterFinish", + "rasterFinishWallTime", + ], + }, + { + id: "dart-ui/ImageByteFormat", + url: "https://api.flutter.dev/flutter/dart-ui/ImageByteFormat.html", + name: "ImageByteFormat", + values: ["rawRgba", "rawStraightRgba", "rawUnmodified", "png"], + }, + { + id: "dart-ui/KeyEventType", + url: "https://api.flutter.dev/flutter/dart-ui/KeyEventType.html", + name: "KeyEventType", + values: ["down", "up", "repeat"], + }, + { + id: "dart-ui/PixelFormat", + url: "https://api.flutter.dev/flutter/dart-ui/PixelFormat.html", + name: "PixelFormat", + values: ["rgba8888", "bgra8888"], + }, + { + id: "dart-ui/PointerChange", + url: "https://api.flutter.dev/flutter/dart-ui/PointerChange.html", + name: "PointerChange", + values: [ + "cancel", + "add", + "remove", + "hover", + "down", + "move", + "up", + "panZoomStart", + "panZoomUpdate", + "panZoomEnd", + ], + }, + { + id: "dart-ui/PointerSignalKind", + url: "https://api.flutter.dev/flutter/dart-ui/PointerSignalKind.html", + name: "PointerSignalKind", + values: ["none", "scroll", "scrollInertiaCancel", "scale", "unknown"], + }, + { + id: "dart-ui/PointMode", + url: "https://api.flutter.dev/flutter/dart-ui/PointMode.html", + name: "PointMode", + values: ["points", "lines", "polygon"], + }, + { + id: "dart-io/HttpClientResponseCompressionState", + url: "https://api.flutter.dev/flutter/dart-io/HttpClientResponseCompressionState.html", + name: "HttpClientResponseCompressionState", + values: ["notCompressed", "decompressed", "compressed"], + }, + ], +}; diff --git a/flutter-docs/enums/dist/package.json b/flutter-docs/enums/dist/package.json new file mode 100644 index 0000000..cce1f01 --- /dev/null +++ b/flutter-docs/enums/dist/package.json @@ -0,0 +1,23 @@ +{ + "name": "@flutter-builder/metadata-enums", + "description": "Metadata package for Flutter enums", + "keywords": [ + "flutter", + "metadata", + "enums" + ], + "repository": "https://github.com/gridaco/flutter/tree/main/flutter-docs/enums/dist", + "types": "index.d.ts", + "main": "index.js", + "private": false, + "version": "0.0.0", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "files": [ + "flutter-enums.d.ts", + "index.d.ts", + "index.js" + ] +} diff --git a/flutter-docs/enums/dts.ts b/flutter-docs/enums/dts.ts new file mode 100644 index 0000000..c39df3d --- /dev/null +++ b/flutter-docs/enums/dts.ts @@ -0,0 +1,9 @@ +import type { FlutterDocEnumDefinition } from "./index"; + +export function dts(defs: Array) { + return ` +export type FlutterEnumType = +${defs.map((def) => ` | "${def.id}"`).join("\n")} +; + `; +} diff --git a/flutter-docs/enums/enums.json b/flutter-docs/enums/enums.json new file mode 100644 index 0000000..5844417 --- /dev/null +++ b/flutter-docs/enums/enums.json @@ -0,0 +1,1879 @@ +[ + { + "id": "animation/AnimationBehavior", + "url": "https://api.flutter.dev/flutter/animation/AnimationBehavior.html", + "name": "AnimationBehavior", + "values": [ + "normal", + "preserve" + ] + }, + { + "id": "animation/AnimationStatus", + "url": "https://api.flutter.dev/flutter/animation/AnimationStatus.html", + "name": "AnimationStatus", + "values": [ + "dismissed", + "forward", + "reverse", + "completed" + ] + }, + { + "id": "widgets/AndroidOverscrollIndicator", + "url": "https://api.flutter.dev/flutter/widgets/AndroidOverscrollIndicator.html", + "name": "AndroidOverscrollIndicator", + "values": [ + "stretch", + "glow" + ] + }, + { + "id": "dart-ui/AppLifecycleState", + "url": "https://api.flutter.dev/flutter/dart-ui/AppLifecycleState.html", + "name": "AppLifecycleState", + "values": [ + "resumed", + "inactive", + "paused", + "detached" + ] + }, + { + "id": "widgets/AutofillContextAction", + "url": "https://api.flutter.dev/flutter/widgets/AutofillContextAction.html", + "name": "AutofillContextAction", + "values": [ + "commit", + "cancel" + ] + }, + { + "id": "widgets/AutovalidateMode", + "url": "https://api.flutter.dev/flutter/widgets/AutovalidateMode.html", + "name": "AutovalidateMode", + "values": [ + "disabled", + "always", + "onUserInteraction" + ] + }, + { + "id": "painting/Axis", + "url": "https://api.flutter.dev/flutter/painting/Axis.html", + "name": "Axis", + "values": [ + "horizontal", + "vertical" + ] + }, + { + "id": "painting/AxisDirection", + "url": "https://api.flutter.dev/flutter/painting/AxisDirection.html", + "name": "AxisDirection", + "values": [ + "up", + "right", + "down", + "left" + ] + }, + { + "id": "widgets/BannerLocation", + "url": "https://api.flutter.dev/flutter/widgets/BannerLocation.html", + "name": "BannerLocation", + "values": [ + "topStart", + "topEnd", + "bottomStart", + "bottomEnd" + ] + }, + { + "id": "dart-ui/BlendMode", + "url": "https://api.flutter.dev/flutter/dart-ui/BlendMode.html", + "name": "BlendMode", + "values": [ + "clear", + "src", + "dst", + "srcOver", + "dstOver", + "srcIn", + "dstIn", + "srcOut", + "dstOut", + "srcATop", + "dstATop", + "xor", + "plus", + "modulate", + "screen", + "overlay", + "darken", + "lighten", + "colorDodge", + "colorBurn", + "hardLight", + "softLight", + "difference", + "exclusion", + "multiply", + "hue", + "saturation", + "color", + "luminosity" + ] + }, + { + "id": "dart-ui/BlurStyle", + "url": "https://api.flutter.dev/flutter/dart-ui/BlurStyle.html", + "name": "BlurStyle", + "values": [ + "normal", + "solid", + "outer", + "inner" + ] + }, + { + "id": "painting/BorderStyle", + "url": "https://api.flutter.dev/flutter/painting/BorderStyle.html", + "name": "BorderStyle", + "values": [ + "none", + "solid" + ] + }, + { + "id": "painting/BoxFit", + "url": "https://api.flutter.dev/flutter/painting/BoxFit.html", + "name": "BoxFit", + "values": [ + "fill", + "contain", + "cover", + "fitWidth", + "fitHeight", + "none", + "scaleDown" + ] + }, + { + "id": "painting/BoxShape", + "url": "https://api.flutter.dev/flutter/painting/BoxShape.html", + "name": "BoxShape", + "values": [ + "rectangle", + "circle" + ] + }, + { + "id": "dart-ui/Brightness", + "url": "https://api.flutter.dev/flutter/dart-ui/Brightness.html", + "name": "Brightness", + "values": [ + "dark", + "light" + ] + }, + { + "id": "dart-ui/Clip", + "url": "https://api.flutter.dev/flutter/dart-ui/Clip.html", + "name": "Clip", + "values": [ + "none", + "hardEdge", + "antiAlias", + "antiAliasWithSaveLayer" + ] + }, + { + "id": "widgets/ClipboardStatus", + "url": "https://api.flutter.dev/flutter/widgets/ClipboardStatus.html", + "name": "ClipboardStatus", + "values": [ + "pasteable", + "unknown", + "notPasteable" + ] + }, + { + "id": "widgets/ConnectionState", + "url": "https://api.flutter.dev/flutter/widgets/ConnectionState.html", + "name": "ConnectionState", + "values": [ + "none", + "waiting", + "active", + "done" + ] + }, + { + "id": "widgets/ContextMenuButtonType", + "url": "https://api.flutter.dev/flutter/widgets/ContextMenuButtonType.html", + "name": "ContextMenuButtonType", + "values": [ + "cut", + "copy", + "paste", + "selectAll", + "custom" + ] + }, + { + "id": "rendering/CrossAxisAlignment", + "url": "https://api.flutter.dev/flutter/rendering/CrossAxisAlignment.html", + "name": "CrossAxisAlignment", + "values": [ + "start", + "end", + "center", + "stretch", + "baseline" + ] + }, + { + "id": "widgets/CrossFadeState", + "url": "https://api.flutter.dev/flutter/widgets/CrossFadeState.html", + "name": "CrossFadeState", + "values": [ + "showFirst", + "showSecond" + ] + }, + { + "id": "cupertino/CupertinoDatePickerMode", + "url": "https://api.flutter.dev/flutter/cupertino/CupertinoDatePickerMode.html", + "name": "CupertinoDatePickerMode", + "values": [ + "time", + "date", + "dateAndTime" + ] + }, + { + "id": "cupertino/CupertinoListSectionType", + "url": "https://api.flutter.dev/flutter/cupertino/CupertinoListSectionType.html", + "name": "CupertinoListSectionType", + "values": [ + "base", + "insetGrouped" + ] + }, + { + "id": "cupertino/CupertinoTimerPickerMode", + "url": "https://api.flutter.dev/flutter/cupertino/CupertinoTimerPickerMode.html", + "name": "CupertinoTimerPickerMode", + "values": [ + "hm", + "ms", + "hms" + ] + }, + { + "id": "cupertino/CupertinoUserInterfaceLevelData", + "url": "https://api.flutter.dev/flutter/cupertino/CupertinoUserInterfaceLevelData.html", + "name": "CupertinoUserInterfaceLevelData", + "values": [ + "base", + "elevated" + ] + }, + { + "id": "cupertino/DatePickerDateOrder", + "url": "https://api.flutter.dev/flutter/cupertino/DatePickerDateOrder.html", + "name": "DatePickerDateOrder", + "values": [ + "dmy", + "mdy", + "ymd", + "ydm" + ] + }, + { + "id": "cupertino/DatePickerDateTimeOrder", + "url": "https://api.flutter.dev/flutter/cupertino/DatePickerDateTimeOrder.html", + "name": "DatePickerDateTimeOrder", + "values": [ + "date_time_dayPeriod", + "date_dayPeriod_time", + "time_dayPeriod_date", + "dayPeriod_time_date" + ] + }, + { + "id": "rendering/DecorationPosition", + "url": "https://api.flutter.dev/flutter/rendering/DecorationPosition.html", + "name": "DecorationPosition", + "values": [ + "background", + "foreground" + ] + }, + { + "id": "foundation/DiagnosticLevel", + "url": "https://api.flutter.dev/flutter/foundation/DiagnosticLevel.html", + "name": "DiagnosticLevel", + "values": [ + "hidden", + "fine", + "debug", + "info", + "warning", + "hint", + "summary", + "error", + "off" + ] + }, + { + "id": "widgets/DismissDirection", + "url": "https://api.flutter.dev/flutter/widgets/DismissDirection.html", + "name": "DismissDirection", + "values": [ + "vertical", + "horizontal", + "endToStart", + "startToEnd", + "up", + "down", + "none" + ] + }, + { + "id": "dart-ui/FilterQuality", + "url": "https://api.flutter.dev/flutter/dart-ui/FilterQuality.html", + "name": "FilterQuality", + "values": [ + "none", + "low", + "medium", + "high" + ] + }, + { + "id": "rendering/FlexFit", + "url": "https://api.flutter.dev/flutter/rendering/FlexFit.html", + "name": "FlexFit", + "values": [ + "tight", + "loose" + ] + }, + { + "id": "painting/FlutterLogoStyle", + "url": "https://api.flutter.dev/flutter/painting/FlutterLogoStyle.html", + "name": "FlutterLogoStyle", + "values": [ + "markOnly", + "horizontal", + "stacked" + ] + }, + { + "id": "widgets/FocusHighlightMode", + "url": "https://api.flutter.dev/flutter/widgets/FocusHighlightMode.html", + "name": "FocusHighlightMode", + "values": [ + "touch", + "traditional" + ] + }, + { + "id": "widgets/FocusHighlightStrategy", + "url": "https://api.flutter.dev/flutter/widgets/FocusHighlightStrategy.html", + "name": "FocusHighlightStrategy", + "values": [ + "automatic", + "alwaysTouch", + "alwaysTraditional" + ] + }, + { + "id": "dart-ui/FontStyle", + "url": "https://api.flutter.dev/flutter/dart-ui/FontStyle.html", + "name": "FontStyle", + "values": [ + "normal", + "italic" + ] + }, + { + "id": "rendering/GrowthDirection", + "url": "https://api.flutter.dev/flutter/rendering/GrowthDirection.html", + "name": "GrowthDirection", + "values": [ + "forward", + "reverse" + ] + }, + { + "id": "widgets/HeroFlightDirection", + "url": "https://api.flutter.dev/flutter/widgets/HeroFlightDirection.html", + "name": "HeroFlightDirection", + "values": [ + "push", + "pop" + ] + }, + { + "id": "rendering/HitTestBehavior", + "url": "https://api.flutter.dev/flutter/rendering/HitTestBehavior.html", + "name": "HitTestBehavior", + "values": [ + "deferToChild", + "opaque", + "translucent" + ] + }, + { + "id": "painting/ImageRepeat", + "url": "https://api.flutter.dev/flutter/painting/ImageRepeat.html", + "name": "ImageRepeat", + "values": [ + "repeat", + "repeatX", + "repeatY", + "noRepeat" + ] + }, + { + "id": "widgets/KeyEventResult", + "url": "https://api.flutter.dev/flutter/widgets/KeyEventResult.html", + "name": "KeyEventResult", + "values": [ + "handled", + "ignored", + "skipRemainingHandlers" + ] + }, + { + "id": "rendering/MainAxisAlignment", + "url": "https://api.flutter.dev/flutter/rendering/MainAxisAlignment.html", + "name": "MainAxisAlignment", + "values": [ + "start", + "end", + "center", + "spaceBetween", + "spaceAround", + "spaceEvenly" + ] + }, + { + "id": "rendering/MainAxisSize", + "url": "https://api.flutter.dev/flutter/rendering/MainAxisSize.html", + "name": "MainAxisSize", + "values": [ + "min", + "max" + ] + }, + { + "id": "widgets/NavigationMode", + "url": "https://api.flutter.dev/flutter/widgets/NavigationMode.html", + "name": "NavigationMode", + "values": [ + "traditional", + "directional" + ] + }, + { + "id": "widgets/Orientation", + "url": "https://api.flutter.dev/flutter/widgets/Orientation.html", + "name": "Orientation", + "values": [ + "portrait", + "landscape" + ] + }, + { + "id": "widgets/OverflowBarAlignment", + "url": "https://api.flutter.dev/flutter/widgets/OverflowBarAlignment.html", + "name": "OverflowBarAlignment", + "values": [ + "start", + "end", + "center" + ] + }, + { + "id": "cupertino/OverlayVisibilityMode", + "url": "https://api.flutter.dev/flutter/cupertino/OverlayVisibilityMode.html", + "name": "OverlayVisibilityMode", + "values": [ + "never", + "editing", + "notEditing", + "always" + ] + }, + { + "id": "dart-ui/PaintingStyle", + "url": "https://api.flutter.dev/flutter/dart-ui/PaintingStyle.html", + "name": "PaintingStyle", + "values": [ + "fill", + "stroke" + ] + }, + { + "id": "widgets/PanAxis", + "url": "https://api.flutter.dev/flutter/widgets/PanAxis.html", + "name": "PanAxis", + "values": [ + "horizontal", + "vertical", + "aligned", + "free" + ] + }, + { + "id": "dart-ui/PathFillType", + "url": "https://api.flutter.dev/flutter/dart-ui/PathFillType.html", + "name": "PathFillType", + "values": [ + "nonZero", + "evenOdd" + ] + }, + { + "id": "dart-ui/PathOperation", + "url": "https://api.flutter.dev/flutter/dart-ui/PathOperation.html", + "name": "PathOperation", + "values": [ + "difference", + "intersect", + "union", + "xor", + "reverseDifference" + ] + }, + { + "id": "dart-ui/PlaceholderAlignment", + "url": "https://api.flutter.dev/flutter/dart-ui/PlaceholderAlignment.html", + "name": "PlaceholderAlignment", + "values": [ + "baseline", + "aboveBaseline", + "belowBaseline", + "top", + "bottom", + "middle" + ] + }, + { + "id": "widgets/PlatformProvidedMenuItemType", + "url": "https://api.flutter.dev/flutter/widgets/PlatformProvidedMenuItemType.html", + "name": "PlatformProvidedMenuItemType", + "values": [ + "about", + "quit", + "servicesSubmenu", + "hide", + "hideOtherApplications", + "showAllApplications", + "startSpeaking", + "stopSpeaking", + "toggleFullScreen", + "minimizeWindow", + "zoomWindow", + "arrangeWindowsInFront" + ] + }, + { + "id": "cupertino/RefreshIndicatorMode", + "url": "https://api.flutter.dev/flutter/cupertino/RefreshIndicatorMode.html", + "name": "RefreshIndicatorMode", + "values": [ + "inactive", + "drag", + "armed", + "refresh", + "done" + ] + }, + { + "id": "painting/RenderComparison", + "url": "https://api.flutter.dev/flutter/painting/RenderComparison.html", + "name": "RenderComparison", + "values": [ + "identical", + "metadata", + "paint", + "layout" + ] + }, + { + "id": "widgets/RouteInformationReportingType", + "url": "https://api.flutter.dev/flutter/widgets/RouteInformationReportingType.html", + "name": "RouteInformationReportingType", + "values": [ + "none", + "neglect", + "navigate" + ] + }, + { + "id": "widgets/RoutePopDisposition", + "url": "https://api.flutter.dev/flutter/widgets/RoutePopDisposition.html", + "name": "RoutePopDisposition", + "values": [ + "pop", + "doNotPop", + "bubble" + ] + }, + { + "id": "widgets/ScrollbarOrientation", + "url": "https://api.flutter.dev/flutter/widgets/ScrollbarOrientation.html", + "name": "ScrollbarOrientation", + "values": [ + "left", + "right", + "top", + "bottom" + ] + }, + { + "id": "widgets/ScrollDecelerationRate", + "url": "https://api.flutter.dev/flutter/widgets/ScrollDecelerationRate.html", + "name": "ScrollDecelerationRate", + "values": [ + "normal", + "fast" + ] + }, + { + "id": "widgets/ScrollIncrementType", + "url": "https://api.flutter.dev/flutter/widgets/ScrollIncrementType.html", + "name": "ScrollIncrementType", + "values": [ + "line", + "page" + ] + }, + { + "id": "widgets/ScrollPositionAlignmentPolicy", + "url": "https://api.flutter.dev/flutter/widgets/ScrollPositionAlignmentPolicy.html", + "name": "ScrollPositionAlignmentPolicy", + "values": [ + "explicit", + "keepVisibleAtEnd", + "keepVisibleAtStart" + ] + }, + { + "id": "widgets/ScrollViewKeyboardDismissBehavior", + "url": "https://api.flutter.dev/flutter/widgets/ScrollViewKeyboardDismissBehavior.html", + "name": "ScrollViewKeyboardDismissBehavior", + "values": [ + "manual", + "onDrag" + ] + }, + { + "id": "services/SelectionChangedCause", + "url": "https://api.flutter.dev/flutter/services/SelectionChangedCause.html", + "name": "SelectionChangedCause", + "values": [ + "tap", + "doubleTap", + "longPress", + "forcePress", + "keyboard", + "toolbar", + "drag", + "scribble" + ] + }, + { + "id": "services/SmartDashesType", + "url": "https://api.flutter.dev/flutter/services/SmartDashesType.html", + "name": "SmartDashesType", + "values": [ + "disabled", + "enabled" + ] + }, + { + "id": "services/SmartQuotesType", + "url": "https://api.flutter.dev/flutter/services/SmartQuotesType.html", + "name": "SmartQuotesType", + "values": [ + "disabled", + "enabled" + ] + }, + { + "id": "widgets/SnapshotMode", + "url": "https://api.flutter.dev/flutter/widgets/SnapshotMode.html", + "name": "SnapshotMode", + "values": [ + "permissive", + "normal", + "forced" + ] + }, + { + "id": "rendering/StackFit", + "url": "https://api.flutter.dev/flutter/rendering/StackFit.html", + "name": "StackFit", + "values": [ + "loose", + "expand", + "passthrough" + ] + }, + { + "id": "dart-ui/StrokeCap", + "url": "https://api.flutter.dev/flutter/dart-ui/StrokeCap.html", + "name": "StrokeCap", + "values": [ + "butt", + "round", + "square" + ] + }, + { + "id": "dart-ui/StrokeJoin", + "url": "https://api.flutter.dev/flutter/dart-ui/StrokeJoin.html", + "name": "StrokeJoin", + "values": [ + "miter", + "round", + "bevel" + ] + }, + { + "id": "rendering/TableCellVerticalAlignment", + "url": "https://api.flutter.dev/flutter/rendering/TableCellVerticalAlignment.html", + "name": "TableCellVerticalAlignment", + "values": [ + "top", + "middle", + "bottom", + "baseline", + "fill" + ] + }, + { + "id": "foundation/TargetPlatform", + "url": "https://api.flutter.dev/flutter/foundation/TargetPlatform.html", + "name": "TargetPlatform", + "values": [ + "android", + "fuchsia", + "iOS", + "linux", + "macOS", + "windows" + ] + }, + { + "id": "dart-ui/TextAffinity", + "url": "https://api.flutter.dev/flutter/dart-ui/TextAffinity.html", + "name": "TextAffinity", + "values": [ + "upstream", + "downstream" + ] + }, + { + "id": "dart-ui/TextAlign", + "url": "https://api.flutter.dev/flutter/dart-ui/TextAlign.html", + "name": "TextAlign", + "values": [ + "left", + "right", + "center", + "justify", + "start", + "end" + ] + }, + { + "id": "dart-ui/TextBaseline", + "url": "https://api.flutter.dev/flutter/dart-ui/TextBaseline.html", + "name": "TextBaseline", + "values": [ + "alphabetic", + "ideographic" + ] + }, + { + "id": "services/TextCapitalization", + "url": "https://api.flutter.dev/flutter/services/TextCapitalization.html", + "name": "TextCapitalization", + "values": [ + "words", + "sentences", + "characters", + "none" + ] + }, + { + "id": "dart-ui/TextDecorationStyle", + "url": "https://api.flutter.dev/flutter/dart-ui/TextDecorationStyle.html", + "name": "TextDecorationStyle", + "values": [ + "solid", + "double", + "dotted", + "dashed", + "wavy" + ] + }, + { + "id": "dart-ui/TextDirection", + "url": "https://api.flutter.dev/flutter/dart-ui/TextDirection.html", + "name": "TextDirection", + "values": [ + "rtl", + "ltr" + ] + }, + { + "id": "services/TextInputAction", + "url": "https://api.flutter.dev/flutter/services/TextInputAction.html", + "name": "TextInputAction", + "values": [ + "none", + "unspecified", + "done", + "go", + "search", + "send", + "next", + "previous", + "continueAction", + "join", + "route", + "emergencyCall", + "newline" + ] + }, + { + "id": "dart-ui/TextLeadingDistribution", + "url": "https://api.flutter.dev/flutter/dart-ui/TextLeadingDistribution.html", + "name": "TextLeadingDistribution", + "values": [ + "proportional", + "even" + ] + }, + { + "id": "painting/TextOverflow", + "url": "https://api.flutter.dev/flutter/painting/TextOverflow.html", + "name": "TextOverflow", + "values": [ + "clip", + "fade", + "ellipsis", + "visible" + ] + }, + { + "id": "rendering/TextSelectionHandleType", + "url": "https://api.flutter.dev/flutter/rendering/TextSelectionHandleType.html", + "name": "TextSelectionHandleType", + "values": [ + "left", + "right", + "collapsed" + ] + }, + { + "id": "painting/TextWidthBasis", + "url": "https://api.flutter.dev/flutter/painting/TextWidthBasis.html", + "name": "TextWidthBasis", + "values": [ + "parent", + "longestLine" + ] + }, + { + "id": "dart-ui/TileMode", + "url": "https://api.flutter.dev/flutter/dart-ui/TileMode.html", + "name": "TileMode", + "values": [ + "clamp", + "repeated", + "mirror", + "decal" + ] + }, + { + "id": "widgets/TraversalDirection", + "url": "https://api.flutter.dev/flutter/widgets/TraversalDirection.html", + "name": "TraversalDirection", + "values": [ + "up", + "right", + "down", + "left" + ] + }, + { + "id": "widgets/UnfocusDisposition", + "url": "https://api.flutter.dev/flutter/widgets/UnfocusDisposition.html", + "name": "UnfocusDisposition", + "values": [ + "scope", + "previouslyFocusedChild" + ] + }, + { + "id": "dart-ui/VertexMode", + "url": "https://api.flutter.dev/flutter/dart-ui/VertexMode.html", + "name": "VertexMode", + "values": [ + "triangles", + "triangleStrip", + "triangleFan" + ] + }, + { + "id": "painting/VerticalDirection", + "url": "https://api.flutter.dev/flutter/painting/VerticalDirection.html", + "name": "VerticalDirection", + "values": [ + "up", + "down" + ] + }, + { + "id": "widgets/WidgetInspectorServiceExtensions", + "url": "https://api.flutter.dev/flutter/widgets/WidgetInspectorServiceExtensions.html", + "name": "WidgetInspectorServiceExtensions", + "values": [ + "structuredErrors", + "show", + "trackRebuildDirtyWidgets", + "trackRepaintWidgets", + "disposeAllGroups", + "disposeGroup", + "isWidgetTreeReady", + "disposeId", + "setPubRootDirectories", + "addPubRootDirectories", + "removePubRootDirectories", + "getPubRootDirectories", + "setSelectionById", + "getParentChain", + "getProperties", + "getChildren", + "getChildrenSummaryTree", + "getChildrenDetailsSubtree", + "getRootWidget", + "getRootRenderObject", + "getRootWidgetSummaryTree", + "getRootWidgetSummaryTreeWithPreviews", + "getDetailsSubtree", + "getSelectedRenderObject", + "getSelectedWidget", + "getSelectedSummaryWidget", + "isWidgetCreationTracked", + "screenshot", + "getLayoutExplorerNode", + "setFlexFit", + "setFlexFactor", + "setFlexProperties" + ] + }, + { + "id": "widgets/WidgetsServiceExtensions", + "url": "https://api.flutter.dev/flutter/widgets/WidgetsServiceExtensions.html", + "name": "WidgetsServiceExtensions", + "values": [ + "debugDumpApp", + "showPerformanceOverlay", + "didSendFirstFrameEvent", + "didSendFirstFrameRasterizedEvent", + "fastReassemble", + "profileWidgetBuilds", + "profileUserWidgetBuilds", + "debugAllowBanner" + ] + }, + { + "id": "rendering/WrapAlignment", + "url": "https://api.flutter.dev/flutter/rendering/WrapAlignment.html", + "name": "WrapAlignment", + "values": [ + "start", + "end", + "center", + "spaceBetween", + "spaceAround", + "spaceEvenly" + ] + }, + { + "id": "rendering/WrapCrossAlignment", + "url": "https://api.flutter.dev/flutter/rendering/WrapCrossAlignment.html", + "name": "WrapCrossAlignment", + "values": [ + "start", + "end", + "center" + ] + }, + { + "id": "foundation/DiagnosticsTreeStyle", + "url": "https://api.flutter.dev/flutter/foundation/DiagnosticsTreeStyle.html", + "name": "DiagnosticsTreeStyle", + "values": [ + "none", + "sparse", + "offstage", + "dense", + "transition", + "error", + "whitespace", + "flat", + "singleLine", + "errorProperty", + "shallow", + "truncateChildren" + ] + }, + { + "id": "foundation/FoundationServiceExtensions", + "url": "https://api.flutter.dev/flutter/foundation/FoundationServiceExtensions.html", + "name": "FoundationServiceExtensions", + "values": [ + "reassemble", + "exit", + "connectedVmServiceUri", + "activeDevToolsServerAddress", + "platformOverride", + "brightnessOverride" + ] + }, + { + "id": "gestures/DragStartBehavior", + "url": "https://api.flutter.dev/flutter/gestures/DragStartBehavior.html", + "name": "DragStartBehavior", + "values": [ + "down", + "start" + ] + }, + { + "id": "gestures/GestureDisposition", + "url": "https://api.flutter.dev/flutter/gestures/GestureDisposition.html", + "name": "GestureDisposition", + "values": [ + "accepted", + "rejected" + ] + }, + { + "id": "gestures/GestureRecognizerState", + "url": "https://api.flutter.dev/flutter/gestures/GestureRecognizerState.html", + "name": "GestureRecognizerState", + "values": [ + "ready", + "possible", + "defunct" + ] + }, + { + "id": "dart-ui/PointerDeviceKind", + "url": "https://api.flutter.dev/flutter/dart-ui/PointerDeviceKind.html", + "name": "PointerDeviceKind", + "values": [ + "touch", + "mouse", + "stylus", + "invertedStylus", + "trackpad", + "unknown" + ] + }, + { + "id": "material/BottomNavigationBarLandscapeLayout", + "url": "https://api.flutter.dev/flutter/material/BottomNavigationBarLandscapeLayout.html", + "name": "BottomNavigationBarLandscapeLayout", + "values": [ + "spread", + "centered", + "linear" + ] + }, + { + "id": "material/BottomNavigationBarType", + "url": "https://api.flutter.dev/flutter/material/BottomNavigationBarType.html", + "name": "BottomNavigationBarType", + "values": [ + "fixed", + "shifting" + ] + }, + { + "id": "material/ButtonBarLayoutBehavior", + "url": "https://api.flutter.dev/flutter/material/ButtonBarLayoutBehavior.html", + "name": "ButtonBarLayoutBehavior", + "values": [ + "constrained", + "padded" + ] + }, + { + "id": "material/ButtonTextTheme", + "url": "https://api.flutter.dev/flutter/material/ButtonTextTheme.html", + "name": "ButtonTextTheme", + "values": [ + "normal", + "accent", + "primary" + ] + }, + { + "id": "material/CollapseMode", + "url": "https://api.flutter.dev/flutter/material/CollapseMode.html", + "name": "CollapseMode", + "values": [ + "parallax", + "pin", + "none" + ] + }, + { + "id": "material/DatePickerEntryMode", + "url": "https://api.flutter.dev/flutter/material/DatePickerEntryMode.html", + "name": "DatePickerEntryMode", + "values": [ + "calendar", + "input", + "calendarOnly", + "inputOnly" + ] + }, + { + "id": "material/DatePickerMode", + "url": "https://api.flutter.dev/flutter/material/DatePickerMode.html", + "name": "DatePickerMode", + "values": [ + "day", + "year" + ] + }, + { + "id": "material/DayPeriod", + "url": "https://api.flutter.dev/flutter/material/DayPeriod.html", + "name": "DayPeriod", + "values": [ + "am", + "pm" + ] + }, + { + "id": "material/DrawerAlignment", + "url": "https://api.flutter.dev/flutter/material/DrawerAlignment.html", + "name": "DrawerAlignment", + "values": [ + "start", + "end" + ] + }, + { + "id": "material/FloatingLabelBehavior", + "url": "https://api.flutter.dev/flutter/material/FloatingLabelBehavior.html", + "name": "FloatingLabelBehavior", + "values": [ + "never", + "auto", + "always" + ] + }, + { + "id": "material/HourFormat", + "url": "https://api.flutter.dev/flutter/material/HourFormat.html", + "name": "HourFormat", + "values": [ + "HH", + "H", + "h" + ] + }, + { + "id": "material/ListTileControlAffinity", + "url": "https://api.flutter.dev/flutter/material/ListTileControlAffinity.html", + "name": "ListTileControlAffinity", + "values": [ + "leading", + "trailing", + "platform" + ] + }, + { + "id": "material/ListTileStyle", + "url": "https://api.flutter.dev/flutter/material/ListTileStyle.html", + "name": "ListTileStyle", + "values": [ + "list", + "drawer" + ] + }, + { + "id": "material/MaterialBannerClosedReason", + "url": "https://api.flutter.dev/flutter/material/MaterialBannerClosedReason.html", + "name": "MaterialBannerClosedReason", + "values": [ + "dismiss", + "swipe", + "hide", + "remove" + ] + }, + { + "id": "material/MaterialState", + "url": "https://api.flutter.dev/flutter/material/MaterialState.html", + "name": "MaterialState", + "values": [ + "hovered", + "focused", + "pressed", + "dragged", + "selected", + "scrolledUnder", + "disabled", + "error" + ] + }, + { + "id": "material/MaterialTapTargetSize", + "url": "https://api.flutter.dev/flutter/material/MaterialTapTargetSize.html", + "name": "MaterialTapTargetSize", + "values": [ + "padded", + "shrinkWrap" + ] + }, + { + "id": "material/MaterialType", + "url": "https://api.flutter.dev/flutter/material/MaterialType.html", + "name": "MaterialType", + "values": [ + "canvas", + "card", + "circle", + "button", + "transparency" + ] + }, + { + "id": "material/NavigationDestinationLabelBehavior", + "url": "https://api.flutter.dev/flutter/material/NavigationDestinationLabelBehavior.html", + "name": "NavigationDestinationLabelBehavior", + "values": [ + "alwaysShow", + "alwaysHide", + "onlyShowSelected" + ] + }, + { + "id": "material/NavigationRailLabelType", + "url": "https://api.flutter.dev/flutter/material/NavigationRailLabelType.html", + "name": "NavigationRailLabelType", + "values": [ + "none", + "selected", + "all" + ] + }, + { + "id": "material/PopupMenuPosition", + "url": "https://api.flutter.dev/flutter/material/PopupMenuPosition.html", + "name": "PopupMenuPosition", + "values": [ + "over", + "under" + ] + }, + { + "id": "material/RefreshIndicatorTriggerMode", + "url": "https://api.flutter.dev/flutter/material/RefreshIndicatorTriggerMode.html", + "name": "RefreshIndicatorTriggerMode", + "values": [ + "anywhere", + "onEdge" + ] + }, + { + "id": "material/ScriptCategory", + "url": "https://api.flutter.dev/flutter/material/ScriptCategory.html", + "name": "ScriptCategory", + "values": [ + "englishLike", + "dense", + "tall" + ] + }, + { + "id": "material/ShowValueIndicator", + "url": "https://api.flutter.dev/flutter/material/ShowValueIndicator.html", + "name": "ShowValueIndicator", + "values": [ + "onlyForDiscrete", + "onlyForContinuous", + "always", + "never" + ] + }, + { + "id": "material/SnackBarBehavior", + "url": "https://api.flutter.dev/flutter/material/SnackBarBehavior.html", + "name": "SnackBarBehavior", + "values": [ + "fixed", + "floating" + ] + }, + { + "id": "material/SnackBarClosedReason", + "url": "https://api.flutter.dev/flutter/material/SnackBarClosedReason.html", + "name": "SnackBarClosedReason", + "values": [ + "action", + "dismiss", + "swipe", + "hide", + "remove", + "timeout" + ] + }, + { + "id": "material/StepperType", + "url": "https://api.flutter.dev/flutter/material/StepperType.html", + "name": "StepperType", + "values": [ + "vertical", + "horizontal" + ] + }, + { + "id": "material/StepState", + "url": "https://api.flutter.dev/flutter/material/StepState.html", + "name": "StepState", + "values": [ + "indexed", + "editing", + "complete", + "disabled", + "error" + ] + }, + { + "id": "material/StretchMode", + "url": "https://api.flutter.dev/flutter/material/StretchMode.html", + "name": "StretchMode", + "values": [ + "zoomBackground", + "blurBackground", + "fadeTitle" + ] + }, + { + "id": "material/TabBarIndicatorSize", + "url": "https://api.flutter.dev/flutter/material/TabBarIndicatorSize.html", + "name": "TabBarIndicatorSize", + "values": [ + "tab", + "label" + ] + }, + { + "id": "material/ThemeMode", + "url": "https://api.flutter.dev/flutter/material/ThemeMode.html", + "name": "ThemeMode", + "values": [ + "system", + "light", + "dark" + ] + }, + { + "id": "material/Thumb", + "url": "https://api.flutter.dev/flutter/material/Thumb.html", + "name": "Thumb", + "values": [ + "start", + "end" + ] + }, + { + "id": "material/TimeOfDayFormat", + "url": "https://api.flutter.dev/flutter/material/TimeOfDayFormat.html", + "name": "TimeOfDayFormat", + "values": [ + "HH_colon_mm", + "HH_dot_mm", + "frenchCanadian", + "H_colon_mm", + "h_colon_mm_space_a", + "a_space_h_colon_mm" + ] + }, + { + "id": "material/TimePickerEntryMode", + "url": "https://api.flutter.dev/flutter/material/TimePickerEntryMode.html", + "name": "TimePickerEntryMode", + "values": [ + "dial", + "input", + "dialOnly", + "inputOnly" + ] + }, + { + "id": "material/TooltipTriggerMode", + "url": "https://api.flutter.dev/flutter/material/TooltipTriggerMode.html", + "name": "TooltipTriggerMode", + "values": [ + "manual", + "longPress", + "tap" + ] + }, + { + "id": "physics/SpringType", + "url": "https://api.flutter.dev/flutter/physics/SpringType.html", + "name": "SpringType", + "values": [ + "criticallyDamped", + "underDamped", + "overDamped" + ] + }, + { + "id": "semantics/Assertiveness", + "url": "https://api.flutter.dev/flutter/semantics/Assertiveness.html", + "name": "Assertiveness", + "values": [ + "polite", + "assertive" + ] + }, + { + "id": "rendering/CacheExtentStyle", + "url": "https://api.flutter.dev/flutter/rendering/CacheExtentStyle.html", + "name": "CacheExtentStyle", + "values": [ + "pixel", + "viewport" + ] + }, + { + "id": "semantics/DebugSemanticsDumpOrder", + "url": "https://api.flutter.dev/flutter/semantics/DebugSemanticsDumpOrder.html", + "name": "DebugSemanticsDumpOrder", + "values": [ + "inverseHitTest", + "traversalOrder" + ] + }, + { + "id": "rendering/PerformanceOverlayOption", + "url": "https://api.flutter.dev/flutter/rendering/PerformanceOverlayOption.html", + "name": "PerformanceOverlayOption", + "values": [ + "displayRasterizerStatistics", + "visualizeRasterizerStatistics", + "displayEngineStatistics", + "visualizeEngineStatistics" + ] + }, + { + "id": "rendering/PlatformViewHitTestBehavior", + "url": "https://api.flutter.dev/flutter/rendering/PlatformViewHitTestBehavior.html", + "name": "PlatformViewHitTestBehavior", + "values": [ + "opaque", + "translucent", + "transparent" + ] + }, + { + "id": "rendering/RenderAnimatedSizeState", + "url": "https://api.flutter.dev/flutter/rendering/RenderAnimatedSizeState.html", + "name": "RenderAnimatedSizeState", + "values": [ + "start", + "stable", + "changed", + "unstable" + ] + }, + { + "id": "rendering/RenderingServiceExtensions", + "url": "https://api.flutter.dev/flutter/rendering/RenderingServiceExtensions.html", + "name": "RenderingServiceExtensions", + "values": [ + "invertOversizedImages", + "debugPaint", + "debugPaintBaselinesEnabled", + "repaintRainbow", + "debugDumpLayerTree", + "debugDisableClipLayers", + "debugDisablePhysicalShapeLayers", + "debugDisableOpacityLayers", + "debugDumpRenderTree", + "debugDumpSemanticsTreeInTraversalOrder", + "debugDumpSemanticsTreeInInverseHitTestOrder", + "profileRenderObjectPaints", + "profileRenderObjectLayouts" + ] + }, + { + "id": "rendering/ScrollDirection", + "url": "https://api.flutter.dev/flutter/rendering/ScrollDirection.html", + "name": "ScrollDirection", + "values": [ + "idle", + "forward", + "reverse" + ] + }, + { + "id": "rendering/SelectionEventType", + "url": "https://api.flutter.dev/flutter/rendering/SelectionEventType.html", + "name": "SelectionEventType", + "values": [ + "startEdgeUpdate", + "endEdgeUpdate", + "clear", + "selectAll", + "selectWord", + "granularlyExtendSelection", + "directionallyExtendSelection" + ] + }, + { + "id": "rendering/SelectionExtendDirection", + "url": "https://api.flutter.dev/flutter/rendering/SelectionExtendDirection.html", + "name": "SelectionExtendDirection", + "values": [ + "previousLine", + "nextLine", + "forward", + "backward" + ] + }, + { + "id": "rendering/SelectionResult", + "url": "https://api.flutter.dev/flutter/rendering/SelectionResult.html", + "name": "SelectionResult", + "values": [ + "next", + "previous", + "end", + "pending", + "none" + ] + }, + { + "id": "rendering/SelectionStatus", + "url": "https://api.flutter.dev/flutter/rendering/SelectionStatus.html", + "name": "SelectionStatus", + "values": [ + "uncollapsed", + "collapsed", + "none" + ] + }, + { + "id": "rendering/TextGranularity", + "url": "https://api.flutter.dev/flutter/rendering/TextGranularity.html", + "name": "TextGranularity", + "values": [ + "character", + "word", + "line", + "document" + ] + }, + { + "id": "scheduler/SchedulerPhase", + "url": "https://api.flutter.dev/flutter/scheduler/SchedulerPhase.html", + "name": "SchedulerPhase", + "values": [ + "idle", + "transientCallbacks", + "midFrameMicrotasks", + "persistentCallbacks", + "postFrameCallbacks" + ] + }, + { + "id": "scheduler/SchedulerServiceExtensions", + "url": "https://api.flutter.dev/flutter/scheduler/SchedulerServiceExtensions.html", + "name": "SchedulerServiceExtensions", + "values": [ + "timeDilation" + ] + }, + { + "id": "services/DeviceOrientation", + "url": "https://api.flutter.dev/flutter/services/DeviceOrientation.html", + "name": "DeviceOrientation", + "values": [ + "portraitUp", + "landscapeLeft", + "portraitDown", + "landscapeRight" + ] + }, + { + "id": "services/FloatingCursorDragState", + "url": "https://api.flutter.dev/flutter/services/FloatingCursorDragState.html", + "name": "FloatingCursorDragState", + "values": [ + "Start", + "Update", + "End" + ] + }, + { + "id": "services/KeyboardSide", + "url": "https://api.flutter.dev/flutter/services/KeyboardSide.html", + "name": "KeyboardSide", + "values": [ + "any", + "left", + "right", + "all" + ] + }, + { + "id": "services/KeyDataTransitMode", + "url": "https://api.flutter.dev/flutter/services/KeyDataTransitMode.html", + "name": "KeyDataTransitMode", + "values": [ + "rawKeyData", + "keyDataThenRawKeyData" + ] + }, + { + "id": "services/MaxLengthEnforcement", + "url": "https://api.flutter.dev/flutter/services/MaxLengthEnforcement.html", + "name": "MaxLengthEnforcement", + "values": [ + "none", + "enforced", + "truncateAfterCompositionEnds" + ] + }, + { + "id": "services/ModifierKey", + "url": "https://api.flutter.dev/flutter/services/ModifierKey.html", + "name": "ModifierKey", + "values": [ + "controlModifier", + "shiftModifier", + "altModifier", + "metaModifier", + "capsLockModifier", + "numLockModifier", + "scrollLockModifier", + "functionModifier", + "symbolModifier" + ] + }, + { + "id": "services/ServicesServiceExtensions", + "url": "https://api.flutter.dev/flutter/services/ServicesServiceExtensions.html", + "name": "ServicesServiceExtensions", + "values": [ + "evict" + ] + }, + { + "id": "services/SystemSoundType", + "url": "https://api.flutter.dev/flutter/services/SystemSoundType.html", + "name": "SystemSoundType", + "values": [ + "click", + "alert" + ] + }, + { + "id": "services/SystemUiMode", + "url": "https://api.flutter.dev/flutter/services/SystemUiMode.html", + "name": "SystemUiMode", + "values": [ + "leanBack", + "immersive", + "immersiveSticky", + "edgeToEdge", + "manual" + ] + }, + { + "id": "services/SystemUiOverlay", + "url": "https://api.flutter.dev/flutter/services/SystemUiOverlay.html", + "name": "SystemUiOverlay", + "values": [ + "top", + "bottom" + ] + }, + { + "id": "dart-ui/BoxHeightStyle", + "url": "https://api.flutter.dev/flutter/dart-ui/BoxHeightStyle.html", + "name": "BoxHeightStyle", + "values": [ + "tight", + "max", + "includeLineSpacingMiddle", + "includeLineSpacingTop", + "includeLineSpacingBottom", + "strut" + ] + }, + { + "id": "dart-ui/BoxWidthStyle", + "url": "https://api.flutter.dev/flutter/dart-ui/BoxWidthStyle.html", + "name": "BoxWidthStyle", + "values": [ + "tight", + "max" + ] + }, + { + "id": "dart-ui/ClipOp", + "url": "https://api.flutter.dev/flutter/dart-ui/ClipOp.html", + "name": "ClipOp", + "values": [ + "difference", + "intersect" + ] + }, + { + "id": "dart-ui/DartPerformanceMode", + "url": "https://api.flutter.dev/flutter/dart-ui/DartPerformanceMode.html", + "name": "DartPerformanceMode", + "values": [ + "balanced", + "latency", + "throughput", + "memory" + ] + }, + { + "id": "dart-ui/DisplayFeatureState", + "url": "https://api.flutter.dev/flutter/dart-ui/DisplayFeatureState.html", + "name": "DisplayFeatureState", + "values": [ + "unknown", + "postureFlat", + "postureHalfOpened" + ] + }, + { + "id": "dart-ui/DisplayFeatureType", + "url": "https://api.flutter.dev/flutter/dart-ui/DisplayFeatureType.html", + "name": "DisplayFeatureType", + "values": [ + "unknown", + "fold", + "hinge", + "cutout" + ] + }, + { + "id": "dart-ui/FramePhase", + "url": "https://api.flutter.dev/flutter/dart-ui/FramePhase.html", + "name": "FramePhase", + "values": [ + "vsyncStart", + "buildStart", + "buildFinish", + "rasterStart", + "rasterFinish", + "rasterFinishWallTime" + ] + }, + { + "id": "dart-ui/ImageByteFormat", + "url": "https://api.flutter.dev/flutter/dart-ui/ImageByteFormat.html", + "name": "ImageByteFormat", + "values": [ + "rawRgba", + "rawStraightRgba", + "rawUnmodified", + "png" + ] + }, + { + "id": "dart-ui/KeyEventType", + "url": "https://api.flutter.dev/flutter/dart-ui/KeyEventType.html", + "name": "KeyEventType", + "values": [ + "down", + "up", + "repeat" + ] + }, + { + "id": "dart-ui/PixelFormat", + "url": "https://api.flutter.dev/flutter/dart-ui/PixelFormat.html", + "name": "PixelFormat", + "values": [ + "rgba8888", + "bgra8888" + ] + }, + { + "id": "dart-ui/PointerChange", + "url": "https://api.flutter.dev/flutter/dart-ui/PointerChange.html", + "name": "PointerChange", + "values": [ + "cancel", + "add", + "remove", + "hover", + "down", + "move", + "up", + "panZoomStart", + "panZoomUpdate", + "panZoomEnd" + ] + }, + { + "id": "dart-ui/PointerSignalKind", + "url": "https://api.flutter.dev/flutter/dart-ui/PointerSignalKind.html", + "name": "PointerSignalKind", + "values": [ + "none", + "scroll", + "scrollInertiaCancel", + "scale", + "unknown" + ] + }, + { + "id": "dart-ui/PointMode", + "url": "https://api.flutter.dev/flutter/dart-ui/PointMode.html", + "name": "PointMode", + "values": [ + "points", + "lines", + "polygon" + ] + }, + { + "id": "dart-io/HttpClientResponseCompressionState", + "url": "https://api.flutter.dev/flutter/dart-io/HttpClientResponseCompressionState.html", + "name": "HttpClientResponseCompressionState", + "values": [ + "notCompressed", + "decompressed", + "compressed" + ] + } +] \ No newline at end of file diff --git a/flutter-docs/enums/index.ts b/flutter-docs/enums/index.ts new file mode 100644 index 0000000..3ab60e6 --- /dev/null +++ b/flutter-docs/enums/index.ts @@ -0,0 +1,212 @@ +import Axios from "axios"; +import xpath from "xpath"; +import xmldom from "xmldom"; +import assert from "assert"; +import fs from "fs"; +import path from "path"; +import ora from "ora"; +import { dts } from "./dts"; + +const dom = xmldom.DOMParser; + +const entry = [ + "animation", + "cupertino", + "foundation", + "gestures", + "material", + "painting", + "physics", + "rendering", + "scheduler", + "semantics", + "services", + "widgets", + "dart-ui", + // "dart-wasm", + "dart-async", + "dart-collection", + "dart-convert", + "dart-core", + "dart-developer", + "dart-math", + "dart-typed_data", + "dart-ffi", + "dart-io", + "dart-isolate", + "dart-html", + "dart-js", + "dart-js_util", + // "Android", + // "iOS", + // "flutter_test", + // "flutter_driver", + // "flutter_driver_extension", + // "flutter_localizations", + // "flutter_web_plugins", + // "url_strategy", + // "archive", + // "archive_io", + // "async", + // "boolean_selector", + // "characters", + // "clock", + // "collection", + // "crypto", +]; + +const entry_urls = entry.map((item) => { + return `/${item}/${item}-library.html`; +}); + +const client = Axios.create({ + baseURL: "https://api.flutter.dev/flutter/", +}); + +export interface FlutterDocEnumDefinition { + name: string; + url: string; + id: string; + values?: Array; +} + +async function readdoc(url: string) { + try { + const { data: html } = await client.get(url); + const doc = new dom({ + errorHandler: { + warning: (w) => {}, + error: (e) => {}, + fatalError: (e) => {}, + }, + }).parseFromString(html); + return doc; + } catch (e) { + return null; + } +} + +async function enums_from_library_doc(doc: Document) { + assert(doc !== null, "doc is null"); + + const enum_names = xpath.select( + // + "//section[@id='enums']//dt//a/text()", + doc + ); + + const enum_urls = xpath.select( + // + "//section[@id='enums']//dt//a/@href", + doc + ); + + const enums: Array = []; + + for (let i = 0; i < enum_names.length; i++) { + const name = enum_names[i]["data"]; + const _url = enum_urls[i]["value"]; + + // remove .html suffix + const id = _url.split(".html")[0]; + const url = `https://api.flutter.dev/flutter/${id}.html`; + + enums.push({ + name, + url, + id, + }); + } + + return enums; +} + +async function parse_enums_from_docs(...urls: Array) { + const enums: Array = []; + for (const url of urls) { + const doc = await readdoc(url); + if (doc) { + enums.push(...(await enums_from_library_doc(doc))); + } + } + + // filter duplicates with id + const uniques = enums.filter( + (value, index, self) => index === self.findIndex((t) => t.id === value.id) + ); + + return uniques; +} + +async function parse_enum_details_from_enum_doc({ + id, + name, + url, +}: FlutterDocEnumDefinition) { + const doc = await readdoc(url); + // values + // //section[@id="values"]/dl[@class="properties"]/dt/span[1]/text() + + // description + // //section[@id="values"]/dl[@class="properties"]/dd/text() + + const value_names = xpath + .select( + "//section[@id='values']/dl[@class='properties']/dt/span[1]/text()", + doc + ) + .map((item) => item["data"]); + + const values: string[] = []; + + for (let i = 0; i < value_names.length; i++) { + const name = value_names[i]; + + values.push(name); + } + + return { + id, + url, + name, + values, + }; +} + +async function main() { + const targets = Array.from(new Set(entry_urls)); + const spinner = ora( + "Parsing " + targets.length + " entries from flutter docs" + ).start(); + const defs: Array = await parse_enums_from_docs( + ...targets + ); + + spinner.succeed("Parsed"); + + const enums: Array = []; + + // parse details + spinner.start("Parsing details"); + for (const enum_ of defs) { + spinner.text = `Parsing details of ${enum_.name}`; + const detail = await parse_enum_details_from_enum_doc(enum_); + enums.push(detail); + } + + spinner.succeed("Parsed details"); + + fs.writeFileSync( + path.join(__dirname, "enums.json"), + JSON.stringify(enums, null, 2) + ); + + console.log('wrote "enums.json" to disk with ' + defs.length + " entries"); + + // write flutter-enums.d.ts + const dtstext = dts(enums); + fs.writeFileSync(path.join(__dirname, "../flutter-enums.d.ts"), dtstext); + console.log('wrote "flutter-enums.d.ts" to disk'); +} + +main(); diff --git a/flutter-docs/enums/readme.md b/flutter-docs/enums/readme.md new file mode 100644 index 0000000..763bd74 --- /dev/null +++ b/flutter-docs/enums/readme.md @@ -0,0 +1,250 @@ +## LIBRARIES + +- [animation](https://api.flutter.dev/flutter/animation/animation-library.html#enums) +- [cupertino](https://api.flutter.dev/flutter/cupertino/cupertino-library.html#enums) +- [foundation](https://api.flutter.dev/flutter/foundation/foundation-library.html#enums) +- [gestures](https://api.flutter.dev/flutter/gestures/gestures-library.html#enums) +- [material](https://api.flutter.dev/flutter/material/material-library.html#enums) +- [painting](https://api.flutter.dev/flutter/painting/painting-library.html#enums) +- [physics](https://api.flutter.dev/flutter/physics/physics-library.html#enums) +- [rendering](https://api.flutter.dev/flutter/rendering/rendering-library.html#enums) +- [scheduler](https://api.flutter.dev/flutter/scheduler/scheduler-library.html#enums) +- [semantics](https://api.flutter.dev/flutter/semantics/semantics-library.html#enums) +- [services](https://api.flutter.dev/flutter/services/services-library.html#enums) +- [widgets](https://api.flutter.dev/flutter/widgets/widgets-library.html#enums) + +## DART + +- [dart:ui](https://api.flutter.dev/flutter/dart-ui/dart-ui-library.html#enums) +- dart:wasm (None) + +CORE + +- dart:async +- dart:collection +- dart:convert +- dart:core +- dart:developer +- dart:math +- dart:typed_data + +VM + +- dart:ffi +- dart:io +- dart:isolate + +WEB + +- dart:html +- dart:js +- dart:js_util + +PLATFORM_INTEGRATION + +- Android +- iOS + +FLUTTER_TEST + +- flutter_test + +FLUTTER_DRIVER + +- flutter_driver +- flutter_driver_extension + +FLUTTER + +FLUTTER_LOCALIZATIONS + +- flutter_localizations + +FLUTTER_WEB_PLUGINS + +- flutter_web_plugins +- url_strategy + +ARCHIVE + +- archive +- archive_io + +ASYNC + +- async + +BOOLEAN_SELECTOR + +- boolean_selector + +CHARACTERS + +- characters + +CLOCK + +- clock + +COLLECTION + +- collection +- ~~dart.pkg.collection.algorithms~~ +- ~~dart.pkg.collection.equality~~ +- ~~dart.pkg.collection.iterable_zip~~ +- ~~dart.pkg.collection.priority_queue~~ +- ~~dart.pkg.collection.wrappers~~ + +CRYPTO + +- crypto + +FAKE_ASYNC + +- fake_async + +FILE + +- chroot +- file +- local +- memory + +INTEGRATION_TEST + +- \_callback_io +- \_callback_web +- \_extension_io +- \_extension_web +- common +- integration_test +- integration_test_driver +- integration_test_driver_extended + +INTL + +- date_symbol_data_custom +- date_symbol_data_file +- date_symbol_data_http_request +- date_symbol_data_local +- date_symbols +- date_time_patterns +- intl +- intl_standalone +- locale +- message_format +- message_lookup_by_library +- number_symbol_data +- number_symbols + +MATCHER + +- matcher + +MATERIAL_COLOR_UTILITIES + +- blend +- cam16 +- color_utils +- core_palette +- hct +- hct_solver +- material_color_utilities +- math_utils +- point_provider +- point_provider_lab +- quantizer +- quantizer_celebi +- quantizer_map +- quantizer_wsmeans +- quantizer_wu +- scheme +- score +- string_utils +- tonal_palette +- viewing_conditions + +META + +- meta +- meta_dart2js +- meta_meta + +PATH + +- path + +PLATFORM + +- platform + +PROCESS + +- process + +SOURCE_SPAN + +- source_span + +STACK_TRACE + +- stack_trace + +STREAM_CHANNEL + +- isolate_channel +- stream_channel + +STRING_SCANNER + +- string_scanner + +SYNC_HTTP + +- sync.http + +TERM_GLYPH + +- term_glyph + +TEST_API + +- expect +- hooks +- ~~test_api~~ +- ~~test_api.backend~~ +- ~~test_api.fake~~ +- ~~test_api.scaffolding~~ + +TYPED_DATA + +- typed_data +- typed_data.typed_buffers + +VECTOR_MATH + +- ~~hash~~ +- vector_math +- vector_math_64 +- vector_math_geometry +- vector_math_lists +- vector_math_operations + +VM_SERVICE + +- utils +- vm_service +- vm_service_io + +WEBDRIVER + +- webdriver.core +- webdriver.core +- webdriver.html +- webdriver.io +- webdriver.io +- webdriver.support.async +- webdriver.support.firefox_profile +- webdriver.support.stdio_stepper +- webdriver.sync_core +- webdriver.sync_io diff --git a/flutter-docs/package.json b/flutter-docs/package.json new file mode 100644 index 0000000..78f550d --- /dev/null +++ b/flutter-docs/package.json @@ -0,0 +1,30 @@ +{ + "name": "dart-doc-parser", + "version": "0.0.1", + "repository": "https://github.com/bridgedxyz/flutter-builder", + "author": "Grida, Inc.", + "license": "MIT", + "private": false, + "main": "dist/index.js", + "dependencies": { + "axios": "^0.21.0", + "coli": "^0.0.2", + "ora": "5.0.0", + "xmldom": "^0.6.0", + "xpath": "^0.0.32" + }, + "devDependencies": { + "@types/node": "^16.10.1", + "@types/xmldom": "^0.1.31", + "ts-node": "^10.9.1", + "typescript": "^4.0.5" + }, + "files": [ + "dist", + "README.md", + "LICENSE" + ], + "publishConfig": { + "access": "public" + } +} diff --git a/flutter-docs/readme.md b/flutter-docs/readme.md new file mode 100644 index 0000000..e69de29 diff --git a/flutter-docs/yarn.lock b/flutter-docs/yarn.lock new file mode 100644 index 0000000..a8dd233 --- /dev/null +++ b/flutter-docs/yarn.lock @@ -0,0 +1,293 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== + +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" + integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== + +"@types/node@^16.10.1": + version "16.18.12" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.12.tgz#e3bfea80e31523fde4292a6118f19ffa24fd6f65" + integrity sha512-vzLe5NaNMjIE3mcddFVGlAXN1LEWueUsMsOJWaT6wWMJGyljHAWHznqfnKUQWGzu7TLPrGvWdNAsvQYW+C0xtw== + +"@types/xmldom@^0.1.31": + version "0.1.31" + resolved "https://registry.yarnpkg.com/@types/xmldom/-/xmldom-0.1.31.tgz#519b647cfc66debf82cdf50e49763c8fdee553d6" + integrity sha512-bVy7s0nvaR5D1mT1a8ZkByHWNOGb6Vn4yi5TWhEdmyKlAG+08SA7Md6+jH+tYmMLueAwNeWvHHpeKrr6S4c4BA== + +acorn-walk@^8.1.1: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + +acorn@^8.4.1: + version "8.8.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +axios@^0.21.0: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== + dependencies: + follow-redirects "^1.14.0" + +chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +cli-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + dependencies: + restore-cursor "^3.1.0" + +cli-spinners@^2.4.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.7.0.tgz#f815fd30b5f9eaac02db604c7a231ed7cb2f797a" + integrity sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw== + +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== + +coli@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/coli/-/coli-0.0.2.tgz#830bcdbecc5936b8cfe7bfa68621544bdcda0726" + integrity sha512-GDum+hiIcQj8bCV8swxsFzPebfJ57z9on4SapKL4tUN6TQbazxfT6YPZV5NK90mKstP2R+v9rut7lJdfF7p8CQ== + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +defaults@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" + integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== + dependencies: + clone "^1.0.2" + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +follow-redirects@^1.14.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +is-interactive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" + integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +log-symbols@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +mute-stream@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" + integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== + +onetime@^5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +ora@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ora/-/ora-5.0.0.tgz#4f0b34f2994877b49b452a707245ab1e9f6afccb" + integrity sha512-s26qdWqke2kjN/wC4dy+IQPBIMWBJlSU/0JZhk30ZDBLelW25rv66yutUWARMigpGPzcXHb+Nac5pNhN/WsARw== + dependencies: + chalk "^4.1.0" + cli-cursor "^3.1.0" + cli-spinners "^2.4.0" + is-interactive "^1.0.0" + log-symbols "^4.0.0" + mute-stream "0.0.8" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" + +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + +signal-exit@^3.0.2: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +strip-ansi@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +ts-node@^10.9.1: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + +typescript@^4.0.5: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + +wcwidth@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== + dependencies: + defaults "^1.0.3" + +xmldom@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.6.0.tgz#43a96ecb8beece991cef382c08397d82d4d0c46f" + integrity sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg== + +xpath@^0.0.32: + version "0.0.32" + resolved "https://registry.yarnpkg.com/xpath/-/xpath-0.0.32.tgz#1b73d3351af736e17ec078d6da4b8175405c48af" + integrity sha512-rxMJhSIoiO8vXcWvSifKqhvV96GjiD5wYb8/QHdoRyQvraTpp4IEv944nhGausZZ3u7dhQXteZuZbaqfpB7uYw== + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== diff --git a/flutter-preview/docs/index.md b/flutter-preview/docs/index.md new file mode 100644 index 0000000..2e84b22 --- /dev/null +++ b/flutter-preview/docs/index.md @@ -0,0 +1,47 @@ +# Flutter Widget Preview + +## Supported Property Types + +**CORE** + +- [x] `bool` +- [x] `int` +- [x] `double` +- [x] `String` +- [x] `Function` +- [ ] `List` +- [ ] `Map` +- [ ] `Class` + +**dart:core** + +- [ ] `Duration` + +**dart:ui** + +- [x] `Color` +- [ ] `VoidCallback` + +**flutter/rendering** + +- [x] `CrossAxisAlignment` +- [x] `MainAxisAlignment` + +**flutter/painting** + +- [ ] `BorderRadius` +- [ ] `TextStyle` + +**flutter/widgets** + +- [ ] `IconData` +- [ ] `Widget` + +**flutter/material** + +- [ ] `Icons` +- [ ] `Colors` + +**Others** + +- `GlobalKey` diff --git a/flutter-preview/flutter-preview-analyzer/analyze-type/index.ts b/flutter-preview/flutter-preview-analyzer/analyze-type/index.ts new file mode 100644 index 0000000..5fa5fc4 --- /dev/null +++ b/flutter-preview/flutter-preview-analyzer/analyze-type/index.ts @@ -0,0 +1,87 @@ +import { + FlutterEnumType, + all, + FlutterDocEnumDefinition, +} from "@flutter-builder/metadata-enums"; + +export const flutter_preview_supported_types: DartType[] = [ + // dart:core + "bool", + "double", + "int", + "num", + "String", + // dart:ui + "Color", + // flutter/* eunms + ...(all.map((e) => e.id) as FlutterEnumType[]), +]; + +export type DartCoreType = + /** + * https://api.dart.dev/stable/2.19.2/dart-core/BigInt-class.html + */ + | "BigInt" + /** + * https://api.dart.dev/stable/2.19.2/dart-core/bool-class.html + */ + | "bool" + /** + * https://api.dart.dev/stable/2.19.2/dart-core/DateTime-class.html + */ + | "DateTime" + /** + * https://api.dart.dev/stable/2.19.2/dart-core/double-class.html + */ + | "double" + /** + * https://api.dart.dev/stable/2.19.2/dart-core/Duration-class.html + */ + | "Duration" + /** + * https://api.dart.dev/stable/2.19.2/dart-core/Enum-class.html + */ + | "Enum" + /** + * https://api.dart.dev/stable/2.19.2/dart-core/Function-class.html + */ + | "Function" + /** + * https://api.dart.dev/stable/2.19.2/dart-core/int-class.html + */ + | "int" + /** + * https://api.dart.dev/stable/2.19.2/dart-core/num-class.html + */ + | "num" + /** + * https://api.dart.dev/stable/2.19.2/dart-core/Object-class.html + */ + | "Object" + /** + * https://api.dart.dev/stable/2.19.2/dart-core/String-class.html + */ + | "String" + // + | "dynamic"; + +export type DartUIType = "Color"; + +export type DartType = DartCoreType | DartUIType | FlutterEnumType; + +export function isTypeFlutterEnum( + type: DartType +): false | FlutterDocEnumDefinition { + const maybe = all.find((e) => e.id === type); + if (maybe) { + return maybe; + } + return false; +} + +export function isTypeSupportedByFlutterPreview(typelike: string): boolean { + // if type comes with optional '?', remove it + const type = typelike.endsWith("?") ? typelike.slice(0, -1) : typelike; + + return flutter_preview_supported_types.includes(type as DartType); +} diff --git a/flutter-preview/flutter-preview-analyzer/analyzer.ts b/flutter-preview/flutter-preview-analyzer/analyzer.ts index ab567be..81b2397 100644 --- a/flutter-preview/flutter-preview-analyzer/analyzer.ts +++ b/flutter-preview/flutter-preview-analyzer/analyzer.ts @@ -1,5 +1,6 @@ import assert from "assert"; import ast from "flutter-ast"; +import { isTypeSupportedByFlutterPreview } from "./analyze-type"; export class Analyzer { constructor(readonly text: string) {} @@ -18,7 +19,8 @@ export class Analyzer { const widget_classes = classes.filter( (c) => c.extendsClause === "extends StatelessWidget" || - c.extendsClause === "extends StatefulWidget" + c.extendsClause === "extends StatefulWidget" || + c.extendsClause === "extends ImplicitlyAnimatedWidget" ); return widget_classes.map((c) => { @@ -27,43 +29,27 @@ export class Analyzer { id: c.name, name: c.name, constructors: c.constructors.map((constr) => { - return { + const an = new WidgetAnalyzer(constr); + const { required, supported, unsupported } = an.analyzeProperties(); + const required_and_unsupported: Array = + required.filter((p) => + // with id (name) + unsupported.some((u) => u.name === p.name) + ); + + const contains_required_unsupported_properties = + required_and_unsupported.length > 0; + + return { start: constr.offset, name: constr.name, parameters: constr.properties, analysis: { - requires_arguments: - constr.properties.filter((p) => { - const { - name, - isOptional, - value: defaultValue, - isRequired, - } = p; - - // [no-allow] to required properties - if (isRequired) { - return true; - } - - // [allow] nullable properties - if (isOptional) { - return false; - } - - // [allow] properties with default values - if (defaultValue) { - return false; - } - - // [allow] "key" property (to be very safe, we have to check its type to be WidgetKey) - // but to do this, this requires full type analysis - if (name === "key") { - return false; - } - - return true; - }).length > 0, + requires_properties: required.length > 0, + required_properties: required, + contains_unsupported_properties: unsupported.length > 0, + required_and_unsupported_properties: required_and_unsupported, + contains_required_unsupported_properties, }, }; }), @@ -72,14 +58,88 @@ export class Analyzer { } } -interface WidgetAnalysis { +class WidgetAnalyzer { + constructor(readonly widget: ast.DartConstructor) { + // + } + + analyzeProperties() { + const result = this.widget.properties.reduce( + (acc, p) => { + const { type } = p; + if (isPropertyRequired(p)) { + acc.required.push(p); + } + + if (type) { + if (isTypeSupportedByFlutterPreview(type)) { + acc.supported.push(p); + } else { + acc.unsupported.push(p); + } + } + + return acc; + }, + { + required: [], + supported: [], + unsupported: [], + } + ); + + return result; + } +} + +function isPropertyRequired(p: ast.DartProperty) { + const { name, isOptional, value: defaultValue, isRequired, type } = p; + + // [no-allow] to required properties + if (isRequired) { + return true; + } + + // [allow] nullable properties + const isNullable = type?.endsWith("?"); + if (isNullable) { + return false; + } + + // [allow] optional properties + if (isOptional) { + return false; + } + + // [allow] properties with default values + if (defaultValue) { + return false; + } + + // [allow] "key" property (to be very safe, we have to check its type to be WidgetKey) + // but to do this, this requires full type analysis + // if (name === "key") { + // return false; + // } + + return true; +} + +export interface WidgetAnalysis { start: number; id: string; name: string; constructors: WidgetContructor[]; } -interface WidgetContructor { +export interface PropertyMetadata { + name: string; + type: string; + required: boolean; + default: string; +} + +export interface WidgetContructor { start: number; /** @@ -93,6 +153,16 @@ interface WidgetContructor { /** * rather if explicit arguments are required to be successfully instanciated, compiled. */ - requires_arguments: boolean; + requires_properties: boolean; + + required_properties: ast.DartProperty[]; + + unsupported_properties: ast.DartProperty[]; + + contains_unsupported_properties: boolean; + + required_and_unsupported_properties: ast.DartProperty[]; + + contains_required_unsupported_properties: boolean; }; } diff --git a/flutter-preview/flutter-preview-analyzer/index.ts b/flutter-preview/flutter-preview-analyzer/index.ts index 73aebd3..92db067 100644 --- a/flutter-preview/flutter-preview-analyzer/index.ts +++ b/flutter-preview/flutter-preview-analyzer/index.ts @@ -1 +1,2 @@ export * from "./analyzer"; +export * as type from "./analyze-type"; diff --git a/flutter-preview/flutter-preview-analyzer/package.json b/flutter-preview/flutter-preview-analyzer/package.json index 63a0bb2..81ae548 100644 --- a/flutter-preview/flutter-preview-analyzer/package.json +++ b/flutter-preview/flutter-preview-analyzer/package.json @@ -13,7 +13,7 @@ "dev": "tsup --watch --sourcemap" }, "dependencies": { - "flutter-ast": "^0.0.4-3" + "flutter-ast": "^0.0.4-4" }, "files": [ "dist", @@ -23,4 +23,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/flutter-preview/flutter-preview-analyzer/resolution/index.ts b/flutter-preview/flutter-preview-analyzer/resolution/index.ts new file mode 100644 index 0000000..7251310 --- /dev/null +++ b/flutter-preview/flutter-preview-analyzer/resolution/index.ts @@ -0,0 +1,1534 @@ +// The import resolution. +// e.g. the `Color` type is from dart:ui package, but, it is most common imported from `package:flutter/material.dart` package. +// to resolve the import, we need to know the package name and the import path. + +interface ModuleResolution { + package: string; + dependencies: Array; + exports: Array; +} + +const resolutions: { [key: string]: ModuleResolution } = { + "dart:core": { + package: "dart:core", + dependencies: [], + exports: [], + }, + "dart:math": { + package: "dart:core", + dependencies: [], + exports: [], + }, + "dart:ui": { + package: "dart:ui", + dependencies: [], + exports: [ + // CLASSES + "AccessibilityFeatures", + "BackdropFilterEngineLayer", + "CallbackHandle", + "Canvas", + "ChannelBuffers", + "ClipPathEngineLayer", + "ClipRectEngineLayer", + "ClipRRectEngineLayer", + "Codec", + "Color", + "ColorFilter", + "ColorFilterEngineLayer", + "DartPluginRegistrant", + "DisplayFeature", + "EngineLayer", + "FlutterView", + "FlutterWindow", + "FontFeature", + "FontVariation", + "FontWeight", + "FragmentProgram", + "FragmentShader", + "FrameData", + "FrameInfo", + "FrameTiming", + "GestureSettings", + "Gradient", + "Image", + "ImageDescriptor", + "ImageFilter", + "ImageFilterEngineLayer", + "ImageShader", + "ImmutableBuffer", + "IsolateNameServer", + "KeyData", + "LineMetrics", + "Locale", + "LocaleStringAttribute", + "MaskFilter", + "Offset", + "OffsetBase", + "OffsetEngineLayer", + "OpacityEngineLayer", + "Paint", + "Paragraph", + "ParagraphBuilder", + "ParagraphConstraints", + "ParagraphStyle", + "Path", + "PathMetric", + "PathMetricIterator", + "PathMetrics", + "PhysicalShapeEngineLayer", + "Picture", + "PictureRecorder", + "PlatformConfiguration", + "PlatformDispatcher", + "PluginUtilities", + "PointerData", + "PointerDataPacket", + "Radius", + "Rect", + "RootIsolateToken", + "RRect", + "RSTransform", + "Scene", + "SceneBuilder", + "SemanticsAction", + "SemanticsFlag", + "SemanticsUpdate", + "SemanticsUpdateBuilder", + "Shader", + "ShaderMaskEngineLayer", + "Shadow", + "SingletonFlutterWindow", + "Size", + "SpellOutStringAttribute", + "StringAttribute", + "StrutStyle", + "Tangent", + "TextBox", + "TextDecoration", + "TextHeightBehavior", + "TextPosition", + "TextRange", + "TextStyle", + "TransformEngineLayer", + "Vertices", + "ViewConfiguration", + "WindowPadding", + // CONSTANTS + "keepToString", + // PROPERTIES + "channelBuffers", + "window", + // FUNCTIONS + "clampDouble", + "decodeImageFromList", + "decodeImageFromPixels", + "hashList", + "hashValues", + "instantiateImageCodec", + "instantiateImageCodecFromBuffer", + "lerpDouble", + "loadFontFromList", + "saveCompilationTrace", + // ENUMS + "AppLifecycleState", + "BlendMode", + "BlurStyle", + "BoxHeightStyle", + "BoxWidthStyle", + "Brightness", + "Clip", + "ClipOp", + "DartPerformanceMode", + "DisplayFeatureState", + "DisplayFeatureType", + "FilterQuality", + "FontStyle", + "FramePhase", + "ImageByteFormat", + "KeyEventType", + "PaintingStyle", + "PathFillType", + "PathOperation", + "PixelFormat", + "PlaceholderAlignment", + "PointerChange", + "PointerDeviceKind", + "PointerSignalKind", + "PointMode", + "StrokeCap", + "StrokeJoin", + "TextAffinity", + "TextAlign", + "TextBaseline", + "TextDecorationStyle", + "TextDirection", + "TextLeadingDistribution", + "TileMode", + "VertexMode", + // TYPEDEFS + "ChannelCallback", + "DrainChannelCallback", + "ErrorCallback", + "FrameCallback", + "ImageDecoderCallback", + "ImageEventCallback", + "KeyDataCallback", + "PictureEventCallback", + "PlatformConfigurationChangedCallback", + "PlatformMessageCallback", + "PlatformMessageResponseCallback", + "PointerDataPacketCallback", + "SemanticsActionCallback", + "TimingsCallback", + "VoidCallback", + // EXCEPTIONS + "PictureRasterizationException", + ], + }, + "flutter/foundation": { + package: "flutter/foundation", + dependencies: ["dart:ui"], + exports: [], + }, + // https://api.flutter.dev/flutter/painting/painting-library.html + "flutter/painting": { + package: "flutter/painting", + dependencies: ["dart:ui"], + exports: [ + // CLASSES + "Accumulator", + "Alignment", + "AlignmentDirectional", + "AlignmentGeometry", + "AssetBundleImageKey", + "AssetBundleImageProvider", + "AssetImage", + "AutomaticNotchedShape", + "BeveledRectangleBorder", + "Border", + "BorderDirectional", + "BorderRadius", + "BorderRadiusDirectional", + "BorderRadiusGeometry", + "BorderSide", + "BoxBorder", + "BoxDecoration", + "BoxPainter", + "BoxShadow", + "Canvas", + "CircleBorder", + "CircularNotchedRectangle", + "ClipContext", + "Color", + "ColorFilter", + "ColorProperty", + "ColorSwatch", + "ContinuousRectangleBorder", + "Decoration", + "DecorationImage", + "DecorationImagePainter", + "EdgeInsets", + "EdgeInsetsDirectional", + "EdgeInsetsGeometry", + "ExactAssetImage", + "FileImage", + "FittedSizes", + "FlutterLogoDecoration", + "FontWeight", + "FractionalOffset", + "Gradient", + "GradientRotation", + "GradientTransform", + "HSLColor", + "HSVColor", + "ImageCache", + "ImageCacheStatus", + "ImageChunkEvent", + "ImageConfiguration", + "ImageInfo", + "ImageProvider", + "ImageShader", + "ImageSizeInfo", + "ImageStream", + "ImageStreamCompleter", + "ImageStreamCompleterHandle", + "ImageStreamListener", + "InlineSpan", + "InlineSpanSemanticsInformation", + "LinearGradient", + "Locale", + "MaskFilter", + "MatrixUtils", + "MemoryImage", + "MultiFrameImageStreamCompleter", + "NetworkImage", + "NotchedShape", + "Offset", + "OneFrameImageStreamCompleter", + "OutlinedBorder", + "OvalBorder", + "Paint", + "Path", + "PlaceholderDimensions", + "PlaceholderSpan", + "RadialGradient", + "Radius", + "Rect", + "ResizeImage", + "ResizeImageKey", + "RoundedRectangleBorder", + "RRect", + "RSTransform", + "Shader", + "ShaderWarmUp", + "Shadow", + "ShapeBorder", + "ShapeDecoration", + "Size", + "StadiumBorder", + "StarBorder", + "StrutStyle", + "SweepGradient", + "TextAlignVertical", + "TextBox", + "TextDecoration", + "TextHeightBehavior", + "TextPainter", + "TextPosition", + "TextRange", + "TextSelection", + "TextSpan", + "TextStyle", + "TransformProperty", + // MIXINS + "PaintingBinding", + // PROPERTIES + "debugCaptureShaderWarmUpImage", + "debugCaptureShaderWarmUpPicture", + "debugDisableShadows", + "debugImageOverheadAllowance", + "debugInvertOversizedImages", + "debugNetworkImageHttpClientProvider", + "debugOnPaintImage", + "imageCache", + // FUNCTIONS + "applyBoxFit", + "axisDirectionIsReversed", + "axisDirectionToAxis", + "combineSemanticsInfo", + "debugAssertAllPaintingVarsUnset", + "debugDescribeTransform", + "debugFlushLastFrameImageSizeInfo", + "decodeImageFromList", + "flipAxis", + "flipAxisDirection", + "hashList", + "hashValues", + "paintBorder", + "paintImage", + "paintZigZag", + "positionDependentBox", + "textDirectionToAxisDirection", + // ENUMS + "Axis", + "AxisDirection", + "BlendMode", + "BlurStyle", + "BorderStyle", + "BoxFit", + "BoxShape", + "Clip", + "FilterQuality", + "FlutterLogoStyle", + "FontStyle", + "ImageRepeat", + "PaintingStyle", + "PathFillType", + "PathOperation", + "PlaceholderAlignment", + "RenderComparison", + "StrokeCap", + "StrokeJoin", + "TextAffinity", + "TextAlign", + "TextBaseline", + "TextDecorationStyle", + "TextDirection", + "TextLeadingDistribution", + "TextOverflow", + "TextWidthBasis", + "TileMode", + "VertexMode", + "VerticalDirection", + // TYPEDEFS + "DecoderBufferCallback", + "DecoderCallback", + "HttpClientProvider", + "ImageChunkListener", + "ImageErrorListener", + "ImageListener", + "InlineSpanVisitor", + "PaintImageCallback", + "ShaderWarmUpImageCallback", + "ShaderWarmUpPictureCallback", + "VoidCallback", + // EXCEPTIONS + "NetworkImageLoadException", + ], + }, + // https://api.flutter.dev/flutter/widgets/widgets-library.html + "flutter/widgets": { + package: "flutter/widgets", + dependencies: ["flutter/foundation"], + exports: [ + // CLASSES + "AbsorbPointer", + "Accumulator", + "Action", + "ActionDispatcher", + "ActionListener", + "Actions", + "ActivateAction", + "ActivateIntent", + "Align", + "Alignment", + "AlignmentDirectional", + "AlignmentGeometry", + "AlignmentGeometryTween", + "AlignmentTween", + "AlignTransition", + "AlwaysScrollableScrollPhysics", + "AlwaysStoppedAnimation", + "AndroidView", + "AndroidViewSurface", + "Animatable", + "AnimatedAlign", + "AnimatedBuilder", + "AnimatedContainer", + "AnimatedCrossFade", + "AnimatedDefaultTextStyle", + "AnimatedFractionallySizedBox", + "AnimatedGrid", + "AnimatedGridState", + "AnimatedList", + "AnimatedListState", + "AnimatedModalBarrier", + "AnimatedOpacity", + "AnimatedPadding", + "AnimatedPhysicalModel", + "AnimatedPositioned", + "AnimatedPositionedDirectional", + "AnimatedRotation", + "AnimatedScale", + "AnimatedSize", + "AnimatedSlide", + "AnimatedSwitcher", + "AnimatedWidget", + "AnimatedWidgetBaseState", + "Animation", + "AnimationController", + "AnimationMax", + "AnimationMean", + "AnimationMin", + "AnnotatedRegion", + "AspectRatio", + "AssetBundle", + "AssetBundleImageKey", + "AssetBundleImageProvider", + "AssetImage", + "AsyncSnapshot", + "AutocompleteHighlightedOption", + "AutocompleteNextOptionIntent", + "AutocompletePreviousOptionIntent", + "AutofillGroup", + "AutofillGroupState", + "AutofillHints", + "AutomaticKeepAlive", + "AutomaticNotchedShape", + "BackButtonDispatcher", + "BackButtonListener", + "BackdropFilter", + "BallisticScrollActivity", + "Banner", + "BannerPainter", + "Baseline", + "BeveledRectangleBorder", + "BlockSemantics", + "Border", + "BorderDirectional", + "BorderRadius", + "BorderRadiusDirectional", + "BorderRadiusGeometry", + "BorderRadiusTween", + "BorderSide", + "BorderTween", + "BottomNavigationBarItem", + "BouncingScrollPhysics", + "BouncingScrollSimulation", + "BoxBorder", + "BoxConstraints", + "BoxConstraintsTween", + "BoxDecoration", + "BoxPainter", + "BoxScrollView", + "BoxShadow", + "BuildContext", + "Builder", + "BuildOwner", + "ButtonActivateIntent", + "CallbackAction", + "CallbackShortcuts", + "Canvas", + "CapturedThemes", + "CatmullRomCurve", + "CatmullRomSpline", + "Center", + "ChangeNotifier", + "CharacterActivator", + "CharacterRange", + "Characters", + "CheckedModeBanner", + "ChildBackButtonDispatcher", + "CircleBorder", + "CircularNotchedRectangle", + "ClampingScrollPhysics", + "ClampingScrollSimulation", + "ClipboardStatusNotifier", + "ClipContext", + "ClipOval", + "ClipPath", + "ClipRect", + "ClipRRect", + "Color", + "ColoredBox", + "ColorFilter", + "ColorFiltered", + "ColorProperty", + "ColorSwatch", + "ColorTween", + "Column", + "ComponentElement", + "CompositedTransformFollower", + "CompositedTransformTarget", + "CompoundAnimation", + "ConstantTween", + "ConstrainedBox", + "ConstrainedLayoutBuilder", + "ConstraintsTransformBox", + "Container", + "ContextAction", + "ContextMenuButtonItem", + "ContextMenuController", + "ContinuousRectangleBorder", + "CopySelectionTextIntent", + "Cubic", + "Curve", + "Curve2D", + "Curve2DSample", + "CurvedAnimation", + "Curves", + "CurveTween", + "CustomClipper", + "CustomMultiChildLayout", + "CustomPaint", + "CustomPainter", + "CustomPainterSemantics", + "CustomScrollView", + "CustomSingleChildLayout", + "DebugCreator", + "DecoratedBox", + "DecoratedBoxTransition", + "Decoration", + "DecorationImage", + "DecorationImagePainter", + "DecorationTween", + "DefaultAssetBundle", + "DefaultPlatformMenuDelegate", + "DefaultSelectionStyle", + "DefaultTextEditingShortcuts", + "DefaultTextHeightBehavior", + "DefaultTextStyle", + "DefaultTextStyleTransition", + "DefaultTransitionDelegate", + "DefaultWidgetsLocalizations", + "DeleteCharacterIntent", + "DeleteToLineBreakIntent", + "DeleteToNextWordBoundaryIntent", + "DesktopTextSelectionToolbarLayoutDelegate", + "DevToolsDeepLinkProperty", + "DiagnosticsNode", + "DirectionalCaretMovementIntent", + "DirectionalFocusAction", + "DirectionalFocusIntent", + "Directionality", + "DirectionalTextEditingIntent", + "DismissAction", + "Dismissible", + "DismissIntent", + "DismissUpdateDetails", + "DisplayFeatureSubScreen", + "DisposableBuildContext", + "DoNothingAction", + "DoNothingAndStopPropagationIntent", + "DoNothingAndStopPropagationTextIntent", + "DoNothingIntent", + "DragDownDetails", + "DragEndDetails", + "Draggable", + "DraggableDetails", + "DraggableScrollableActuator", + "DraggableScrollableController", + "DraggableScrollableNotification", + "DraggableScrollableSheet", + "DragScrollActivity", + "DragStartDetails", + "DragTarget", + "DragTargetDetails", + "DragUpdateDetails", + "DrivenScrollActivity", + "DualTransitionBuilder", + "EdgeDraggingAutoScroller", + "EdgeInsets", + "EdgeInsetsDirectional", + "EdgeInsetsGeometry", + "EdgeInsetsGeometryTween", + "EdgeInsetsTween", + "EditableText", + "EditableTextState", + "ElasticInCurve", + "ElasticInOutCurve", + "ElasticOutCurve", + "Element", + "EmptyTextSelectionControls", + "ErrorDescription", + "ErrorHint", + "ErrorSummary", + "ErrorWidget", + "ExactAssetImage", + "ExcludeFocus", + "ExcludeFocusTraversal", + "ExcludeSemantics", + "Expanded", + "ExpandSelectionToDocumentBoundaryIntent", + "ExpandSelectionToLineBreakIntent", + "ExtendSelectionByCharacterIntent", + "ExtendSelectionByPageIntent", + "ExtendSelectionToDocumentBoundaryIntent", + "ExtendSelectionToLineBreakIntent", + "ExtendSelectionToNextWordBoundaryIntent", + "ExtendSelectionToNextWordBoundaryOrCaretLocationIntent", + "ExtendSelectionVerticallyToAdjacentLineIntent", + "ExtendSelectionVerticallyToAdjacentPageIntent", + "FadeInImage", + "FadeTransition", + "FileImage", + "FittedBox", + "FittedSizes", + "FixedColumnWidth", + "FixedExtentMetrics", + "FixedExtentScrollController", + "FixedExtentScrollPhysics", + "FixedScrollMetrics", + "Flex", + "FlexColumnWidth", + "Flexible", + "FlippedCurve", + "FlippedTweenSequence", + "Flow", + "FlowDelegate", + "FlowPaintingContext", + "FlutterErrorDetails", + "FlutterLogoDecoration", + "Focus", + "FocusableActionDetector", + "FocusAttachment", + "FocusManager", + "FocusNode", + "FocusOrder", + "FocusScope", + "FocusScopeNode", + "FocusTraversalGroup", + "FocusTraversalOrder", + "FocusTraversalPolicy", + "FontWeight", + "ForcePressDetails", + "Form", + "FormField", + "FormFieldState", + "FormState", + "FractionallySizedBox", + "FractionalOffset", + "FractionalOffsetTween", + "FractionalTranslation", + "FractionColumnWidth", + "FutureBuilder", + "GestureDetector", + "GestureRecognizerFactory", + "GestureRecognizerFactoryWithHandlers", + "GlobalKey", + "GlobalObjectKey", + "GlowingOverscrollIndicator", + "Gradient", + "GradientRotation", + "GradientTransform", + "GridPaper", + "GridView", + "Hero", + "HeroController", + "HeroControllerScope", + "HeroMode", + "HoldScrollActivity", + "HSLColor", + "HSVColor", + "HtmlElementView", + "Icon", + "IconData", + "IconDataProperty", + "IconTheme", + "IconThemeData", + "IdleScrollActivity", + "IgnorePointer", + "Image", + "ImageCache", + "ImageCacheStatus", + "ImageChunkEvent", + "ImageConfiguration", + "ImageFiltered", + "ImageIcon", + "ImageInfo", + "ImageProvider", + "ImageShader", + "ImageSizeInfo", + "ImageStream", + "ImageStreamCompleter", + "ImageStreamCompleterHandle", + "ImageStreamListener", + "ImplicitlyAnimatedWidget", + "ImplicitlyAnimatedWidgetState", + "IndexedSemantics", + "IndexedSlot", + "IndexedStack", + "InheritedElement", + "InheritedModel", + "InheritedModelElement", + "InheritedNotifier", + "InheritedTheme", + "InheritedWidget", + "InlineSpan", + "InlineSpanSemanticsInformation", + "InspectorSelection", + "InspectorSerializationDelegate", + "Intent", + "InteractiveViewer", + "Interval", + "IntrinsicColumnWidth", + "IntrinsicHeight", + "IntrinsicWidth", + "IntTween", + "KeepAlive", + "KeepAliveHandle", + "KeepAliveNotification", + "Key", + "KeyboardListener", + "KeyedSubtree", + "KeyEvent", + "KeySet", + "LabeledGlobalKey", + "LayerLink", + "LayoutBuilder", + "LayoutChangedNotification", + "LayoutId", + "LeafRenderObjectElement", + "LeafRenderObjectWidget", + "LexicalFocusOrder", + "LimitedBox", + "LinearGradient", + "ListBody", + "Listenable", + "Listener", + "ListView", + "ListWheelChildBuilderDelegate", + "ListWheelChildDelegate", + "ListWheelChildListDelegate", + "ListWheelChildLoopingListDelegate", + "ListWheelElement", + "ListWheelScrollView", + "ListWheelViewport", + "Locale", + "LocalHistoryEntry", + "Localizations", + "LocalizationsDelegate", + "LocalKey", + "LogicalKeySet", + "LongPressDraggable", + "LongPressEndDetails", + "LongPressMoveUpdateDetails", + "LongPressStartDetails", + "MagnifierController", + "MagnifierDecoration", + "MagnifierInfo", + "MaskFilter", + "Matrix4", + "Matrix4Tween", + "MatrixUtils", + "MaxColumnWidth", + "MediaQuery", + "MediaQueryData", + "MemoryImage", + "MergeSemantics", + "MetaData", + "MinColumnWidth", + "ModalBarrier", + "ModalRoute", + "MouseCursor", + "MouseRegion", + "MultiChildLayoutDelegate", + "MultiChildRenderObjectElement", + "MultiChildRenderObjectWidget", + "MultiFrameImageStreamCompleter", + "MultiSelectableSelectionContainerDelegate", + "NavigationToolbar", + "Navigator", + "NavigatorObserver", + "NavigatorState", + "NestedScrollView", + "NestedScrollViewState", + "NestedScrollViewViewport", + "NetworkImage", + "NeverScrollableScrollPhysics", + "NextFocusAction", + "NextFocusIntent", + "NotchedShape", + "Notification", + "NotificationListener", + "NumericFocusOrder", + "ObjectKey", + "Offset", + "Offstage", + "OneFrameImageStreamCompleter", + "Opacity", + "OrderedTraversalPolicy", + "OrientationBuilder", + "OutlinedBorder", + "OvalBorder", + "OverflowBar", + "OverflowBox", + "Overlay", + "OverlayEntry", + "OverlayRoute", + "OverlayState", + "OverscrollIndicatorNotification", + "OverscrollNotification", + "Padding", + "Page", + "PageController", + "PageMetrics", + "PageRoute", + "PageRouteBuilder", + "PageScrollPhysics", + "PageStorage", + "PageStorageBucket", + "PageStorageKey", + "PageView", + "Paint", + "PaintingContext", + "ParametricCurve", + "ParentDataElement", + "ParentDataWidget", + "PasteTextIntent", + "Path", + "PerformanceOverlay", + "PhysicalModel", + "PhysicalShape", + "Placeholder", + "PlaceholderDimensions", + "PlaceholderSpan", + "PlatformMenu", + "PlatformMenuBar", + "PlatformMenuDelegate", + "PlatformMenuItem", + "PlatformMenuItemGroup", + "PlatformProvidedMenuItem", + "PlatformRouteInformationProvider", + "PlatformSelectableRegionContextMenu", + "PlatformViewCreationParams", + "PlatformViewLink", + "PlatformViewSurface", + "PointerCancelEvent", + "PointerDownEvent", + "PointerEvent", + "PointerMoveEvent", + "PointerUpEvent", + "PopupRoute", + "Positioned", + "PositionedDirectional", + "PositionedTransition", + "PreferredSize", + "PreferredSizeWidget", + "PreviousFocusAction", + "PreviousFocusIntent", + "PrimaryScrollController", + "PrioritizedAction", + "PrioritizedIntents", + "ProxyAnimation", + "ProxyElement", + "ProxyWidget", + "RadialGradient", + "Radius", + "RangeMaintainingScrollPhysics", + "RawAutocomplete", + "RawDialogRoute", + "RawGestureDetector", + "RawGestureDetectorState", + "RawImage", + "RawKeyboardListener", + "RawKeyEvent", + "RawMagnifier", + "RawScrollbar", + "RawScrollbarState", + "ReadingOrderTraversalPolicy", + "Rect", + "RectTween", + "RedoTextIntent", + "RelativePositionedTransition", + "RelativeRect", + "RelativeRectTween", + "RenderBox", + "RenderNestedScrollViewViewport", + "RenderObject", + "RenderObjectElement", + "RenderObjectToWidgetAdapter", + "RenderObjectToWidgetElement", + "RenderObjectWidget", + "RenderSemanticsGestureHandler", + "RenderSliverOverlapAbsorber", + "RenderSliverOverlapInjector", + "RenderTapRegion", + "RenderTapRegionSurface", + "ReorderableDelayedDragStartListener", + "ReorderableDragStartListener", + "ReorderableList", + "ReorderableListState", + "RepaintBoundary", + "ReplaceTextIntent", + "RequestFocusAction", + "RequestFocusIntent", + "ResizeImage", + "ResizeImageKey", + "RestorableBool", + "RestorableBoolN", + "RestorableChangeNotifier", + "RestorableDateTime", + "RestorableDateTimeN", + "RestorableDouble", + "RestorableDoubleN", + "RestorableEnum", + "RestorableEnumN", + "RestorableInt", + "RestorableIntN", + "RestorableListenable", + "RestorableNum", + "RestorableNumN", + "RestorableProperty", + "RestorableRouteFuture", + "RestorableString", + "RestorableStringN", + "RestorableTextEditingController", + "RestorableValue", + "RestorationBucket", + "RestorationScope", + "ReverseAnimation", + "ReverseTween", + "RichText", + "RootBackButtonDispatcher", + "RootRenderObjectElement", + "RootRestorationScope", + "RotatedBox", + "RotationTransition", + "RoundedRectangleBorder", + "Route", + "RouteAware", + "RouteInformation", + "RouteInformationParser", + "RouteInformationProvider", + "RouteObserver", + "Router", + "RouterConfig", + "RouterDelegate", + "RouteSettings", + "RouteTransitionRecord", + "Row", + "RRect", + "RSTransform", + "SafeArea", + "SawTooth", + "ScaleEndDetails", + "ScaleStartDetails", + "ScaleTransition", + "ScaleUpdateDetails", + "Scrollable", + "ScrollableDetails", + "ScrollableState", + "ScrollAction", + "ScrollActivity", + "ScrollActivityDelegate", + "ScrollAwareImageProvider", + "ScrollbarPainter", + "ScrollBehavior", + "ScrollConfiguration", + "ScrollContext", + "ScrollController", + "ScrollDragController", + "ScrollEndNotification", + "ScrollHoldController", + "ScrollIncrementDetails", + "ScrollIntent", + "ScrollMetricsNotification", + "ScrollNotification", + "ScrollNotificationObserver", + "ScrollNotificationObserverState", + "ScrollPhysics", + "ScrollPosition", + "ScrollPositionWithSingleContext", + "ScrollSpringSimulation", + "ScrollStartNotification", + "ScrollToDocumentBoundaryIntent", + "ScrollUpdateNotification", + "ScrollView", + "SelectableRegion", + "SelectableRegionState", + "SelectAction", + "SelectAllTextIntent", + "SelectIntent", + "SelectionContainer", + "SelectionContainerDelegate", + "SelectionOverlay", + "SelectionRegistrarScope", + "Semantics", + "SemanticsDebugger", + "SemanticsGestureDelegate", + "Shader", + "ShaderMask", + "ShaderWarmUp", + "Shadow", + "ShapeBorder", + "ShapeBorderClipper", + "ShapeDecoration", + "SharedAppData", + "ShortcutActivator", + "ShortcutManager", + "ShortcutMapProperty", + "ShortcutRegistrar", + "ShortcutRegistry", + "ShortcutRegistryEntry", + "Shortcuts", + "ShortcutSerialization", + "ShrinkWrappingViewport", + "Simulation", + "SingleActivator", + "SingleChildLayoutDelegate", + "SingleChildRenderObjectElement", + "SingleChildRenderObjectWidget", + "SingleChildScrollView", + "Size", + "SizeChangedLayoutNotification", + "SizeChangedLayoutNotifier", + "SizedBox", + "SizedOverflowBox", + "SizeTransition", + "SizeTween", + "SlideTransition", + "SliverAnimatedGrid", + "SliverAnimatedGridState", + "SliverAnimatedList", + "SliverAnimatedListState", + "SliverAnimatedOpacity", + "SliverChildBuilderDelegate", + "SliverChildDelegate", + "SliverChildListDelegate", + "SliverFadeTransition", + "SliverFillRemaining", + "SliverFillViewport", + "SliverFixedExtentList", + "SliverGrid", + "SliverGridDelegate", + "SliverGridDelegateWithFixedCrossAxisCount", + "SliverGridDelegateWithMaxCrossAxisExtent", + "SliverIgnorePointer", + "SliverLayoutBuilder", + "SliverList", + "SliverMultiBoxAdaptorElement", + "SliverMultiBoxAdaptorWidget", + "SliverOffstage", + "SliverOpacity", + "SliverOverlapAbsorber", + "SliverOverlapAbsorberHandle", + "SliverOverlapInjector", + "SliverPadding", + "SliverPersistentHeader", + "SliverPersistentHeaderDelegate", + "SliverPrototypeExtentList", + "SliverReorderableList", + "SliverReorderableListState", + "SliverSafeArea", + "SliverToBoxAdapter", + "SliverVisibility", + "SliverWithKeepAliveWidget", + "SlottedRenderObjectElement", + "SnapshotController", + "SnapshotPainter", + "SnapshotWidget", + "Spacer", + "SpellCheckConfiguration", + "SpringDescription", + "Stack", + "StadiumBorder", + "StarBorder", + "State", + "StatefulBuilder", + "StatefulElement", + "StatefulWidget", + "StatelessElement", + "StatelessWidget", + "StatusTransitionWidget", + "StepTween", + "StreamBuilder", + "StreamBuilderBase", + "StretchingOverscrollIndicator", + "StrutStyle", + "SweepGradient", + "SystemMouseCursors", + "Table", + "TableBorder", + "TableCell", + "TableColumnWidth", + "TableRow", + "TapDownDetails", + "TapRegion", + "TapRegionRegistry", + "TapRegionSurface", + "TapUpDetails", + "Text", + "TextAlignVertical", + "TextBox", + "TextDecoration", + "TextEditingController", + "TextEditingValue", + "TextFieldTapRegion", + "TextHeightBehavior", + "TextInputType", + "TextMagnifierConfiguration", + "TextPainter", + "TextPosition", + "TextRange", + "TextSelection", + "TextSelectionControls", + "TextSelectionGestureDetector", + "TextSelectionGestureDetectorBuilder", + "TextSelectionGestureDetectorBuilderDelegate", + "TextSelectionOverlay", + "TextSelectionPoint", + "TextSelectionToolbarAnchors", + "TextSelectionToolbarLayoutDelegate", + "TextSpan", + "TextStyle", + "TextStyleTween", + "Texture", + "ThreePointCubic", + "Threshold", + "TickerFuture", + "TickerMode", + "TickerProvider", + "Title", + "Tolerance", + "ToolbarItemsParentData", + "ToolbarOptions", + "TrackingScrollController", + "TrainHoppingAnimation", + "Transform", + "TransformationController", + "TransformProperty", + "TransitionDelegate", + "TransitionRoute", + "TransposeCharactersIntent", + "Tween", + "TweenAnimationBuilder", + "TweenSequence", + "TweenSequenceItem", + "UiKitView", + "UnconstrainedBox", + "UndoTextIntent", + "UniqueKey", + "UniqueWidget", + "UnmanagedRestorationScope", + "UpdateSelectionIntent", + "UserScrollNotification", + "ValueKey", + "ValueListenableBuilder", + "ValueNotifier", + "Velocity", + "Viewport", + "Visibility", + "VoidCallbackAction", + "VoidCallbackIntent", + "Widget", + "WidgetInspector", + "WidgetOrderTraversalPolicy", + "WidgetsApp", + "WidgetsBindingObserver", + "WidgetsFlutterBinding", + "WidgetsLocalizations", + "WidgetSpan", + "WidgetToRenderBoxAdapter", + "WillPopScope", + "Wrap", + // EXTENSIONS + "StringCharacters", + // MIXINS + "AnimationEagerListenerMixin", + "AnimationLazyListenerMixin", + "AnimationLocalListenersMixin", + "AnimationLocalStatusListenersMixin", + "AnimationWithParentMixin", + "AutomaticKeepAliveClientMixin", + "DirectionalFocusTraversalPolicyMixin", + "LocalHistoryRoute", + "MenuSerializableShortcut", + "NotifiableElementMixin", + "PaintingBinding", + "PopNavigatorRouterDelegateMixin", + "RenderConstrainedLayoutBuilder", + "RestorationMixin", + "ScrollMetrics", + "SingleTickerProviderStateMixin", + "SlottedContainerRenderObjectMixin", + "SlottedMultiChildRenderObjectWidgetMixin", + "TextSelectionDelegate", + "TextSelectionHandleControls", + "TickerProviderStateMixin", + "ViewportElementMixin", + "ViewportNotificationMixin", + "WidgetInspectorService", + "WidgetsBinding", + // CONSTANTS + "factory", + "immutable", + "kAlwaysCompleteAnimation", + "kAlwaysDismissedAnimation", + "mustCallSuper", + "optionalTypeArgs", + "protected", + "required", + "visibleForTesting", + // PROPERTIES + "debugCaptureShaderWarmUpImage", + "debugCaptureShaderWarmUpPicture", + "debugDisableShadows", + "debugEnhanceBuildTimelineArguments", + "debugFocusChanges", + "debugHighlightDeprecatedWidgets", + "debugImageOverheadAllowance", + "debugInvertOversizedImages", + "debugNetworkImageHttpClientProvider", + "debugOnPaintImage", + "debugOnRebuildDirtyWidget", + "debugPrint", + "debugPrintBuildScope", + "debugPrintGlobalKeyedWidgetLifecycle", + "debugPrintRebuildDirtyWidgets", + "debugPrintScheduleBuildForStacks", + "debugProfileBuildsEnabled", + "debugProfileBuildsEnabledUserWidgets", + "emptyTextSelectionControls", + "imageCache", + "primaryFocus", + // FUNCTIONS + "applyBoxFit", + "axisDirectionIsReversed", + "axisDirectionToAxis", + "basicLocaleListResolution", + "buildTextSpanWithSpellCheckSuggestions", + "childDragAnchorStrategy", + "combineKeyEventResults", + "combineSemanticsInfo", + "createLocalImageConfiguration", + "debugAssertAllPaintingVarsUnset", + "debugAssertAllWidgetVarsUnset", + "debugCheckHasDirectionality", + "debugCheckHasMediaQuery", + "debugCheckHasOverlay", + "debugCheckHasTable", + "debugCheckHasWidgetsLocalizations", + "debugChildrenHaveDuplicateKeys", + "debugDescribeFocusTree", + "debugDescribeTransform", + "debugDumpApp", + "debugDumpFocusTree", + "debugDumpLayerTree", + "debugDumpRenderTree", + "debugFlushLastFrameImageSizeInfo", + "debugIsLocalCreationLocation", + "debugIsWidgetLocalCreation", + "debugItemsHaveDuplicateKeys", + "debugPrintStack", + "debugTransformDebugCreator", + "debugWidgetBuilderValue", + "decodeImageFromList", + "defaultScrollNotificationPredicate", + "flipAxis", + "flipAxisDirection", + "getAxisDirectionFromAxisReverseAndDirectionality", + "hashList", + "hashValues", + "intentForMacOSSelector", + "paintBorder", + "paintImage", + "paintZigZag", + "pointerDragAnchorStrategy", + "positionDependentBox", + "precacheImage", + "runApp", + "showGeneralDialog", + "textDirectionToAxisDirection", + // ENUMS + "AndroidOverscrollIndicator", + "AnimationBehavior", + "AnimationStatus", + "AppLifecycleState", + "AutofillContextAction", + "AutovalidateMode", + "Axis", + "AxisDirection", + "BannerLocation", + "BlendMode", + "BlurStyle", + "BorderStyle", + "BoxFit", + "BoxShape", + "Clip", + "ClipboardStatus", + "ConnectionState", + "ContextMenuButtonType", + "CrossAxisAlignment", + "CrossFadeState", + "DecorationPosition", + "DiagnosticLevel", + "DismissDirection", + "FilterQuality", + "FlexFit", + "FlutterLogoStyle", + "FocusHighlightMode", + "FocusHighlightStrategy", + "FontStyle", + "GrowthDirection", + "HeroFlightDirection", + "HitTestBehavior", + "ImageRepeat", + "KeyEventResult", + "MainAxisAlignment", + "MainAxisSize", + "NavigationMode", + "Orientation", + "OverflowBarAlignment", + "PaintingStyle", + "PanAxis", + "PathFillType", + "PathOperation", + "PlaceholderAlignment", + "PlatformProvidedMenuItemType", + "RenderComparison", + "RouteInformationReportingType", + "RoutePopDisposition", + "ScrollbarOrientation", + "ScrollDecelerationRate", + "ScrollIncrementType", + "ScrollPositionAlignmentPolicy", + "ScrollViewKeyboardDismissBehavior", + "SelectionChangedCause", + "SmartDashesType", + "SmartQuotesType", + "SnapshotMode", + "StackFit", + "StrokeCap", + "StrokeJoin", + "TableCellVerticalAlignment", + "TargetPlatform", + "TextAffinity", + "TextAlign", + "TextBaseline", + "TextDecorationStyle", + "TextDirection", + "TextLeadingDistribution", + "TextOverflow", + "TextSelectionHandleType", + "TextWidthBasis", + "TileMode", + "TraversalDirection", + "UnfocusDisposition", + "VertexMode", + "VerticalDirection", + "WidgetInspectorServiceExtensions", + "WidgetsServiceExtensions", + "WrapAlignment", + "WrapCrossAlignment", + // TYPEDEFS + "ActionListenerCallback", + "AnimatableCallback", + "AnimatedCrossFadeBuilder", + "AnimatedItemBuilder", + "AnimatedListItemBuilder", + "AnimatedListRemovedItemBuilder", + "AnimatedRemovedItemBuilder", + "AnimatedSwitcherLayoutBuilder", + "AnimatedSwitcherTransitionBuilder", + "AnimatedTransitionBuilder", + "AnimationStatusListener", + "AppPrivateCommandCallback", + "AsyncWidgetBuilder", + "AutocompleteFieldViewBuilder", + "AutocompleteOnSelected", + "AutocompleteOptionsBuilder", + "AutocompleteOptionsViewBuilder", + "AutocompleteOptionToString", + "BoxConstraintsTransform", + "ChildIndexGetter", + "ConfirmDismissCallback", + "CreatePlatformViewCallback", + "CreateRectTween", + "DecoderBufferCallback", + "DecoderCallback", + "DismissDirectionCallback", + "DismissUpdateCallback", + "DragAnchorStrategy", + "DragEndCallback", + "DraggableCanceledCallback", + "DragSelectionUpdateCallback", + "DragTargetAccept", + "DragTargetAcceptWithDetails", + "DragTargetBuilder", + "DragTargetLeave", + "DragTargetMove", + "DragTargetWillAccept", + "DragUpdateCallback", + "EditableTextContextMenuBuilder", + "ElementVisitor", + "ErrorWidgetBuilder", + "FocusOnKeyCallback", + "FocusOnKeyEventCallback", + "FormFieldBuilder", + "FormFieldSetter", + "FormFieldValidator", + "GenerateAppTitle", + "GestureDragCancelCallback", + "GestureDragDownCallback", + "GestureDragEndCallback", + "GestureDragStartCallback", + "GestureDragUpdateCallback", + "GestureForcePressEndCallback", + "GestureForcePressPeakCallback", + "GestureForcePressStartCallback", + "GestureForcePressUpdateCallback", + "GestureLongPressCallback", + "GestureLongPressEndCallback", + "GestureLongPressMoveUpdateCallback", + "GestureLongPressStartCallback", + "GestureLongPressUpCallback", + "GestureRecognizerFactoryConstructor", + "GestureRecognizerFactoryInitializer", + "GestureScaleEndCallback", + "GestureScaleStartCallback", + "GestureScaleUpdateCallback", + "GestureTapCallback", + "GestureTapCancelCallback", + "GestureTapDownCallback", + "GestureTapUpCallback", + "HeroFlightShuttleBuilder", + "HeroPlaceholderBuilder", + "HttpClientProvider", + "ImageChunkListener", + "ImageErrorListener", + "ImageErrorWidgetBuilder", + "ImageFrameBuilder", + "ImageListener", + "ImageLoadingBuilder", + "IndexedWidgetBuilder", + "InitialRouteListFactory", + "InlineSpanVisitor", + "InspectorSelectButtonBuilder", + "InspectorSelectionChangedCallback", + "InteractiveViewerWidgetBuilder", + "LayoutWidgetBuilder", + "LocaleListResolutionCallback", + "LocaleResolutionCallback", + "MagnifierBuilder", + "MenuItemSerializableIdGenerator", + "NavigatorFinderCallback", + "NestedScrollViewHeaderSliversBuilder", + "NotificationListenerCallback", + "NullableIndexedWidgetBuilder", + "OnInvokeCallback", + "OrientationWidgetBuilder", + "PageRouteFactory", + "PaintImageCallback", + "PlatformViewSurfaceFactory", + "PointerCancelEventListener", + "PointerDownEventListener", + "PointerMoveEventListener", + "PointerUpEventListener", + "PopPageCallback", + "RebuildDirtyWidgetCallback", + "RegisterServiceExtensionCallback", + "ReorderCallback", + "ReorderItemProxyDecorator", + "RestorableRouteBuilder", + "RouteCompletionCallback", + "RouteFactory", + "RouteListFactory", + "RoutePageBuilder", + "RoutePredicate", + "RoutePresentationCallback", + "RouteTransitionsBuilder", + "ScrollableWidgetBuilder", + "ScrollIncrementCalculator", + "ScrollNotificationCallback", + "ScrollNotificationPredicate", + "SelectableRegionContextMenuBuilder", + "SelectionChangedCallback", + "SemanticIndexCallback", + "SemanticsBuilderCallback", + "ShaderCallback", + "ShaderWarmUpImageCallback", + "ShaderWarmUpPictureCallback", + "SharedAppDataInitCallback", + "SliverLayoutWidgetBuilder", + "StatefulWidgetBuilder", + "StateSetter", + "TapRegionCallback", + "TextEditingValueCallback", + "ToolbarBuilder", + "TransitionBuilder", + "TweenConstructor", + "TweenVisitor", + "ValueChanged", + "ValueGetter", + "ValueListenableTransformer", + "ValueSetter", + "ValueWidgetBuilder", + "ViewportBuilder", + "VoidCallback", + "WidgetBuilder", + "WillPopCallback", + // EXCEPTIONS + "FlutterError", + "NetworkImageLoadException", + "TickerCanceled", + ], + }, + // + "flutter/material": { + package: "flutter/material", + dependencies: ["flutter/widgets"], + exports: [], + }, +}; diff --git a/flutter-preview/flutter-preview-template/readme.md b/flutter-preview/flutter-preview-template/readme.md new file mode 100644 index 0000000..145638d --- /dev/null +++ b/flutter-preview/flutter-preview-template/readme.md @@ -0,0 +1,48 @@ +# template app directory + +- `/template_app` - a executable dart project used for template app development +- `/template-app` - a nodejs library contains a template file originated from template_app, with an ready to use api +- `/template-type-map-seed` - a nodejs script to seed type mapper dart code to template_app + +The template app provides a skeleton flutter project to run on flutter daemon, with message channel to communicate with webview host, having capability of changing the widget's properties on runtime. + +```ts +import template from "@flutter-preview/template"; + +const project = template({ + target: { + id: "SampleWidget", + import: "src/samples/widget_1.dart", + args: { + title: { + id: "title", + type: "String", + placement: { + index: 0, + positional: true, + }, + }, + subtitle: { + id: "subtitle", + type: "String", + placement: { + index: 1, + positional: true, + }, + }, + active: { + id: "active", + type: "bool", + placement: { + name: "active", + optionalNamed: true, + }, + }, + }, + }, +}); + +const pubspec = project.pubspec; +const main = project.main; +const mappers = project.mappers; +``` diff --git a/flutter-preview/flutter-preview-template/template-app/defaults/default-value-by-type.ts b/flutter-preview/flutter-preview-template/template-app/defaults/default-value-by-type.ts new file mode 100644 index 0000000..283fd12 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/defaults/default-value-by-type.ts @@ -0,0 +1,30 @@ +import { type } from "@flutter-preview/analyzer"; + +/** + * A function that used for seedings default values for required final fields, by type. + * @returns + */ +export function defaultValueByType(type: type.DartType) { + switch (type) { + case "BigInt": + return "BigInt.from(0)"; + case "bool": + return "false"; + case "Color": + return "Colors.black"; + case "DateTime": + return "DateTime.now()"; + case "Object": + return "Object()"; + case "String": + return "''"; + case "int": + return "0"; + case "animation/AnimationBehavior": + return "AnimationBehavior.normal"; + // TODO: add all nativly supported enums + default: + return "null"; + } + // +} diff --git a/flutter-preview/flutter-preview-template/template-app/defaults/index.ts b/flutter-preview/flutter-preview-template/template-app/defaults/index.ts new file mode 100644 index 0000000..17fb3b0 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/defaults/index.ts @@ -0,0 +1 @@ +export * from "./default-value-by-type" \ No newline at end of file diff --git a/flutter-preview/flutter-preview-template/template-app/index.ts b/flutter-preview/flutter-preview-template/template-app/index.ts new file mode 100644 index 0000000..6d6f90c --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/index.ts @@ -0,0 +1,254 @@ +import type { DartProperty } from "flutter-ast"; +import { type } from "@flutter-preview/analyzer"; + +import v2_lib_main from "./templates/v2/lib/main"; +import v2_lib_flutter_preview_artifacts__initial_properties from "./templates/v2/lib/.flutter_preview_artifacts/initial_properties"; +import v2_lib_flutter_preview_artifacts__preview from "./templates/v2/lib/.flutter_preview_artifacts/preview"; +import v2_lib_flutter_preview_artifacts__properties_value_mapper from "./templates/v2/lib/.flutter_preview_artifacts/properties_value_mapper"; +import v2_lib_flutter_preview_artifacts__properties_value_state from "./templates/v2/lib/.flutter_preview_artifacts/properties_value_state"; +import v2_lib_flutter_preview_artifacts__properties_value from "./templates/v2/lib/.flutter_preview_artifacts/properties_value"; +import v2_lib_flutter_preview_artifacts__target_widget from "./templates/v2/lib/.flutter_preview_artifacts/target_widget"; +// mappers +import v2_lib_flutter_preview_artifacts__mappers__mappers from "./templates/v2/lib/.flutter_preview_artifacts/mappers/mappers"; +import v2_lib_flutter_preview_artifacts__mappers__flutter_enums_ext from "./templates/v2/lib/.flutter_preview_artifacts/mappers/flutter_enums_ext"; +import v2_lib_flutter_preview_artifacts__mappers__flutter_types_ext from "./templates/v2/lib/.flutter_preview_artifacts/mappers/flutter_types_ext"; +import { defaultValueByType } from "./defaults"; + +const templates = { + "lib/main.dart": v2_lib_main, + "lib/.flutter_preview_artifacts/initial_properties.dart": + v2_lib_flutter_preview_artifacts__initial_properties, + "lib/.flutter_preview_artifacts/preview.dart": + v2_lib_flutter_preview_artifacts__preview, + "lib/.flutter_preview_artifacts/properties_value_mapper.dart": + v2_lib_flutter_preview_artifacts__properties_value_mapper, + "lib/.flutter_preview_artifacts/properties_value_state.dart": + v2_lib_flutter_preview_artifacts__properties_value_state, + "lib/.flutter_preview_artifacts/properties_value.dart": + v2_lib_flutter_preview_artifacts__properties_value, + "lib/.flutter_preview_artifacts/target_widget.dart": + v2_lib_flutter_preview_artifacts__target_widget, + // mappers + "lib/.flutter_preview_artifacts/mappers/mappers.dart": + v2_lib_flutter_preview_artifacts__mappers__mappers, + "lib/.flutter_preview_artifacts/mappers/flutter_enums_ext.dart": + v2_lib_flutter_preview_artifacts__mappers__flutter_enums_ext, + "lib/.flutter_preview_artifacts/mappers/flutter_types_ext.dart": + v2_lib_flutter_preview_artifacts__mappers__flutter_types_ext, +} as const; + +interface FlutterTemplateArgs { + /** + * The has is used for making the artifacts directory unique, so it won't conflict with user's src files + * This can be also used as an id. + * + * e.g. if the hash is "123", the artifacts directory will be ".flutter_preview_artifacts_123" + * + * @type {string} + * @default "" + */ + hash?: string; + target: { + identifier: string; + initializationName: string; + import: string; + controls: DartProperty[]; + }; +} + +interface IFileEntry { + path: string; + content: string; +} + +interface TemplateData { + main: IFileEntry; + artifacts: IFileEntry[]; +} + +export default function template({ + hash = "", + target, +}: FlutterTemplateArgs): TemplateData { + const __flutter_preview_artifacts__initial_properties = templates[ + "lib/.flutter_preview_artifacts/initial_properties.dart" + ]({ + initial_properties: buildInitialProperties(target.controls), + }); + + const __flutter_preview_artifacts__preview = templates[ + "lib/.flutter_preview_artifacts/preview.dart" + ]({}); + + const __flutter_preview_artifacts__properties_value_mapper = templates[ + "lib/.flutter_preview_artifacts/properties_value_mapper.dart" + ]( + buildPropertyConnectorsWithInstanciation({ + constructorName: target.initializationName, + properties: target.controls, + }) + ); + + const __flutter_preview_artifacts__properties_value_state = templates[ + "lib/.flutter_preview_artifacts/properties_value_state.dart" + ]({}); + + const __flutter_preview_artifacts__properties_value = templates[ + "lib/.flutter_preview_artifacts/properties_value.dart" + ]({}); + + const __flutter_preview_artifacts__target_widget = templates[ + "lib/.flutter_preview_artifacts/target_widget.dart" + ]({ + // TODO: make target.import relative to /lib/.flutter_preview_artifacts/target_widget.dart + target_widget: `export '${target.import}'`, + }); + + // mappers + const __flutter_preview_artifacts__mappers__mappers = templates[ + "lib/.flutter_preview_artifacts/mappers/mappers.dart" + ]({}); + + const __flutter_preview_artifacts__mappers__flutter_enums_ext = templates[ + "lib/.flutter_preview_artifacts/mappers/flutter_enums_ext.dart" + ]({}); + + return { + main: { + path: "lib/main.dart", + content: buildMainContent(target), + }, + artifacts: [ + { + path: `lib/.flutter_preview_artifacts/initial_properties.dart`, + content: __flutter_preview_artifacts__initial_properties, + }, + { + path: `lib/.flutter_preview_artifacts/preview.dart`, + content: __flutter_preview_artifacts__preview, + }, + { + path: `lib/.flutter_preview_artifacts/properties_value_mapper.dart`, + content: __flutter_preview_artifacts__properties_value_mapper, + }, + { + path: `lib/.flutter_preview_artifacts/properties_value_state.dart`, + content: __flutter_preview_artifacts__properties_value_state, + }, + { + path: `lib/.flutter_preview_artifacts/properties_value.dart`, + content: __flutter_preview_artifacts__properties_value, + }, + { + path: `lib/.flutter_preview_artifacts/target_widget.dart`, + content: __flutter_preview_artifacts__target_widget, + }, + // mappers + { + path: `lib/.flutter_preview_artifacts/mappers/mappers.dart`, + content: __flutter_preview_artifacts__mappers__mappers, + }, + { + path: `lib/.flutter_preview_artifacts/mappers/flutter_enums_ext.dart`, + content: __flutter_preview_artifacts__mappers__flutter_enums_ext, + }, + ], + }; +} + +function buildMainContent({ identifier }: FlutterTemplateArgs["target"]) { + // render the template + const main_dart_src = templates["lib/main.dart"]({ + title: dartstring("Preview - " + identifier), + }); + + return main_dart_src; +} + +function buildInitialProperties(properties: DartProperty[]) { + // ```dart + // Map initialProperties = { + // // make lines to go here + // } + // ``` + + return properties + .map((p) => { + if (!p.name) { + return ""; + } + + return `${dartstring(p.name)}: ${dartvalue( + // TODO: remove illegal casting + (p.value as any) ?? defaultValueByType(p.type! as any), + p.type + )}`; + }) + .join(",\n"); +} + +function buildPropertyConnectorsWithInstanciation({ + constructorName, + properties, +}: { + constructorName: string; + properties: DartProperty[]; +}) { + // TODO: + const declarations = properties + .map(({ key, type }) => { + // e.g. `final name = value(context, "name");`; + return `final ${key!} = value<${type!}>(context, ${dartstring(key!)});`; + // + }) + .join("\n"); + + // TODO: + const args = properties + .sort((a, b) => { + return (a.position ?? 0) - (b.position ?? 0); + }) + .map(({ key, isPositional, isOptionalNamed }) => { + if (isPositional) { + return key; + } + + if (isOptionalNamed) { + return `${key}: ${key}`; + } + + // TODO: check me + return `${key}: ${key}`; + // throw new Error(`Unsupported argument type`); + }) + .join(",\n"); + const instanciation = `${constructorName}(${args})`; + + return { + property_variable_declarations: declarations, + widget_instantiation: instanciation, + }; +} + +// + +function dartstring(string: string) { + return JSON.stringify(string); +} + +function dartvalue(value: string, rawtype?: string) { + if (rawtype === "Key" || rawtype === "Key?") { + // If Key type was specified, we will return null. + // However, we won't receive a key becaze the analyzer would ignore it first. + return "null"; + } + + const darttype = rawtype?.replace("?", "") as type.DartType; + + switch (darttype) { + case "String": + return dartstring(value); + } + + throw new Error(`#dartvalue Unsupported type: ${rawtype}`); +} diff --git a/flutter-preview/flutter-preview-template/template-app/package.json b/flutter-preview/flutter-preview-template/template-app/package.json new file mode 100644 index 0000000..cf93a37 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/package.json @@ -0,0 +1,23 @@ +{ + "name": "@flutter-preview/template", + "version": "0.0.0", + "description": "Flutter Preview template engine", + "license": "MIT", + "author": "Grida, Inc.", + "private": false, + "scripts": { + "sync": "node ./scripts/sync.js" + }, + "dependencies": { + "mustache": "^4.2.0" + }, + "devDependencies": { + "@types/assert": "^1.5.6", + "@types/mustache": "^4.2.2", + "@types/node": "latest", + "typescript": "^4.7.4" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/flutter-preview/flutter-preview-template/template-app/readme.md b/flutter-preview/flutter-preview-template/template-app/readme.md new file mode 100644 index 0000000..b66a3f9 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/readme.md @@ -0,0 +1,50 @@ +# `@flutter-preview/template` + +Install + +```bash +yarn add @flutter-preview/template +``` + +Usage + +```ts +import template from "@flutter-preview/template"; + +const project = template({ + target: { + id: "SampleWidget", + import: "src/samples/widget_1.dart", + args: { + title: { + id: "title", + type: "String", + placement: { + index: 0, + positional: true, + }, + }, + subtitle: { + id: "subtitle", + type: "String", + placement: { + index: 1, + positional: true, + }, + }, + active: { + id: "active", + type: "bool", + placement: { + name: "active", + optionalNamed: true, + }, + }, + }, + }, +}); + +const pubspec = project.pubspec; +const main = project.main; +const mappers = project.mappers; +``` diff --git a/flutter-preview/flutter-preview-template/template-app/scripts/sync.js b/flutter-preview/flutter-preview-template/template-app/scripts/sync.js new file mode 100644 index 0000000..3ac5799 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/scripts/sync.js @@ -0,0 +1,157 @@ +// synced designated files from template_app/ to template-app/templates + +const fs = require("fs"); +const path = require("path"); +const glob = require("glob"); + +const origin = path.join(__dirname, "../../template_app"); +const target = path.join(__dirname, "../templates/v2"); + +/** + * every file contains a seeded value for template, it is stated like this: + * + * ```dart + * const FLUTTER_PREVIEW_TARGET_WIDGET_INITIAL_PROPERTIES = { + * // start_flutter_preview_template:initial_properties + * "name": "Flutter Preview", + * "radius": 10, + * "description": + * "Flutter Preview is a tool that allows you to preview your Flutter app in the browser.", + * "enabled": true, + * "color": const Color(0xFF000000), + * "alignment": 'start', + * // end_flutter_preview_template:initial_properties + * }; + * ``` + * + * the "start_flutter_preview_template:key" and "end_flutter_preview_template:key" + * are used to identify the start and end of the seeded value. + * (And there can be multiple in single file like this) + * + * the inbetween text needs to be transformed like this: + * + * ```mustache + * const FLUTTER_PREVIEW_TARGET_WIDGET_INITIAL_PROPERTIES = { + * // start_flutter_preview_template:initial_properties + * {{initial_properties}} + * // end_flutter_preview_template:initial_properties + * }; + * ``` + */ +function transform_file_with_seeds_to_mustache_template_data(txt) { + // get the keys + const matches = txt.match(/start_flutter_preview_template:(\w+)/g); + const keys = matches?.map((match) => match.split(":")[1]) ?? []; + + // validate if all keys have a start and end + keys.forEach((key) => { + if (!txt.includes(`end_flutter_preview_template:${key}`)) { + throw new Error(`missing end for key: ${key}`); + } + }); + + // transform the text between start and end + // where start looks like: // start_flutter_preview_template: + // and end looks like: // end_flutter_preview_template: + // the replaced text looks like: + // ``` + // // start_flutter_preview_template: + // {{ initial_properties }} + // // end_flutter_preview_template: + // ``` + keys.forEach((key) => { + const start = `// start_flutter_preview_template:${key}`; + const end = `// end_flutter_preview_template:${key}`; + + const start_index = txt.indexOf(start); + const end_index = txt.indexOf(end); + + const start_length = start.length; + const end_length = end.length; + + const start_to_end = txt.slice(start_index + start_length, end_index); + + const transformed = `\n{{ ${key} }}\n`; + + txt = txt.replace(start_to_end, transformed); + }); + + return { + content: txt, + arguments: keys, + }; +} + +/** + * writes a .ts file with template data. + * + * the form is... + * + * ```ts + * (args: { : string }) => + * ``` + * + * Where is name of the argument (from argumnts) + * e.g. -> {a: string, b: string, c: string, d: string} + * + * and the is the transformed content from the file. + * e.g. -> `original content with ${a} ${b} ${c} ${d}` + */ +function transformed_template_data_to_template_lambda({ content, arguments }) { + const args_with_types = arguments.map((arg) => `${arg}: string`).join(", "); + + // replace "{{ args }}" with "${args.}" + arguments.forEach((arg) => { + content = content.replace(`{{ ${arg} }}`, `\${args.${arg}}`); + }); + + return `(args: {${args_with_types}}) => \`${content}\``; +} + +function sync() { + // read all .dart files from origin, + // transform them to .ts files with template data + // and write them to target template.ts file + // the file name shall be transformed like this: + // /path/to/.dart -> /path/to/.ts + + const files = glob + .sync(`${origin}/**/*.dart`, { + dot: true, + }) + // exclude .dart_tool + .filter((file) => !file.includes(".dart_tool")) + .filter((file) => !file.includes("/samples")); + + const templates = files.map((file) => { + const data = fs.readFileSync(file, "utf8"); + const transformedData = + transform_file_with_seeds_to_mustache_template_data(data); + const lambda = + transformed_template_data_to_template_lambda(transformedData); + const filename = file.replace(".dart", ".ts").replace(origin, target); + return { + filename, + templateData: "export default " + lambda, + arguments: transformedData.arguments, + }; + }); + + templates.forEach(({ filename, templateData, arguments }) => { + try { + const dir = path.dirname(filename); + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir, { recursive: true }); + } + fs.writeFileSync(filename, templateData); + } catch (error) { + console.error( + `Error writing template file ${filename}: ${error.message}` + ); + } + }); + + console.log(`Synced ${templates.length} templates to ${target}`); +} + +sync(); diff --git a/flutter-preview/flutter-preview/templates/index.ts b/flutter-preview/flutter-preview-template/template-app/templates/v1/index.ts similarity index 100% rename from flutter-preview/flutter-preview/templates/index.ts rename to flutter-preview/flutter-preview-template/template-app/templates/v1/index.ts diff --git a/flutter-preview/flutter-preview/templates/main.dart.mustache.ts b/flutter-preview/flutter-preview-template/template-app/templates/v1/main.dart.mustache.ts similarity index 100% rename from flutter-preview/flutter-preview/templates/main.dart.mustache.ts rename to flutter-preview/flutter-preview-template/template-app/templates/v1/main.dart.mustache.ts diff --git a/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/initial_properties.ts b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/initial_properties.ts new file mode 100644 index 0000000..71d2d89 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/initial_properties.ts @@ -0,0 +1,10 @@ +export default (args: {initial_properties: string}) => `import 'dart:ui'; +import 'package:flutter/widgets.dart'; +import 'package:flutter/material.dart'; + +Map FLUTTER_PREVIEW_TARGET_WIDGET_INITIAL_PROPERTIES = { + // start_flutter_preview_template:initial_properties +${args.initial_properties} +// end_flutter_preview_template:initial_properties +}; +` \ No newline at end of file diff --git a/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/mappers/flutter_enums_ext.ts b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/mappers/flutter_enums_ext.ts new file mode 100644 index 0000000..ff0ed31 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/mappers/flutter_enums_ext.ts @@ -0,0 +1,1596 @@ +export default (args: {}) => `/// +/// This file is generated by template-type-map-seed/enums/enums.seed.ts +/// Do not edit manually. +/// + +import 'package:flutter/animation.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/painting.dart'; +import 'package:flutter/physics.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:flutter/semantics.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; +import 'dart:ui'; +// import 'dart:wasm'; +import 'dart:async'; +import 'dart:collection'; +import 'dart:convert'; +import 'dart:core'; +import 'dart:developer'; +import 'dart:math'; +import 'dart:typed_data'; +// import 'dart:ffi'; +import 'dart:io'; +import 'dart:isolate'; +import 'dart:html'; +import 'dart:js'; +import 'dart:js_util'; + +T? flutterEnumFromString(String value) { + if (T == AnimationBehavior) { + return value.parseAnimationBehavior() as T; + } + + if (T == AnimationStatus) { + return value.parseAnimationStatus() as T; + } + + if (T == AndroidOverscrollIndicator) { + return value.parseAndroidOverscrollIndicator() as T; + } + + if (T == AppLifecycleState) { + return value.parseAppLifecycleState() as T; + } + + if (T == AutofillContextAction) { + return value.parseAutofillContextAction() as T; + } + + if (T == AutovalidateMode) { + return value.parseAutovalidateMode() as T; + } + + if (T == Axis) { + return value.parseAxis() as T; + } + + if (T == AxisDirection) { + return value.parseAxisDirection() as T; + } + + if (T == BannerLocation) { + return value.parseBannerLocation() as T; + } + + if (T == BlendMode) { + return value.parseBlendMode() as T; + } + + if (T == BlurStyle) { + return value.parseBlurStyle() as T; + } + + if (T == BorderStyle) { + return value.parseBorderStyle() as T; + } + + if (T == BoxFit) { + return value.parseBoxFit() as T; + } + + if (T == BoxShape) { + return value.parseBoxShape() as T; + } + + if (T == Brightness) { + return value.parseBrightness() as T; + } + + if (T == Clip) { + return value.parseClip() as T; + } + + if (T == ClipboardStatus) { + return value.parseClipboardStatus() as T; + } + + if (T == ConnectionState) { + return value.parseConnectionState() as T; + } + + if (T == CrossAxisAlignment) { + return value.parseCrossAxisAlignment() as T; + } + + if (T == CrossFadeState) { + return value.parseCrossFadeState() as T; + } + + if (T == CupertinoDatePickerMode) { + return value.parseCupertinoDatePickerMode() as T; + } + + if (T == CupertinoTimerPickerMode) { + return value.parseCupertinoTimerPickerMode() as T; + } + + if (T == CupertinoUserInterfaceLevelData) { + return value.parseCupertinoUserInterfaceLevelData() as T; + } + + if (T == DatePickerDateOrder) { + return value.parseDatePickerDateOrder() as T; + } + + if (T == DatePickerDateTimeOrder) { + return value.parseDatePickerDateTimeOrder() as T; + } + + if (T == DecorationPosition) { + return value.parseDecorationPosition() as T; + } + + if (T == DiagnosticLevel) { + return value.parseDiagnosticLevel() as T; + } + + if (T == DismissDirection) { + return value.parseDismissDirection() as T; + } + + if (T == FilterQuality) { + return value.parseFilterQuality() as T; + } + + if (T == FlexFit) { + return value.parseFlexFit() as T; + } + + if (T == FlutterLogoStyle) { + return value.parseFlutterLogoStyle() as T; + } + + if (T == FocusHighlightMode) { + return value.parseFocusHighlightMode() as T; + } + + if (T == FocusHighlightStrategy) { + return value.parseFocusHighlightStrategy() as T; + } + + if (T == FontStyle) { + return value.parseFontStyle() as T; + } + + if (T == GrowthDirection) { + return value.parseGrowthDirection() as T; + } + + if (T == HeroFlightDirection) { + return value.parseHeroFlightDirection() as T; + } + + if (T == HitTestBehavior) { + return value.parseHitTestBehavior() as T; + } + + if (T == ImageRepeat) { + return value.parseImageRepeat() as T; + } + + if (T == KeyEventResult) { + return value.parseKeyEventResult() as T; + } + + if (T == MainAxisAlignment) { + return value.parseMainAxisAlignment() as T; + } + + if (T == MainAxisSize) { + return value.parseMainAxisSize() as T; + } + + if (T == NavigationMode) { + return value.parseNavigationMode() as T; + } + + if (T == Orientation) { + return value.parseOrientation() as T; + } + + if (T == OverflowBarAlignment) { + return value.parseOverflowBarAlignment() as T; + } + + if (T == OverlayVisibilityMode) { + return value.parseOverlayVisibilityMode() as T; + } + + if (T == PaintingStyle) { + return value.parsePaintingStyle() as T; + } + + if (T == PathFillType) { + return value.parsePathFillType() as T; + } + + if (T == PathOperation) { + return value.parsePathOperation() as T; + } + + if (T == PlaceholderAlignment) { + return value.parsePlaceholderAlignment() as T; + } + + if (T == PlatformProvidedMenuItemType) { + return value.parsePlatformProvidedMenuItemType() as T; + } + + if (T == RefreshIndicatorMode) { + return value.parseRefreshIndicatorMode() as T; + } + + if (T == RenderComparison) { + return value.parseRenderComparison() as T; + } + + if (T == RouteInformationReportingType) { + return value.parseRouteInformationReportingType() as T; + } + + if (T == RoutePopDisposition) { + return value.parseRoutePopDisposition() as T; + } + + if (T == ScrollbarOrientation) { + return value.parseScrollbarOrientation() as T; + } + + if (T == ScrollIncrementType) { + return value.parseScrollIncrementType() as T; + } + + if (T == ScrollPositionAlignmentPolicy) { + return value.parseScrollPositionAlignmentPolicy() as T; + } + + if (T == ScrollViewKeyboardDismissBehavior) { + return value.parseScrollViewKeyboardDismissBehavior() as T; + } + + if (T == SelectionChangedCause) { + return value.parseSelectionChangedCause() as T; + } + + if (T == SmartDashesType) { + return value.parseSmartDashesType() as T; + } + + if (T == SmartQuotesType) { + return value.parseSmartQuotesType() as T; + } + + if (T == StackFit) { + return value.parseStackFit() as T; + } + + if (T == StrokeCap) { + return value.parseStrokeCap() as T; + } + + if (T == StrokeJoin) { + return value.parseStrokeJoin() as T; + } + + if (T == TableCellVerticalAlignment) { + return value.parseTableCellVerticalAlignment() as T; + } + + if (T == TargetPlatform) { + return value.parseTargetPlatform() as T; + } + + if (T == TextAffinity) { + return value.parseTextAffinity() as T; + } + + if (T == TextAlign) { + return value.parseTextAlign() as T; + } + + if (T == TextBaseline) { + return value.parseTextBaseline() as T; + } + + if (T == TextCapitalization) { + return value.parseTextCapitalization() as T; + } + + if (T == TextDecorationStyle) { + return value.parseTextDecorationStyle() as T; + } + + if (T == TextDirection) { + return value.parseTextDirection() as T; + } + + if (T == TextInputAction) { + return value.parseTextInputAction() as T; + } + + if (T == TextLeadingDistribution) { + return value.parseTextLeadingDistribution() as T; + } + + if (T == TextOverflow) { + return value.parseTextOverflow() as T; + } + + if (T == TextSelectionHandleType) { + return value.parseTextSelectionHandleType() as T; + } + + if (T == TextWidthBasis) { + return value.parseTextWidthBasis() as T; + } + + if (T == TileMode) { + return value.parseTileMode() as T; + } + + if (T == TraversalDirection) { + return value.parseTraversalDirection() as T; + } + + if (T == UnfocusDisposition) { + return value.parseUnfocusDisposition() as T; + } + + if (T == VertexMode) { + return value.parseVertexMode() as T; + } + + if (T == VerticalDirection) { + return value.parseVerticalDirection() as T; + } + + if (T == WrapAlignment) { + return value.parseWrapAlignment() as T; + } + + if (T == WrapCrossAlignment) { + return value.parseWrapCrossAlignment() as T; + } + + if (T == DiagnosticsTreeStyle) { + return value.parseDiagnosticsTreeStyle() as T; + } + + if (T == DragStartBehavior) { + return value.parseDragStartBehavior() as T; + } + + if (T == GestureDisposition) { + return value.parseGestureDisposition() as T; + } + + if (T == GestureRecognizerState) { + return value.parseGestureRecognizerState() as T; + } + + if (T == PointerDeviceKind) { + return value.parsePointerDeviceKind() as T; + } + + if (T == BottomNavigationBarLandscapeLayout) { + return value.parseBottomNavigationBarLandscapeLayout() as T; + } + + if (T == BottomNavigationBarType) { + return value.parseBottomNavigationBarType() as T; + } + + if (T == ButtonBarLayoutBehavior) { + return value.parseButtonBarLayoutBehavior() as T; + } + + if (T == ButtonTextTheme) { + return value.parseButtonTextTheme() as T; + } + + if (T == CollapseMode) { + return value.parseCollapseMode() as T; + } + + if (T == DatePickerEntryMode) { + return value.parseDatePickerEntryMode() as T; + } + + if (T == DatePickerMode) { + return value.parseDatePickerMode() as T; + } + + if (T == DayPeriod) { + return value.parseDayPeriod() as T; + } + + if (T == DrawerAlignment) { + return value.parseDrawerAlignment() as T; + } + + if (T == FloatingLabelBehavior) { + return value.parseFloatingLabelBehavior() as T; + } + + if (T == HourFormat) { + return value.parseHourFormat() as T; + } + + if (T == ListTileControlAffinity) { + return value.parseListTileControlAffinity() as T; + } + + if (T == ListTileStyle) { + return value.parseListTileStyle() as T; + } + + if (T == MaterialBannerClosedReason) { + return value.parseMaterialBannerClosedReason() as T; + } + + if (T == MaterialState) { + return value.parseMaterialState() as T; + } + + if (T == MaterialTapTargetSize) { + return value.parseMaterialTapTargetSize() as T; + } + + if (T == MaterialType) { + return value.parseMaterialType() as T; + } + + if (T == NavigationDestinationLabelBehavior) { + return value.parseNavigationDestinationLabelBehavior() as T; + } + + if (T == NavigationRailLabelType) { + return value.parseNavigationRailLabelType() as T; + } + + if (T == PopupMenuPosition) { + return value.parsePopupMenuPosition() as T; + } + + if (T == RefreshIndicatorTriggerMode) { + return value.parseRefreshIndicatorTriggerMode() as T; + } + + if (T == ScriptCategory) { + return value.parseScriptCategory() as T; + } + + if (T == ShowValueIndicator) { + return value.parseShowValueIndicator() as T; + } + + if (T == SnackBarBehavior) { + return value.parseSnackBarBehavior() as T; + } + + if (T == SnackBarClosedReason) { + return value.parseSnackBarClosedReason() as T; + } + + if (T == StepperType) { + return value.parseStepperType() as T; + } + + if (T == StepState) { + return value.parseStepState() as T; + } + + if (T == StretchMode) { + return value.parseStretchMode() as T; + } + + if (T == TabBarIndicatorSize) { + return value.parseTabBarIndicatorSize() as T; + } + + if (T == ThemeMode) { + return value.parseThemeMode() as T; + } + + if (T == Thumb) { + return value.parseThumb() as T; + } + + if (T == TimeOfDayFormat) { + return value.parseTimeOfDayFormat() as T; + } + + if (T == TimePickerEntryMode) { + return value.parseTimePickerEntryMode() as T; + } + + if (T == TooltipTriggerMode) { + return value.parseTooltipTriggerMode() as T; + } + + if (T == SpringType) { + return value.parseSpringType() as T; + } + + if (T == CacheExtentStyle) { + return value.parseCacheExtentStyle() as T; + } + + if (T == DebugSemanticsDumpOrder) { + return value.parseDebugSemanticsDumpOrder() as T; + } + + if (T == PerformanceOverlayOption) { + return value.parsePerformanceOverlayOption() as T; + } + + if (T == PlatformViewHitTestBehavior) { + return value.parsePlatformViewHitTestBehavior() as T; + } + + if (T == RenderAnimatedSizeState) { + return value.parseRenderAnimatedSizeState() as T; + } + + if (T == ScrollDirection) { + return value.parseScrollDirection() as T; + } + + if (T == SelectionEventType) { + return value.parseSelectionEventType() as T; + } + + if (T == SelectionResult) { + return value.parseSelectionResult() as T; + } + + if (T == SelectionStatus) { + return value.parseSelectionStatus() as T; + } + + if (T == SchedulerPhase) { + return value.parseSchedulerPhase() as T; + } + + if (T == DeviceOrientation) { + return value.parseDeviceOrientation() as T; + } + + if (T == FloatingCursorDragState) { + return value.parseFloatingCursorDragState() as T; + } + + if (T == KeyboardSide) { + return value.parseKeyboardSide() as T; + } + + if (T == KeyDataTransitMode) { + return value.parseKeyDataTransitMode() as T; + } + + if (T == MaxLengthEnforcement) { + return value.parseMaxLengthEnforcement() as T; + } + + if (T == ModifierKey) { + return value.parseModifierKey() as T; + } + + if (T == SystemSoundType) { + return value.parseSystemSoundType() as T; + } + + if (T == SystemUiMode) { + return value.parseSystemUiMode() as T; + } + + if (T == SystemUiOverlay) { + return value.parseSystemUiOverlay() as T; + } + + if (T == BoxHeightStyle) { + return value.parseBoxHeightStyle() as T; + } + + if (T == BoxWidthStyle) { + return value.parseBoxWidthStyle() as T; + } + + if (T == ClipOp) { + return value.parseClipOp() as T; + } + + if (T == DisplayFeatureState) { + return value.parseDisplayFeatureState() as T; + } + + if (T == DisplayFeatureType) { + return value.parseDisplayFeatureType() as T; + } + + if (T == FramePhase) { + return value.parseFramePhase() as T; + } + + if (T == ImageByteFormat) { + return value.parseImageByteFormat() as T; + } + + if (T == KeyEventType) { + return value.parseKeyEventType() as T; + } + + if (T == PixelFormat) { + return value.parsePixelFormat() as T; + } + + if (T == PointerChange) { + return value.parsePointerChange() as T; + } + + if (T == PointerSignalKind) { + return value.parsePointerSignalKind() as T; + } + + if (T == PointMode) { + return value.parsePointMode() as T; + } + + if (T == HttpClientResponseCompressionState) { + return value.parseHttpClientResponseCompressionState() as T; + } + + return null as T; +} + +bool isFlutterEmum(Type type) { + return type == AnimationBehavior || + type == AnimationStatus || + type == AndroidOverscrollIndicator || + type == AppLifecycleState || + type == AutofillContextAction || + type == AutovalidateMode || + type == Axis || + type == AxisDirection || + type == BannerLocation || + type == BlendMode || + type == BlurStyle || + type == BorderStyle || + type == BoxFit || + type == BoxShape || + type == Brightness || + type == Clip || + type == ClipboardStatus || + type == ConnectionState || + type == CrossAxisAlignment || + type == CrossFadeState || + type == CupertinoDatePickerMode || + type == CupertinoTimerPickerMode || + type == CupertinoUserInterfaceLevelData || + type == DatePickerDateOrder || + type == DatePickerDateTimeOrder || + type == DecorationPosition || + type == DiagnosticLevel || + type == DismissDirection || + type == FilterQuality || + type == FlexFit || + type == FlutterLogoStyle || + type == FocusHighlightMode || + type == FocusHighlightStrategy || + type == FontStyle || + type == GrowthDirection || + type == HeroFlightDirection || + type == HitTestBehavior || + type == ImageRepeat || + type == KeyEventResult || + type == MainAxisAlignment || + type == MainAxisSize || + type == NavigationMode || + type == Orientation || + type == OverflowBarAlignment || + type == OverlayVisibilityMode || + type == PaintingStyle || + type == PathFillType || + type == PathOperation || + type == PlaceholderAlignment || + type == PlatformProvidedMenuItemType || + type == RefreshIndicatorMode || + type == RenderComparison || + type == RouteInformationReportingType || + type == RoutePopDisposition || + type == ScrollbarOrientation || + type == ScrollIncrementType || + type == ScrollPositionAlignmentPolicy || + type == ScrollViewKeyboardDismissBehavior || + type == SelectionChangedCause || + type == SmartDashesType || + type == SmartQuotesType || + type == StackFit || + type == StrokeCap || + type == StrokeJoin || + type == TableCellVerticalAlignment || + type == TargetPlatform || + type == TextAffinity || + type == TextAlign || + type == TextBaseline || + type == TextCapitalization || + type == TextDecorationStyle || + type == TextDirection || + type == TextInputAction || + type == TextLeadingDistribution || + type == TextOverflow || + type == TextSelectionHandleType || + type == TextWidthBasis || + type == TileMode || + type == TraversalDirection || + type == UnfocusDisposition || + type == VertexMode || + type == VerticalDirection || + type == WrapAlignment || + type == WrapCrossAlignment || + type == DiagnosticsTreeStyle || + type == DragStartBehavior || + type == GestureDisposition || + type == GestureRecognizerState || + type == PointerDeviceKind || + type == BottomNavigationBarLandscapeLayout || + type == BottomNavigationBarType || + type == ButtonBarLayoutBehavior || + type == ButtonTextTheme || + type == CollapseMode || + type == DatePickerEntryMode || + type == DatePickerMode || + type == DayPeriod || + type == DrawerAlignment || + type == FloatingLabelBehavior || + type == HourFormat || + type == ListTileControlAffinity || + type == ListTileStyle || + type == MaterialBannerClosedReason || + type == MaterialState || + type == MaterialTapTargetSize || + type == MaterialType || + type == NavigationDestinationLabelBehavior || + type == NavigationRailLabelType || + type == PopupMenuPosition || + type == RefreshIndicatorTriggerMode || + type == ScriptCategory || + type == ShowValueIndicator || + type == SnackBarBehavior || + type == SnackBarClosedReason || + type == StepperType || + type == StepState || + type == StretchMode || + type == TabBarIndicatorSize || + type == ThemeMode || + type == Thumb || + type == TimeOfDayFormat || + type == TimePickerEntryMode || + type == TooltipTriggerMode || + type == SpringType || + type == CacheExtentStyle || + type == DebugSemanticsDumpOrder || + type == PerformanceOverlayOption || + type == PlatformViewHitTestBehavior || + type == RenderAnimatedSizeState || + type == ScrollDirection || + type == SelectionEventType || + type == SelectionResult || + type == SelectionStatus || + type == SchedulerPhase || + type == DeviceOrientation || + type == FloatingCursorDragState || + type == KeyboardSide || + type == KeyDataTransitMode || + type == MaxLengthEnforcement || + type == ModifierKey || + type == SystemSoundType || + type == SystemUiMode || + type == SystemUiOverlay || + type == BoxHeightStyle || + type == BoxWidthStyle || + type == ClipOp || + type == DisplayFeatureState || + type == DisplayFeatureType || + type == FramePhase || + type == ImageByteFormat || + type == KeyEventType || + type == PixelFormat || + type == PointerChange || + type == PointerSignalKind || + type == PointMode || + type == HttpClientResponseCompressionState; +} + +extension StringExtensionForEnums on String { + AnimationBehavior parseAnimationBehavior() { + return AnimationBehavior.values + .firstWhere((e) => e.toString() == 'AnimationBehavior.' + this); + } + + AnimationStatus parseAnimationStatus() { + return AnimationStatus.values + .firstWhere((e) => e.toString() == 'AnimationStatus.' + this); + } + + AndroidOverscrollIndicator parseAndroidOverscrollIndicator() { + return AndroidOverscrollIndicator.values.firstWhere( + (e) => e.toString() == 'AndroidOverscrollIndicator.' + this); + } + + AppLifecycleState parseAppLifecycleState() { + return AppLifecycleState.values + .firstWhere((e) => e.toString() == 'AppLifecycleState.' + this); + } + + AutofillContextAction parseAutofillContextAction() { + return AutofillContextAction.values + .firstWhere((e) => e.toString() == 'AutofillContextAction.' + this); + } + + AutovalidateMode parseAutovalidateMode() { + return AutovalidateMode.values + .firstWhere((e) => e.toString() == 'AutovalidateMode.' + this); + } + + Axis parseAxis() { + return Axis.values.firstWhere((e) => e.toString() == 'Axis.' + this); + } + + AxisDirection parseAxisDirection() { + return AxisDirection.values + .firstWhere((e) => e.toString() == 'AxisDirection.' + this); + } + + BannerLocation parseBannerLocation() { + return BannerLocation.values + .firstWhere((e) => e.toString() == 'BannerLocation.' + this); + } + + BlendMode parseBlendMode() { + return BlendMode.values + .firstWhere((e) => e.toString() == 'BlendMode.' + this); + } + + BlurStyle parseBlurStyle() { + return BlurStyle.values + .firstWhere((e) => e.toString() == 'BlurStyle.' + this); + } + + BorderStyle parseBorderStyle() { + return BorderStyle.values + .firstWhere((e) => e.toString() == 'BorderStyle.' + this); + } + + BoxFit parseBoxFit() { + return BoxFit.values.firstWhere((e) => e.toString() == 'BoxFit.' + this); + } + + BoxShape parseBoxShape() { + return BoxShape.values + .firstWhere((e) => e.toString() == 'BoxShape.' + this); + } + + Brightness parseBrightness() { + return Brightness.values + .firstWhere((e) => e.toString() == 'Brightness.' + this); + } + + Clip parseClip() { + return Clip.values.firstWhere((e) => e.toString() == 'Clip.' + this); + } + + ClipboardStatus parseClipboardStatus() { + return ClipboardStatus.values + .firstWhere((e) => e.toString() == 'ClipboardStatus.' + this); + } + + ConnectionState parseConnectionState() { + return ConnectionState.values + .firstWhere((e) => e.toString() == 'ConnectionState.' + this); + } + + CrossAxisAlignment parseCrossAxisAlignment() { + return CrossAxisAlignment.values + .firstWhere((e) => e.toString() == 'CrossAxisAlignment.' + this); + } + + CrossFadeState parseCrossFadeState() { + return CrossFadeState.values + .firstWhere((e) => e.toString() == 'CrossFadeState.' + this); + } + + CupertinoDatePickerMode parseCupertinoDatePickerMode() { + return CupertinoDatePickerMode.values + .firstWhere((e) => e.toString() == 'CupertinoDatePickerMode.' + this); + } + + CupertinoTimerPickerMode parseCupertinoTimerPickerMode() { + return CupertinoTimerPickerMode.values + .firstWhere((e) => e.toString() == 'CupertinoTimerPickerMode.' + this); + } + + CupertinoUserInterfaceLevelData parseCupertinoUserInterfaceLevelData() { + return CupertinoUserInterfaceLevelData.values.firstWhere( + (e) => e.toString() == 'CupertinoUserInterfaceLevelData.' + this); + } + + DatePickerDateOrder parseDatePickerDateOrder() { + return DatePickerDateOrder.values + .firstWhere((e) => e.toString() == 'DatePickerDateOrder.' + this); + } + + DatePickerDateTimeOrder parseDatePickerDateTimeOrder() { + return DatePickerDateTimeOrder.values + .firstWhere((e) => e.toString() == 'DatePickerDateTimeOrder.' + this); + } + + DecorationPosition parseDecorationPosition() { + return DecorationPosition.values + .firstWhere((e) => e.toString() == 'DecorationPosition.' + this); + } + + DiagnosticLevel parseDiagnosticLevel() { + return DiagnosticLevel.values + .firstWhere((e) => e.toString() == 'DiagnosticLevel.' + this); + } + + DismissDirection parseDismissDirection() { + return DismissDirection.values + .firstWhere((e) => e.toString() == 'DismissDirection.' + this); + } + + FilterQuality parseFilterQuality() { + return FilterQuality.values + .firstWhere((e) => e.toString() == 'FilterQuality.' + this); + } + + FlexFit parseFlexFit() { + return FlexFit.values.firstWhere((e) => e.toString() == 'FlexFit.' + this); + } + + FlutterLogoStyle parseFlutterLogoStyle() { + return FlutterLogoStyle.values + .firstWhere((e) => e.toString() == 'FlutterLogoStyle.' + this); + } + + FocusHighlightMode parseFocusHighlightMode() { + return FocusHighlightMode.values + .firstWhere((e) => e.toString() == 'FocusHighlightMode.' + this); + } + + FocusHighlightStrategy parseFocusHighlightStrategy() { + return FocusHighlightStrategy.values + .firstWhere((e) => e.toString() == 'FocusHighlightStrategy.' + this); + } + + FontStyle parseFontStyle() { + return FontStyle.values + .firstWhere((e) => e.toString() == 'FontStyle.' + this); + } + + GrowthDirection parseGrowthDirection() { + return GrowthDirection.values + .firstWhere((e) => e.toString() == 'GrowthDirection.' + this); + } + + HeroFlightDirection parseHeroFlightDirection() { + return HeroFlightDirection.values + .firstWhere((e) => e.toString() == 'HeroFlightDirection.' + this); + } + + HitTestBehavior parseHitTestBehavior() { + return HitTestBehavior.values + .firstWhere((e) => e.toString() == 'HitTestBehavior.' + this); + } + + ImageRepeat parseImageRepeat() { + return ImageRepeat.values + .firstWhere((e) => e.toString() == 'ImageRepeat.' + this); + } + + KeyEventResult parseKeyEventResult() { + return KeyEventResult.values + .firstWhere((e) => e.toString() == 'KeyEventResult.' + this); + } + + MainAxisAlignment parseMainAxisAlignment() { + return MainAxisAlignment.values + .firstWhere((e) => e.toString() == 'MainAxisAlignment.' + this); + } + + MainAxisSize parseMainAxisSize() { + return MainAxisSize.values + .firstWhere((e) => e.toString() == 'MainAxisSize.' + this); + } + + NavigationMode parseNavigationMode() { + return NavigationMode.values + .firstWhere((e) => e.toString() == 'NavigationMode.' + this); + } + + Orientation parseOrientation() { + return Orientation.values + .firstWhere((e) => e.toString() == 'Orientation.' + this); + } + + OverflowBarAlignment parseOverflowBarAlignment() { + return OverflowBarAlignment.values + .firstWhere((e) => e.toString() == 'OverflowBarAlignment.' + this); + } + + OverlayVisibilityMode parseOverlayVisibilityMode() { + return OverlayVisibilityMode.values + .firstWhere((e) => e.toString() == 'OverlayVisibilityMode.' + this); + } + + PaintingStyle parsePaintingStyle() { + return PaintingStyle.values + .firstWhere((e) => e.toString() == 'PaintingStyle.' + this); + } + + PathFillType parsePathFillType() { + return PathFillType.values + .firstWhere((e) => e.toString() == 'PathFillType.' + this); + } + + PathOperation parsePathOperation() { + return PathOperation.values + .firstWhere((e) => e.toString() == 'PathOperation.' + this); + } + + PlaceholderAlignment parsePlaceholderAlignment() { + return PlaceholderAlignment.values + .firstWhere((e) => e.toString() == 'PlaceholderAlignment.' + this); + } + + PlatformProvidedMenuItemType parsePlatformProvidedMenuItemType() { + return PlatformProvidedMenuItemType.values.firstWhere( + (e) => e.toString() == 'PlatformProvidedMenuItemType.' + this); + } + + RefreshIndicatorMode parseRefreshIndicatorMode() { + return RefreshIndicatorMode.values + .firstWhere((e) => e.toString() == 'RefreshIndicatorMode.' + this); + } + + RenderComparison parseRenderComparison() { + return RenderComparison.values + .firstWhere((e) => e.toString() == 'RenderComparison.' + this); + } + + RouteInformationReportingType parseRouteInformationReportingType() { + return RouteInformationReportingType.values.firstWhere( + (e) => e.toString() == 'RouteInformationReportingType.' + this); + } + + RoutePopDisposition parseRoutePopDisposition() { + return RoutePopDisposition.values + .firstWhere((e) => e.toString() == 'RoutePopDisposition.' + this); + } + + ScrollbarOrientation parseScrollbarOrientation() { + return ScrollbarOrientation.values + .firstWhere((e) => e.toString() == 'ScrollbarOrientation.' + this); + } + + ScrollIncrementType parseScrollIncrementType() { + return ScrollIncrementType.values + .firstWhere((e) => e.toString() == 'ScrollIncrementType.' + this); + } + + ScrollPositionAlignmentPolicy parseScrollPositionAlignmentPolicy() { + return ScrollPositionAlignmentPolicy.values.firstWhere( + (e) => e.toString() == 'ScrollPositionAlignmentPolicy.' + this); + } + + ScrollViewKeyboardDismissBehavior parseScrollViewKeyboardDismissBehavior() { + return ScrollViewKeyboardDismissBehavior.values.firstWhere( + (e) => e.toString() == 'ScrollViewKeyboardDismissBehavior.' + this); + } + + SelectionChangedCause parseSelectionChangedCause() { + return SelectionChangedCause.values + .firstWhere((e) => e.toString() == 'SelectionChangedCause.' + this); + } + + SmartDashesType parseSmartDashesType() { + return SmartDashesType.values + .firstWhere((e) => e.toString() == 'SmartDashesType.' + this); + } + + SmartQuotesType parseSmartQuotesType() { + return SmartQuotesType.values + .firstWhere((e) => e.toString() == 'SmartQuotesType.' + this); + } + + StackFit parseStackFit() { + return StackFit.values + .firstWhere((e) => e.toString() == 'StackFit.' + this); + } + + StrokeCap parseStrokeCap() { + return StrokeCap.values + .firstWhere((e) => e.toString() == 'StrokeCap.' + this); + } + + StrokeJoin parseStrokeJoin() { + return StrokeJoin.values + .firstWhere((e) => e.toString() == 'StrokeJoin.' + this); + } + + TableCellVerticalAlignment parseTableCellVerticalAlignment() { + return TableCellVerticalAlignment.values.firstWhere( + (e) => e.toString() == 'TableCellVerticalAlignment.' + this); + } + + TargetPlatform parseTargetPlatform() { + return TargetPlatform.values + .firstWhere((e) => e.toString() == 'TargetPlatform.' + this); + } + + TextAffinity parseTextAffinity() { + return TextAffinity.values + .firstWhere((e) => e.toString() == 'TextAffinity.' + this); + } + + TextAlign parseTextAlign() { + return TextAlign.values + .firstWhere((e) => e.toString() == 'TextAlign.' + this); + } + + TextBaseline parseTextBaseline() { + return TextBaseline.values + .firstWhere((e) => e.toString() == 'TextBaseline.' + this); + } + + TextCapitalization parseTextCapitalization() { + return TextCapitalization.values + .firstWhere((e) => e.toString() == 'TextCapitalization.' + this); + } + + TextDecorationStyle parseTextDecorationStyle() { + return TextDecorationStyle.values + .firstWhere((e) => e.toString() == 'TextDecorationStyle.' + this); + } + + TextDirection parseTextDirection() { + return TextDirection.values + .firstWhere((e) => e.toString() == 'TextDirection.' + this); + } + + TextInputAction parseTextInputAction() { + return TextInputAction.values + .firstWhere((e) => e.toString() == 'TextInputAction.' + this); + } + + TextLeadingDistribution parseTextLeadingDistribution() { + return TextLeadingDistribution.values + .firstWhere((e) => e.toString() == 'TextLeadingDistribution.' + this); + } + + TextOverflow parseTextOverflow() { + return TextOverflow.values + .firstWhere((e) => e.toString() == 'TextOverflow.' + this); + } + + TextSelectionHandleType parseTextSelectionHandleType() { + return TextSelectionHandleType.values + .firstWhere((e) => e.toString() == 'TextSelectionHandleType.' + this); + } + + TextWidthBasis parseTextWidthBasis() { + return TextWidthBasis.values + .firstWhere((e) => e.toString() == 'TextWidthBasis.' + this); + } + + TileMode parseTileMode() { + return TileMode.values + .firstWhere((e) => e.toString() == 'TileMode.' + this); + } + + TraversalDirection parseTraversalDirection() { + return TraversalDirection.values + .firstWhere((e) => e.toString() == 'TraversalDirection.' + this); + } + + UnfocusDisposition parseUnfocusDisposition() { + return UnfocusDisposition.values + .firstWhere((e) => e.toString() == 'UnfocusDisposition.' + this); + } + + VertexMode parseVertexMode() { + return VertexMode.values + .firstWhere((e) => e.toString() == 'VertexMode.' + this); + } + + VerticalDirection parseVerticalDirection() { + return VerticalDirection.values + .firstWhere((e) => e.toString() == 'VerticalDirection.' + this); + } + + WrapAlignment parseWrapAlignment() { + return WrapAlignment.values + .firstWhere((e) => e.toString() == 'WrapAlignment.' + this); + } + + WrapCrossAlignment parseWrapCrossAlignment() { + return WrapCrossAlignment.values + .firstWhere((e) => e.toString() == 'WrapCrossAlignment.' + this); + } + + DiagnosticsTreeStyle parseDiagnosticsTreeStyle() { + return DiagnosticsTreeStyle.values + .firstWhere((e) => e.toString() == 'DiagnosticsTreeStyle.' + this); + } + + DragStartBehavior parseDragStartBehavior() { + return DragStartBehavior.values + .firstWhere((e) => e.toString() == 'DragStartBehavior.' + this); + } + + GestureDisposition parseGestureDisposition() { + return GestureDisposition.values + .firstWhere((e) => e.toString() == 'GestureDisposition.' + this); + } + + GestureRecognizerState parseGestureRecognizerState() { + return GestureRecognizerState.values + .firstWhere((e) => e.toString() == 'GestureRecognizerState.' + this); + } + + PointerDeviceKind parsePointerDeviceKind() { + return PointerDeviceKind.values + .firstWhere((e) => e.toString() == 'PointerDeviceKind.' + this); + } + + BottomNavigationBarLandscapeLayout parseBottomNavigationBarLandscapeLayout() { + return BottomNavigationBarLandscapeLayout.values.firstWhere( + (e) => e.toString() == 'BottomNavigationBarLandscapeLayout.' + this); + } + + BottomNavigationBarType parseBottomNavigationBarType() { + return BottomNavigationBarType.values + .firstWhere((e) => e.toString() == 'BottomNavigationBarType.' + this); + } + + ButtonBarLayoutBehavior parseButtonBarLayoutBehavior() { + return ButtonBarLayoutBehavior.values + .firstWhere((e) => e.toString() == 'ButtonBarLayoutBehavior.' + this); + } + + ButtonTextTheme parseButtonTextTheme() { + return ButtonTextTheme.values + .firstWhere((e) => e.toString() == 'ButtonTextTheme.' + this); + } + + CollapseMode parseCollapseMode() { + return CollapseMode.values + .firstWhere((e) => e.toString() == 'CollapseMode.' + this); + } + + DatePickerEntryMode parseDatePickerEntryMode() { + return DatePickerEntryMode.values + .firstWhere((e) => e.toString() == 'DatePickerEntryMode.' + this); + } + + DatePickerMode parseDatePickerMode() { + return DatePickerMode.values + .firstWhere((e) => e.toString() == 'DatePickerMode.' + this); + } + + DayPeriod parseDayPeriod() { + return DayPeriod.values + .firstWhere((e) => e.toString() == 'DayPeriod.' + this); + } + + DrawerAlignment parseDrawerAlignment() { + return DrawerAlignment.values + .firstWhere((e) => e.toString() == 'DrawerAlignment.' + this); + } + + FloatingLabelBehavior parseFloatingLabelBehavior() { + return FloatingLabelBehavior.values + .firstWhere((e) => e.toString() == 'FloatingLabelBehavior.' + this); + } + + HourFormat parseHourFormat() { + return HourFormat.values + .firstWhere((e) => e.toString() == 'HourFormat.' + this); + } + + ListTileControlAffinity parseListTileControlAffinity() { + return ListTileControlAffinity.values + .firstWhere((e) => e.toString() == 'ListTileControlAffinity.' + this); + } + + ListTileStyle parseListTileStyle() { + return ListTileStyle.values + .firstWhere((e) => e.toString() == 'ListTileStyle.' + this); + } + + MaterialBannerClosedReason parseMaterialBannerClosedReason() { + return MaterialBannerClosedReason.values.firstWhere( + (e) => e.toString() == 'MaterialBannerClosedReason.' + this); + } + + MaterialState parseMaterialState() { + return MaterialState.values + .firstWhere((e) => e.toString() == 'MaterialState.' + this); + } + + MaterialTapTargetSize parseMaterialTapTargetSize() { + return MaterialTapTargetSize.values + .firstWhere((e) => e.toString() == 'MaterialTapTargetSize.' + this); + } + + MaterialType parseMaterialType() { + return MaterialType.values + .firstWhere((e) => e.toString() == 'MaterialType.' + this); + } + + NavigationDestinationLabelBehavior parseNavigationDestinationLabelBehavior() { + return NavigationDestinationLabelBehavior.values.firstWhere( + (e) => e.toString() == 'NavigationDestinationLabelBehavior.' + this); + } + + NavigationRailLabelType parseNavigationRailLabelType() { + return NavigationRailLabelType.values + .firstWhere((e) => e.toString() == 'NavigationRailLabelType.' + this); + } + + PopupMenuPosition parsePopupMenuPosition() { + return PopupMenuPosition.values + .firstWhere((e) => e.toString() == 'PopupMenuPosition.' + this); + } + + RefreshIndicatorTriggerMode parseRefreshIndicatorTriggerMode() { + return RefreshIndicatorTriggerMode.values.firstWhere( + (e) => e.toString() == 'RefreshIndicatorTriggerMode.' + this); + } + + ScriptCategory parseScriptCategory() { + return ScriptCategory.values + .firstWhere((e) => e.toString() == 'ScriptCategory.' + this); + } + + ShowValueIndicator parseShowValueIndicator() { + return ShowValueIndicator.values + .firstWhere((e) => e.toString() == 'ShowValueIndicator.' + this); + } + + SnackBarBehavior parseSnackBarBehavior() { + return SnackBarBehavior.values + .firstWhere((e) => e.toString() == 'SnackBarBehavior.' + this); + } + + SnackBarClosedReason parseSnackBarClosedReason() { + return SnackBarClosedReason.values + .firstWhere((e) => e.toString() == 'SnackBarClosedReason.' + this); + } + + StepperType parseStepperType() { + return StepperType.values + .firstWhere((e) => e.toString() == 'StepperType.' + this); + } + + StepState parseStepState() { + return StepState.values + .firstWhere((e) => e.toString() == 'StepState.' + this); + } + + StretchMode parseStretchMode() { + return StretchMode.values + .firstWhere((e) => e.toString() == 'StretchMode.' + this); + } + + TabBarIndicatorSize parseTabBarIndicatorSize() { + return TabBarIndicatorSize.values + .firstWhere((e) => e.toString() == 'TabBarIndicatorSize.' + this); + } + + ThemeMode parseThemeMode() { + return ThemeMode.values + .firstWhere((e) => e.toString() == 'ThemeMode.' + this); + } + + Thumb parseThumb() { + return Thumb.values.firstWhere((e) => e.toString() == 'Thumb.' + this); + } + + TimeOfDayFormat parseTimeOfDayFormat() { + return TimeOfDayFormat.values + .firstWhere((e) => e.toString() == 'TimeOfDayFormat.' + this); + } + + TimePickerEntryMode parseTimePickerEntryMode() { + return TimePickerEntryMode.values + .firstWhere((e) => e.toString() == 'TimePickerEntryMode.' + this); + } + + TooltipTriggerMode parseTooltipTriggerMode() { + return TooltipTriggerMode.values + .firstWhere((e) => e.toString() == 'TooltipTriggerMode.' + this); + } + + SpringType parseSpringType() { + return SpringType.values + .firstWhere((e) => e.toString() == 'SpringType.' + this); + } + + CacheExtentStyle parseCacheExtentStyle() { + return CacheExtentStyle.values + .firstWhere((e) => e.toString() == 'CacheExtentStyle.' + this); + } + + DebugSemanticsDumpOrder parseDebugSemanticsDumpOrder() { + return DebugSemanticsDumpOrder.values + .firstWhere((e) => e.toString() == 'DebugSemanticsDumpOrder.' + this); + } + + PerformanceOverlayOption parsePerformanceOverlayOption() { + return PerformanceOverlayOption.values + .firstWhere((e) => e.toString() == 'PerformanceOverlayOption.' + this); + } + + PlatformViewHitTestBehavior parsePlatformViewHitTestBehavior() { + return PlatformViewHitTestBehavior.values.firstWhere( + (e) => e.toString() == 'PlatformViewHitTestBehavior.' + this); + } + + RenderAnimatedSizeState parseRenderAnimatedSizeState() { + return RenderAnimatedSizeState.values + .firstWhere((e) => e.toString() == 'RenderAnimatedSizeState.' + this); + } + + ScrollDirection parseScrollDirection() { + return ScrollDirection.values + .firstWhere((e) => e.toString() == 'ScrollDirection.' + this); + } + + SelectionEventType parseSelectionEventType() { + return SelectionEventType.values + .firstWhere((e) => e.toString() == 'SelectionEventType.' + this); + } + + SelectionResult parseSelectionResult() { + return SelectionResult.values + .firstWhere((e) => e.toString() == 'SelectionResult.' + this); + } + + SelectionStatus parseSelectionStatus() { + return SelectionStatus.values + .firstWhere((e) => e.toString() == 'SelectionStatus.' + this); + } + + SchedulerPhase parseSchedulerPhase() { + return SchedulerPhase.values + .firstWhere((e) => e.toString() == 'SchedulerPhase.' + this); + } + + DeviceOrientation parseDeviceOrientation() { + return DeviceOrientation.values + .firstWhere((e) => e.toString() == 'DeviceOrientation.' + this); + } + + FloatingCursorDragState parseFloatingCursorDragState() { + return FloatingCursorDragState.values + .firstWhere((e) => e.toString() == 'FloatingCursorDragState.' + this); + } + + KeyboardSide parseKeyboardSide() { + return KeyboardSide.values + .firstWhere((e) => e.toString() == 'KeyboardSide.' + this); + } + + KeyDataTransitMode parseKeyDataTransitMode() { + return KeyDataTransitMode.values + .firstWhere((e) => e.toString() == 'KeyDataTransitMode.' + this); + } + + MaxLengthEnforcement parseMaxLengthEnforcement() { + return MaxLengthEnforcement.values + .firstWhere((e) => e.toString() == 'MaxLengthEnforcement.' + this); + } + + ModifierKey parseModifierKey() { + return ModifierKey.values + .firstWhere((e) => e.toString() == 'ModifierKey.' + this); + } + + SystemSoundType parseSystemSoundType() { + return SystemSoundType.values + .firstWhere((e) => e.toString() == 'SystemSoundType.' + this); + } + + SystemUiMode parseSystemUiMode() { + return SystemUiMode.values + .firstWhere((e) => e.toString() == 'SystemUiMode.' + this); + } + + SystemUiOverlay parseSystemUiOverlay() { + return SystemUiOverlay.values + .firstWhere((e) => e.toString() == 'SystemUiOverlay.' + this); + } + + BoxHeightStyle parseBoxHeightStyle() { + return BoxHeightStyle.values + .firstWhere((e) => e.toString() == 'BoxHeightStyle.' + this); + } + + BoxWidthStyle parseBoxWidthStyle() { + return BoxWidthStyle.values + .firstWhere((e) => e.toString() == 'BoxWidthStyle.' + this); + } + + ClipOp parseClipOp() { + return ClipOp.values.firstWhere((e) => e.toString() == 'ClipOp.' + this); + } + + DisplayFeatureState parseDisplayFeatureState() { + return DisplayFeatureState.values + .firstWhere((e) => e.toString() == 'DisplayFeatureState.' + this); + } + + DisplayFeatureType parseDisplayFeatureType() { + return DisplayFeatureType.values + .firstWhere((e) => e.toString() == 'DisplayFeatureType.' + this); + } + + FramePhase parseFramePhase() { + return FramePhase.values + .firstWhere((e) => e.toString() == 'FramePhase.' + this); + } + + ImageByteFormat parseImageByteFormat() { + return ImageByteFormat.values + .firstWhere((e) => e.toString() == 'ImageByteFormat.' + this); + } + + KeyEventType parseKeyEventType() { + return KeyEventType.values + .firstWhere((e) => e.toString() == 'KeyEventType.' + this); + } + + PixelFormat parsePixelFormat() { + return PixelFormat.values + .firstWhere((e) => e.toString() == 'PixelFormat.' + this); + } + + PointerChange parsePointerChange() { + return PointerChange.values + .firstWhere((e) => e.toString() == 'PointerChange.' + this); + } + + PointerSignalKind parsePointerSignalKind() { + return PointerSignalKind.values + .firstWhere((e) => e.toString() == 'PointerSignalKind.' + this); + } + + PointMode parsePointMode() { + return PointMode.values + .firstWhere((e) => e.toString() == 'PointMode.' + this); + } + + HttpClientResponseCompressionState parseHttpClientResponseCompressionState() { + return HttpClientResponseCompressionState.values.firstWhere( + (e) => e.toString() == 'HttpClientResponseCompressionState.' + this); + } +} +` \ No newline at end of file diff --git a/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/mappers/flutter_types_ext.ts b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/mappers/flutter_types_ext.ts new file mode 100644 index 0000000..58fc144 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/mappers/flutter_types_ext.ts @@ -0,0 +1,28 @@ +export default (args: {}) => `import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; + +// EXTENSIONS +extension StringToBool on String { + bool parseBool() { + return this.toLowerCase() == 'true'; + } +} + +extension StringToColor on String { + Color parseColor() { + // if string starts with #, remove it + if (this.startsWith("#")) { + return Color(int.parse(this.substring(1, 7), radix: 16) + 0xFF000000); + } else { + return Color(int.parse(this, radix: 16) + 0xFF000000); + } + } +} + +extension StringToIcon on String { + Icon parseIcon() { + // TODO: parse icon + return Icon(Icons.add); + } +} +` \ No newline at end of file diff --git a/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/mappers/mappers.ts b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/mappers/mappers.ts new file mode 100644 index 0000000..321d93f --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/mappers/mappers.ts @@ -0,0 +1,3 @@ +export default (args: {}) => `export './flutter_enums_ext.dart'; +export './flutter_types_ext.dart'; +` \ No newline at end of file diff --git a/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/preview.ts b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/preview.ts new file mode 100644 index 0000000..aa7c254 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/preview.ts @@ -0,0 +1,4 @@ +export default (args: {}) => `export './properties_value_mapper.dart'; +export './initial_properties.dart'; +export './properties_value_state.dart'; +` \ No newline at end of file diff --git a/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/properties_value.ts b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/properties_value.ts new file mode 100644 index 0000000..0b5bb5c --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/properties_value.ts @@ -0,0 +1,106 @@ +export default (args: {}) => `import 'dart:html' as html; +import 'package:flutter/widgets.dart'; +import './properties_value_state.dart'; +import './mappers/mappers.dart'; + +T value( + BuildContext context, + String key, +) { + // Callbacks + if (T == Function || T == Function()) { + return makeCallbackEventEmitter(key) as T; + } + + final value = PropertiesStateContainer.of(context)!.properties[key]; + + // core types + // - Number - int, double, num + // - Boolean - bool + // - String - String + // - List - List + // - Map - Map + + // number - https://dart.dev/guides/language/numbers + if (T == num || T == int || T == double) { + if (value == null) { + return 0 as T; + } + + if (value is String) { + if (T is int) { + try { + return int.parse(value) as T; + } catch (e) {} + } + if (T is double) { + try { + return double.parse(value) as T; + } catch (e) {} + } + return num.parse(value) as T; + } else { + return value as T; + } + } + + // boolean + if (T == bool) { + if (value == null) { + return false as T; + } + + if (value is bool) { + return value as T; + } else { + // parse string to boolean + if (value is String) { + return value.parseBool() as T; + } + return value as T; + } + } + + // string + if (T == String) { + if (value == null) { + return "" as T; + } + return value.toString() as T; + } + + // Color + if (T == Color) { + if (value is String) { + return value.parseColor() as T; + } + return value as T; + } + + // Icon + if (T == Icon) { + if (value is String) { + return value.parseIcon() as T; + } + return value as T; + } + + if (isFlutterEmum(T)) { + return flutterEnumFromString(value) as T; + } + + return value; +} + +Function() makeCallbackEventEmitter(String name) { + return ([dynamic args]) { + // Send a event to the parent webapp when the widget is tapped + // post message + html.window.parent?.postMessage({ + "event": "@inapp/function-invocation-event", + "name": name, + "args": args + }, "*"); + }; +} +` \ No newline at end of file diff --git a/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/properties_value_mapper.ts b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/properties_value_mapper.ts new file mode 100644 index 0000000..28c5673 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/properties_value_mapper.ts @@ -0,0 +1,24 @@ +export default (args: {property_variable_declarations: string, widget_instantiation: string}) => `import 'package:flutter/widgets.dart'; +import './properties_value.dart'; +import './target_widget.dart'; + +class PropertiesMapper extends StatelessWidget { + const PropertiesMapper({super.key}); + + @override + Widget build(BuildContext context) { + // read the value of the "name" property from the parent state container + // start_flutter_preview_template:property_variable_declarations +${args.property_variable_declarations} +// end_flutter_preview_template:property_variable_declarations + + return Column( + children: [ + // start_flutter_preview_template:widget_instantiation +${args.widget_instantiation} +// end_flutter_preview_template:widget_instantiation + ], + ); + } +} +` \ No newline at end of file diff --git a/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/properties_value_state.ts b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/properties_value_state.ts new file mode 100644 index 0000000..bcd5767 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/properties_value_state.ts @@ -0,0 +1,78 @@ +export default (args: {}) => `import 'dart:html' as html; +import 'package:flutter/widgets.dart'; + +// Define a state container widget that manages a map of properties +class PropertiesStateContainer extends InheritedWidget { + final Map properties; + + const PropertiesStateContainer({ + required this.properties, + required Widget child, + Key? key, + }) : super(key: key, child: child); + + // Define a static method to easily access the inherited widget from child widgets + static PropertiesStateContainer? of(BuildContext context) { + return context + .dependOnInheritedWidgetOfExactType(); + } + + // We only need to rebuild this widget when the properties map changes + @override + bool updateShouldNotify(PropertiesStateContainer old) { + return properties != old.properties; + } +} + +// State manager widget that listens for property change events and updates the state container +class PropertiesStateManager extends StatefulWidget { + final Map initialProperties; + final Widget child; + + const PropertiesStateManager( + {required this.child, required this.initialProperties, Key? key}) + : super(key: key); + + @override + _PropertiesStateManagerState createState() => _PropertiesStateManagerState(); +} + +class _PropertiesStateManagerState extends State { + late Map _properties; + + @override + void initState() { + super.initState(); + _properties = widget.initialProperties; + } + + // Define a method to update a property value + void setProperty(String key, dynamic value) { + setState(() { + _properties = {..._properties, key: value}; + }); + } + + @override + Widget build(BuildContext context) { + // Provide the properties map to child widgets using the state container + return PropertiesStateContainer( + properties: _properties, child: widget.child); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + + // Listen for property change events from the parent webapp + html.window.onMessage.listen((event) { + final dynamic data = event.data; + if (data["event"] == "@inapp/property-change") { + final key = data["key"]; + final value = data["value"]; + setProperty(key, value); + } + }); + } +} +` \ No newline at end of file diff --git a/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/target_widget.ts b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/target_widget.ts new file mode 100644 index 0000000..4e2f4d6 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/.flutter_preview_artifacts/target_widget.ts @@ -0,0 +1,3 @@ +export default (args: {target_widget: string}) => `// start_flutter_preview_template:target_widget +${args.target_widget} +// end_flutter_preview_template:target_widget` \ No newline at end of file diff --git a/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/main.ts b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/main.ts new file mode 100644 index 0000000..9c11dd8 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/templates/v2/lib/main.ts @@ -0,0 +1,28 @@ +export default (args: {title: string}) => `import 'package:flutter/material.dart'; +import '.flutter_preview_artifacts/preview.dart'; + +void main() { + runApp(const FlutterPreview()); +} + +class FlutterPreview extends StatelessWidget { + const FlutterPreview({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + debugShowCheckedModeBanner: false, + title: + // start_flutter_preview_template:title +${args.title} +// end_flutter_preview_template:title + , + theme: ThemeData(), + home: Scaffold( + body: PropertiesStateManager( + initialProperties: FLUTTER_PREVIEW_TARGET_WIDGET_INITIAL_PROPERTIES, + child: PropertiesMapper(), + ))); + } +} +` \ No newline at end of file diff --git a/flutter-preview/flutter-preview-template/template-app/yarn.lock b/flutter-preview/flutter-preview-template/template-app/yarn.lock new file mode 100644 index 0000000..d2c2fa9 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-app/yarn.lock @@ -0,0 +1,28 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/assert@^1.5.6": + version "1.5.6" + resolved "https://registry.yarnpkg.com/@types/assert/-/assert-1.5.6.tgz#a8b5a94ce5fb8f4ba65fdc37fc9507609114189e" + integrity sha512-Y7gDJiIqb9qKUHfBQYOWGngUpLORtirAVPuj/CWJrU2C6ZM4/y3XLwuwfGMF8s7QzW746LQZx23m0+1FSgjfug== + +"@types/mustache@^4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@types/mustache/-/mustache-4.2.2.tgz#825bf5c214c3ab84d0b23fef2c8eb898f3ff8717" + integrity sha512-MUSpfpW0yZbTgjekDbH0shMYBUD+X/uJJJMm9LXN1d5yjl5lCY1vN/eWKD6D1tOtjA6206K0zcIPnUaFMurdNA== + +"@types/node@latest": + version "18.14.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.14.0.tgz#94c47b9217bbac49d4a67a967fdcdeed89ebb7d0" + integrity sha512-5EWrvLmglK+imbCJY0+INViFWUHg1AHel1sq4ZVSfdcNqGy9Edv3UB9IIzzg+xPaUcAgZYcfVs2fBcwDeZzU0A== + +mustache@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/mustache/-/mustache-4.2.0.tgz#e5892324d60a12ec9c2a73359edca52972bf6f64" + integrity sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ== + +typescript@^4.7.4: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== diff --git a/flutter-preview/flutter-preview-template/template-type-map-seed/enums/enums.seed.ts b/flutter-preview/flutter-preview-template/template-type-map-seed/enums/enums.seed.ts new file mode 100644 index 0000000..e6222ab --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-type-map-seed/enums/enums.seed.ts @@ -0,0 +1,137 @@ +import fs from "fs"; +import path from "path"; + +const out = "flutter_enums_ext.dart"; + +/** + * These are the enums that are present on api.flutter.dev but not actually available in the flutter sdk. + */ +const blacklist = [ + "widgets/ContextMenuButtonType", + "widgets/PanAxis", + "widgets/ScrollDecelerationRate", + "widgets/SnapshotMode", + "widgets/WidgetInspectorServiceExtensions", + "widgets/WidgetsServiceExtensions", + "foundation/FoundationServiceExtensions", + "cupertino/CupertinoListSectionType", + "semantics/Assertiveness", + "rendering/RenderingServiceExtensions", + "rendering/SelectionExtendDirection", + "rendering/TextGranularity", + "scheduler/SchedulerServiceExtensions", + "services/ServicesServiceExtensions", + "dart-ui/DartPerformanceMode", +]; + +const template_flutter_enum_from_string = (enums: Array) => ` +T? flutterEnumFromString(String value) { +${enums + .map( + (n) => ` +if (T == ${n}) { + return value.parse${n}() as T; +} +` + ) + .join("\n")} + + return null as T; +} +`; + +const template_is_flutter_enum = (enums: Array) => ` +bool isFlutterEmum(Type type) { + return ${enums.map((n) => `type == ${n}`).join(" ||\n")}; +} +`; + +const template_ext = (name: string) => ` +${name} parse${name}(){ + return ${name}.values + .firstWhere((e) => e.toString() == '${name}.' + this); +} +`; + +const template = ({ + flutterEnumFromString, + isFlutterEnum, + exts, +}: { + flutterEnumFromString: string; + isFlutterEnum: string; + exts: Array; +}) => `// ignore_for_file: uri_does_not_exist,undefined_class,undefined_identifier,type_test_with_undefined_name + +/// +/// This file is generated by template-type-map-seed/enums/enums.seed.ts +/// Do not edit manually. +/// + +import 'package:flutter/animation.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/painting.dart'; +import 'package:flutter/physics.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:flutter/semantics.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; +import 'dart:ui'; +// import 'dart:wasm'; +import 'dart:async'; +import 'dart:collection'; +import 'dart:convert'; +import 'dart:core'; +import 'dart:developer'; +import 'dart:math'; +import 'dart:typed_data'; +// import 'dart:ffi'; +import 'dart:io'; +import 'dart:isolate'; +import 'dart:html'; +import 'dart:js'; +import 'dart:js_util'; + + +${flutterEnumFromString} + +${isFlutterEnum} + +extension StringExtensionForEnums on String { +${exts.map((ext) => ext.split("\n").join("\n ")).join("\n")} +} +`; + +function main() { + const enum_meta = require("../../../../flutter-docs/enums/enums.json"); + + const metas = enum_meta.filter(({ id }) => !blacklist.includes(id)); + + const exts = metas.map(({ name, values }) => { + return template_ext(name); + }); + + const is_flutter_enum = template_is_flutter_enum( + metas.map(({ name }) => name) + ); + + const flutter_enum_from_string = template_flutter_enum_from_string( + metas.map(({ name }) => name) + ); + + const output = template({ + flutterEnumFromString: flutter_enum_from_string, + isFlutterEnum: is_flutter_enum, + exts: exts, + }); + + fs.writeFileSync(path.join(__dirname, out), output, { + encoding: "utf-8", + }); +} + +main(); diff --git a/flutter-preview/flutter-preview-template/template-type-map-seed/enums/flutter_enums_ext.dart b/flutter-preview/flutter-preview-template/template-type-map-seed/enums/flutter_enums_ext.dart new file mode 100644 index 0000000..815f83a --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-type-map-seed/enums/flutter_enums_ext.dart @@ -0,0 +1,1922 @@ +// ignore_for_file: uri_does_not_exist,undefined_class,undefined_identifier,type_test_with_undefined_name + +/// +/// This file is generated by template-type-map-seed/enums/enums.seed.ts +/// Do not edit manually. +/// + +import 'package:flutter/animation.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/painting.dart'; +import 'package:flutter/physics.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:flutter/semantics.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; +import 'dart:ui'; +// import 'dart:wasm'; +import 'dart:async'; +import 'dart:collection'; +import 'dart:convert'; +import 'dart:core'; +import 'dart:developer'; +import 'dart:math'; +import 'dart:typed_data'; +// import 'dart:ffi'; +import 'dart:io'; +import 'dart:isolate'; +import 'dart:html'; +import 'dart:js'; +import 'dart:js_util'; + + + +T? flutterEnumFromString(String value) { + +if (T == AnimationBehavior) { + return value.parseAnimationBehavior() as T; +} + + +if (T == AnimationStatus) { + return value.parseAnimationStatus() as T; +} + + +if (T == AndroidOverscrollIndicator) { + return value.parseAndroidOverscrollIndicator() as T; +} + + +if (T == AppLifecycleState) { + return value.parseAppLifecycleState() as T; +} + + +if (T == AutofillContextAction) { + return value.parseAutofillContextAction() as T; +} + + +if (T == AutovalidateMode) { + return value.parseAutovalidateMode() as T; +} + + +if (T == Axis) { + return value.parseAxis() as T; +} + + +if (T == AxisDirection) { + return value.parseAxisDirection() as T; +} + + +if (T == BannerLocation) { + return value.parseBannerLocation() as T; +} + + +if (T == BlendMode) { + return value.parseBlendMode() as T; +} + + +if (T == BlurStyle) { + return value.parseBlurStyle() as T; +} + + +if (T == BorderStyle) { + return value.parseBorderStyle() as T; +} + + +if (T == BoxFit) { + return value.parseBoxFit() as T; +} + + +if (T == BoxShape) { + return value.parseBoxShape() as T; +} + + +if (T == Brightness) { + return value.parseBrightness() as T; +} + + +if (T == Clip) { + return value.parseClip() as T; +} + + +if (T == ClipboardStatus) { + return value.parseClipboardStatus() as T; +} + + +if (T == ConnectionState) { + return value.parseConnectionState() as T; +} + + +if (T == CrossAxisAlignment) { + return value.parseCrossAxisAlignment() as T; +} + + +if (T == CrossFadeState) { + return value.parseCrossFadeState() as T; +} + + +if (T == CupertinoDatePickerMode) { + return value.parseCupertinoDatePickerMode() as T; +} + + +if (T == CupertinoTimerPickerMode) { + return value.parseCupertinoTimerPickerMode() as T; +} + + +if (T == CupertinoUserInterfaceLevelData) { + return value.parseCupertinoUserInterfaceLevelData() as T; +} + + +if (T == DatePickerDateOrder) { + return value.parseDatePickerDateOrder() as T; +} + + +if (T == DatePickerDateTimeOrder) { + return value.parseDatePickerDateTimeOrder() as T; +} + + +if (T == DecorationPosition) { + return value.parseDecorationPosition() as T; +} + + +if (T == DiagnosticLevel) { + return value.parseDiagnosticLevel() as T; +} + + +if (T == DismissDirection) { + return value.parseDismissDirection() as T; +} + + +if (T == FilterQuality) { + return value.parseFilterQuality() as T; +} + + +if (T == FlexFit) { + return value.parseFlexFit() as T; +} + + +if (T == FlutterLogoStyle) { + return value.parseFlutterLogoStyle() as T; +} + + +if (T == FocusHighlightMode) { + return value.parseFocusHighlightMode() as T; +} + + +if (T == FocusHighlightStrategy) { + return value.parseFocusHighlightStrategy() as T; +} + + +if (T == FontStyle) { + return value.parseFontStyle() as T; +} + + +if (T == GrowthDirection) { + return value.parseGrowthDirection() as T; +} + + +if (T == HeroFlightDirection) { + return value.parseHeroFlightDirection() as T; +} + + +if (T == HitTestBehavior) { + return value.parseHitTestBehavior() as T; +} + + +if (T == ImageRepeat) { + return value.parseImageRepeat() as T; +} + + +if (T == KeyEventResult) { + return value.parseKeyEventResult() as T; +} + + +if (T == MainAxisAlignment) { + return value.parseMainAxisAlignment() as T; +} + + +if (T == MainAxisSize) { + return value.parseMainAxisSize() as T; +} + + +if (T == NavigationMode) { + return value.parseNavigationMode() as T; +} + + +if (T == Orientation) { + return value.parseOrientation() as T; +} + + +if (T == OverflowBarAlignment) { + return value.parseOverflowBarAlignment() as T; +} + + +if (T == OverlayVisibilityMode) { + return value.parseOverlayVisibilityMode() as T; +} + + +if (T == PaintingStyle) { + return value.parsePaintingStyle() as T; +} + + +if (T == PathFillType) { + return value.parsePathFillType() as T; +} + + +if (T == PathOperation) { + return value.parsePathOperation() as T; +} + + +if (T == PlaceholderAlignment) { + return value.parsePlaceholderAlignment() as T; +} + + +if (T == PlatformProvidedMenuItemType) { + return value.parsePlatformProvidedMenuItemType() as T; +} + + +if (T == RefreshIndicatorMode) { + return value.parseRefreshIndicatorMode() as T; +} + + +if (T == RenderComparison) { + return value.parseRenderComparison() as T; +} + + +if (T == RouteInformationReportingType) { + return value.parseRouteInformationReportingType() as T; +} + + +if (T == RoutePopDisposition) { + return value.parseRoutePopDisposition() as T; +} + + +if (T == ScrollbarOrientation) { + return value.parseScrollbarOrientation() as T; +} + + +if (T == ScrollIncrementType) { + return value.parseScrollIncrementType() as T; +} + + +if (T == ScrollPositionAlignmentPolicy) { + return value.parseScrollPositionAlignmentPolicy() as T; +} + + +if (T == ScrollViewKeyboardDismissBehavior) { + return value.parseScrollViewKeyboardDismissBehavior() as T; +} + + +if (T == SelectionChangedCause) { + return value.parseSelectionChangedCause() as T; +} + + +if (T == SmartDashesType) { + return value.parseSmartDashesType() as T; +} + + +if (T == SmartQuotesType) { + return value.parseSmartQuotesType() as T; +} + + +if (T == StackFit) { + return value.parseStackFit() as T; +} + + +if (T == StrokeCap) { + return value.parseStrokeCap() as T; +} + + +if (T == StrokeJoin) { + return value.parseStrokeJoin() as T; +} + + +if (T == TableCellVerticalAlignment) { + return value.parseTableCellVerticalAlignment() as T; +} + + +if (T == TargetPlatform) { + return value.parseTargetPlatform() as T; +} + + +if (T == TextAffinity) { + return value.parseTextAffinity() as T; +} + + +if (T == TextAlign) { + return value.parseTextAlign() as T; +} + + +if (T == TextBaseline) { + return value.parseTextBaseline() as T; +} + + +if (T == TextCapitalization) { + return value.parseTextCapitalization() as T; +} + + +if (T == TextDecorationStyle) { + return value.parseTextDecorationStyle() as T; +} + + +if (T == TextDirection) { + return value.parseTextDirection() as T; +} + + +if (T == TextInputAction) { + return value.parseTextInputAction() as T; +} + + +if (T == TextLeadingDistribution) { + return value.parseTextLeadingDistribution() as T; +} + + +if (T == TextOverflow) { + return value.parseTextOverflow() as T; +} + + +if (T == TextSelectionHandleType) { + return value.parseTextSelectionHandleType() as T; +} + + +if (T == TextWidthBasis) { + return value.parseTextWidthBasis() as T; +} + + +if (T == TileMode) { + return value.parseTileMode() as T; +} + + +if (T == TraversalDirection) { + return value.parseTraversalDirection() as T; +} + + +if (T == UnfocusDisposition) { + return value.parseUnfocusDisposition() as T; +} + + +if (T == VertexMode) { + return value.parseVertexMode() as T; +} + + +if (T == VerticalDirection) { + return value.parseVerticalDirection() as T; +} + + +if (T == WrapAlignment) { + return value.parseWrapAlignment() as T; +} + + +if (T == WrapCrossAlignment) { + return value.parseWrapCrossAlignment() as T; +} + + +if (T == DiagnosticsTreeStyle) { + return value.parseDiagnosticsTreeStyle() as T; +} + + +if (T == DragStartBehavior) { + return value.parseDragStartBehavior() as T; +} + + +if (T == GestureDisposition) { + return value.parseGestureDisposition() as T; +} + + +if (T == GestureRecognizerState) { + return value.parseGestureRecognizerState() as T; +} + + +if (T == PointerDeviceKind) { + return value.parsePointerDeviceKind() as T; +} + + +if (T == BottomNavigationBarLandscapeLayout) { + return value.parseBottomNavigationBarLandscapeLayout() as T; +} + + +if (T == BottomNavigationBarType) { + return value.parseBottomNavigationBarType() as T; +} + + +if (T == ButtonBarLayoutBehavior) { + return value.parseButtonBarLayoutBehavior() as T; +} + + +if (T == ButtonTextTheme) { + return value.parseButtonTextTheme() as T; +} + + +if (T == CollapseMode) { + return value.parseCollapseMode() as T; +} + + +if (T == DatePickerEntryMode) { + return value.parseDatePickerEntryMode() as T; +} + + +if (T == DatePickerMode) { + return value.parseDatePickerMode() as T; +} + + +if (T == DayPeriod) { + return value.parseDayPeriod() as T; +} + + +if (T == DrawerAlignment) { + return value.parseDrawerAlignment() as T; +} + + +if (T == FloatingLabelBehavior) { + return value.parseFloatingLabelBehavior() as T; +} + + +if (T == HourFormat) { + return value.parseHourFormat() as T; +} + + +if (T == ListTileControlAffinity) { + return value.parseListTileControlAffinity() as T; +} + + +if (T == ListTileStyle) { + return value.parseListTileStyle() as T; +} + + +if (T == MaterialBannerClosedReason) { + return value.parseMaterialBannerClosedReason() as T; +} + + +if (T == MaterialState) { + return value.parseMaterialState() as T; +} + + +if (T == MaterialTapTargetSize) { + return value.parseMaterialTapTargetSize() as T; +} + + +if (T == MaterialType) { + return value.parseMaterialType() as T; +} + + +if (T == NavigationDestinationLabelBehavior) { + return value.parseNavigationDestinationLabelBehavior() as T; +} + + +if (T == NavigationRailLabelType) { + return value.parseNavigationRailLabelType() as T; +} + + +if (T == PopupMenuPosition) { + return value.parsePopupMenuPosition() as T; +} + + +if (T == RefreshIndicatorTriggerMode) { + return value.parseRefreshIndicatorTriggerMode() as T; +} + + +if (T == ScriptCategory) { + return value.parseScriptCategory() as T; +} + + +if (T == ShowValueIndicator) { + return value.parseShowValueIndicator() as T; +} + + +if (T == SnackBarBehavior) { + return value.parseSnackBarBehavior() as T; +} + + +if (T == SnackBarClosedReason) { + return value.parseSnackBarClosedReason() as T; +} + + +if (T == StepperType) { + return value.parseStepperType() as T; +} + + +if (T == StepState) { + return value.parseStepState() as T; +} + + +if (T == StretchMode) { + return value.parseStretchMode() as T; +} + + +if (T == TabBarIndicatorSize) { + return value.parseTabBarIndicatorSize() as T; +} + + +if (T == ThemeMode) { + return value.parseThemeMode() as T; +} + + +if (T == Thumb) { + return value.parseThumb() as T; +} + + +if (T == TimeOfDayFormat) { + return value.parseTimeOfDayFormat() as T; +} + + +if (T == TimePickerEntryMode) { + return value.parseTimePickerEntryMode() as T; +} + + +if (T == TooltipTriggerMode) { + return value.parseTooltipTriggerMode() as T; +} + + +if (T == SpringType) { + return value.parseSpringType() as T; +} + + +if (T == CacheExtentStyle) { + return value.parseCacheExtentStyle() as T; +} + + +if (T == DebugSemanticsDumpOrder) { + return value.parseDebugSemanticsDumpOrder() as T; +} + + +if (T == PerformanceOverlayOption) { + return value.parsePerformanceOverlayOption() as T; +} + + +if (T == PlatformViewHitTestBehavior) { + return value.parsePlatformViewHitTestBehavior() as T; +} + + +if (T == RenderAnimatedSizeState) { + return value.parseRenderAnimatedSizeState() as T; +} + + +if (T == ScrollDirection) { + return value.parseScrollDirection() as T; +} + + +if (T == SelectionEventType) { + return value.parseSelectionEventType() as T; +} + + +if (T == SelectionResult) { + return value.parseSelectionResult() as T; +} + + +if (T == SelectionStatus) { + return value.parseSelectionStatus() as T; +} + + +if (T == SchedulerPhase) { + return value.parseSchedulerPhase() as T; +} + + +if (T == DeviceOrientation) { + return value.parseDeviceOrientation() as T; +} + + +if (T == FloatingCursorDragState) { + return value.parseFloatingCursorDragState() as T; +} + + +if (T == KeyboardSide) { + return value.parseKeyboardSide() as T; +} + + +if (T == KeyDataTransitMode) { + return value.parseKeyDataTransitMode() as T; +} + + +if (T == MaxLengthEnforcement) { + return value.parseMaxLengthEnforcement() as T; +} + + +if (T == ModifierKey) { + return value.parseModifierKey() as T; +} + + +if (T == SystemSoundType) { + return value.parseSystemSoundType() as T; +} + + +if (T == SystemUiMode) { + return value.parseSystemUiMode() as T; +} + + +if (T == SystemUiOverlay) { + return value.parseSystemUiOverlay() as T; +} + + +if (T == BoxHeightStyle) { + return value.parseBoxHeightStyle() as T; +} + + +if (T == BoxWidthStyle) { + return value.parseBoxWidthStyle() as T; +} + + +if (T == ClipOp) { + return value.parseClipOp() as T; +} + + +if (T == DisplayFeatureState) { + return value.parseDisplayFeatureState() as T; +} + + +if (T == DisplayFeatureType) { + return value.parseDisplayFeatureType() as T; +} + + +if (T == FramePhase) { + return value.parseFramePhase() as T; +} + + +if (T == ImageByteFormat) { + return value.parseImageByteFormat() as T; +} + + +if (T == KeyEventType) { + return value.parseKeyEventType() as T; +} + + +if (T == PixelFormat) { + return value.parsePixelFormat() as T; +} + + +if (T == PointerChange) { + return value.parsePointerChange() as T; +} + + +if (T == PointerSignalKind) { + return value.parsePointerSignalKind() as T; +} + + +if (T == PointMode) { + return value.parsePointMode() as T; +} + + +if (T == HttpClientResponseCompressionState) { + return value.parseHttpClientResponseCompressionState() as T; +} + + + return null as T; +} + + + +bool isFlutterEmum(Type type) { + return type == AnimationBehavior || +type == AnimationStatus || +type == AndroidOverscrollIndicator || +type == AppLifecycleState || +type == AutofillContextAction || +type == AutovalidateMode || +type == Axis || +type == AxisDirection || +type == BannerLocation || +type == BlendMode || +type == BlurStyle || +type == BorderStyle || +type == BoxFit || +type == BoxShape || +type == Brightness || +type == Clip || +type == ClipboardStatus || +type == ConnectionState || +type == CrossAxisAlignment || +type == CrossFadeState || +type == CupertinoDatePickerMode || +type == CupertinoTimerPickerMode || +type == CupertinoUserInterfaceLevelData || +type == DatePickerDateOrder || +type == DatePickerDateTimeOrder || +type == DecorationPosition || +type == DiagnosticLevel || +type == DismissDirection || +type == FilterQuality || +type == FlexFit || +type == FlutterLogoStyle || +type == FocusHighlightMode || +type == FocusHighlightStrategy || +type == FontStyle || +type == GrowthDirection || +type == HeroFlightDirection || +type == HitTestBehavior || +type == ImageRepeat || +type == KeyEventResult || +type == MainAxisAlignment || +type == MainAxisSize || +type == NavigationMode || +type == Orientation || +type == OverflowBarAlignment || +type == OverlayVisibilityMode || +type == PaintingStyle || +type == PathFillType || +type == PathOperation || +type == PlaceholderAlignment || +type == PlatformProvidedMenuItemType || +type == RefreshIndicatorMode || +type == RenderComparison || +type == RouteInformationReportingType || +type == RoutePopDisposition || +type == ScrollbarOrientation || +type == ScrollIncrementType || +type == ScrollPositionAlignmentPolicy || +type == ScrollViewKeyboardDismissBehavior || +type == SelectionChangedCause || +type == SmartDashesType || +type == SmartQuotesType || +type == StackFit || +type == StrokeCap || +type == StrokeJoin || +type == TableCellVerticalAlignment || +type == TargetPlatform || +type == TextAffinity || +type == TextAlign || +type == TextBaseline || +type == TextCapitalization || +type == TextDecorationStyle || +type == TextDirection || +type == TextInputAction || +type == TextLeadingDistribution || +type == TextOverflow || +type == TextSelectionHandleType || +type == TextWidthBasis || +type == TileMode || +type == TraversalDirection || +type == UnfocusDisposition || +type == VertexMode || +type == VerticalDirection || +type == WrapAlignment || +type == WrapCrossAlignment || +type == DiagnosticsTreeStyle || +type == DragStartBehavior || +type == GestureDisposition || +type == GestureRecognizerState || +type == PointerDeviceKind || +type == BottomNavigationBarLandscapeLayout || +type == BottomNavigationBarType || +type == ButtonBarLayoutBehavior || +type == ButtonTextTheme || +type == CollapseMode || +type == DatePickerEntryMode || +type == DatePickerMode || +type == DayPeriod || +type == DrawerAlignment || +type == FloatingLabelBehavior || +type == HourFormat || +type == ListTileControlAffinity || +type == ListTileStyle || +type == MaterialBannerClosedReason || +type == MaterialState || +type == MaterialTapTargetSize || +type == MaterialType || +type == NavigationDestinationLabelBehavior || +type == NavigationRailLabelType || +type == PopupMenuPosition || +type == RefreshIndicatorTriggerMode || +type == ScriptCategory || +type == ShowValueIndicator || +type == SnackBarBehavior || +type == SnackBarClosedReason || +type == StepperType || +type == StepState || +type == StretchMode || +type == TabBarIndicatorSize || +type == ThemeMode || +type == Thumb || +type == TimeOfDayFormat || +type == TimePickerEntryMode || +type == TooltipTriggerMode || +type == SpringType || +type == CacheExtentStyle || +type == DebugSemanticsDumpOrder || +type == PerformanceOverlayOption || +type == PlatformViewHitTestBehavior || +type == RenderAnimatedSizeState || +type == ScrollDirection || +type == SelectionEventType || +type == SelectionResult || +type == SelectionStatus || +type == SchedulerPhase || +type == DeviceOrientation || +type == FloatingCursorDragState || +type == KeyboardSide || +type == KeyDataTransitMode || +type == MaxLengthEnforcement || +type == ModifierKey || +type == SystemSoundType || +type == SystemUiMode || +type == SystemUiOverlay || +type == BoxHeightStyle || +type == BoxWidthStyle || +type == ClipOp || +type == DisplayFeatureState || +type == DisplayFeatureType || +type == FramePhase || +type == ImageByteFormat || +type == KeyEventType || +type == PixelFormat || +type == PointerChange || +type == PointerSignalKind || +type == PointMode || +type == HttpClientResponseCompressionState; +} + + +extension StringExtensionForEnums on String { + + AnimationBehavior parseAnimationBehavior(){ + return AnimationBehavior.values + .firstWhere((e) => e.toString() == 'AnimationBehavior.' + this); + } + + + AnimationStatus parseAnimationStatus(){ + return AnimationStatus.values + .firstWhere((e) => e.toString() == 'AnimationStatus.' + this); + } + + + AndroidOverscrollIndicator parseAndroidOverscrollIndicator(){ + return AndroidOverscrollIndicator.values + .firstWhere((e) => e.toString() == 'AndroidOverscrollIndicator.' + this); + } + + + AppLifecycleState parseAppLifecycleState(){ + return AppLifecycleState.values + .firstWhere((e) => e.toString() == 'AppLifecycleState.' + this); + } + + + AutofillContextAction parseAutofillContextAction(){ + return AutofillContextAction.values + .firstWhere((e) => e.toString() == 'AutofillContextAction.' + this); + } + + + AutovalidateMode parseAutovalidateMode(){ + return AutovalidateMode.values + .firstWhere((e) => e.toString() == 'AutovalidateMode.' + this); + } + + + Axis parseAxis(){ + return Axis.values + .firstWhere((e) => e.toString() == 'Axis.' + this); + } + + + AxisDirection parseAxisDirection(){ + return AxisDirection.values + .firstWhere((e) => e.toString() == 'AxisDirection.' + this); + } + + + BannerLocation parseBannerLocation(){ + return BannerLocation.values + .firstWhere((e) => e.toString() == 'BannerLocation.' + this); + } + + + BlendMode parseBlendMode(){ + return BlendMode.values + .firstWhere((e) => e.toString() == 'BlendMode.' + this); + } + + + BlurStyle parseBlurStyle(){ + return BlurStyle.values + .firstWhere((e) => e.toString() == 'BlurStyle.' + this); + } + + + BorderStyle parseBorderStyle(){ + return BorderStyle.values + .firstWhere((e) => e.toString() == 'BorderStyle.' + this); + } + + + BoxFit parseBoxFit(){ + return BoxFit.values + .firstWhere((e) => e.toString() == 'BoxFit.' + this); + } + + + BoxShape parseBoxShape(){ + return BoxShape.values + .firstWhere((e) => e.toString() == 'BoxShape.' + this); + } + + + Brightness parseBrightness(){ + return Brightness.values + .firstWhere((e) => e.toString() == 'Brightness.' + this); + } + + + Clip parseClip(){ + return Clip.values + .firstWhere((e) => e.toString() == 'Clip.' + this); + } + + + ClipboardStatus parseClipboardStatus(){ + return ClipboardStatus.values + .firstWhere((e) => e.toString() == 'ClipboardStatus.' + this); + } + + + ConnectionState parseConnectionState(){ + return ConnectionState.values + .firstWhere((e) => e.toString() == 'ConnectionState.' + this); + } + + + CrossAxisAlignment parseCrossAxisAlignment(){ + return CrossAxisAlignment.values + .firstWhere((e) => e.toString() == 'CrossAxisAlignment.' + this); + } + + + CrossFadeState parseCrossFadeState(){ + return CrossFadeState.values + .firstWhere((e) => e.toString() == 'CrossFadeState.' + this); + } + + + CupertinoDatePickerMode parseCupertinoDatePickerMode(){ + return CupertinoDatePickerMode.values + .firstWhere((e) => e.toString() == 'CupertinoDatePickerMode.' + this); + } + + + CupertinoTimerPickerMode parseCupertinoTimerPickerMode(){ + return CupertinoTimerPickerMode.values + .firstWhere((e) => e.toString() == 'CupertinoTimerPickerMode.' + this); + } + + + CupertinoUserInterfaceLevelData parseCupertinoUserInterfaceLevelData(){ + return CupertinoUserInterfaceLevelData.values + .firstWhere((e) => e.toString() == 'CupertinoUserInterfaceLevelData.' + this); + } + + + DatePickerDateOrder parseDatePickerDateOrder(){ + return DatePickerDateOrder.values + .firstWhere((e) => e.toString() == 'DatePickerDateOrder.' + this); + } + + + DatePickerDateTimeOrder parseDatePickerDateTimeOrder(){ + return DatePickerDateTimeOrder.values + .firstWhere((e) => e.toString() == 'DatePickerDateTimeOrder.' + this); + } + + + DecorationPosition parseDecorationPosition(){ + return DecorationPosition.values + .firstWhere((e) => e.toString() == 'DecorationPosition.' + this); + } + + + DiagnosticLevel parseDiagnosticLevel(){ + return DiagnosticLevel.values + .firstWhere((e) => e.toString() == 'DiagnosticLevel.' + this); + } + + + DismissDirection parseDismissDirection(){ + return DismissDirection.values + .firstWhere((e) => e.toString() == 'DismissDirection.' + this); + } + + + FilterQuality parseFilterQuality(){ + return FilterQuality.values + .firstWhere((e) => e.toString() == 'FilterQuality.' + this); + } + + + FlexFit parseFlexFit(){ + return FlexFit.values + .firstWhere((e) => e.toString() == 'FlexFit.' + this); + } + + + FlutterLogoStyle parseFlutterLogoStyle(){ + return FlutterLogoStyle.values + .firstWhere((e) => e.toString() == 'FlutterLogoStyle.' + this); + } + + + FocusHighlightMode parseFocusHighlightMode(){ + return FocusHighlightMode.values + .firstWhere((e) => e.toString() == 'FocusHighlightMode.' + this); + } + + + FocusHighlightStrategy parseFocusHighlightStrategy(){ + return FocusHighlightStrategy.values + .firstWhere((e) => e.toString() == 'FocusHighlightStrategy.' + this); + } + + + FontStyle parseFontStyle(){ + return FontStyle.values + .firstWhere((e) => e.toString() == 'FontStyle.' + this); + } + + + GrowthDirection parseGrowthDirection(){ + return GrowthDirection.values + .firstWhere((e) => e.toString() == 'GrowthDirection.' + this); + } + + + HeroFlightDirection parseHeroFlightDirection(){ + return HeroFlightDirection.values + .firstWhere((e) => e.toString() == 'HeroFlightDirection.' + this); + } + + + HitTestBehavior parseHitTestBehavior(){ + return HitTestBehavior.values + .firstWhere((e) => e.toString() == 'HitTestBehavior.' + this); + } + + + ImageRepeat parseImageRepeat(){ + return ImageRepeat.values + .firstWhere((e) => e.toString() == 'ImageRepeat.' + this); + } + + + KeyEventResult parseKeyEventResult(){ + return KeyEventResult.values + .firstWhere((e) => e.toString() == 'KeyEventResult.' + this); + } + + + MainAxisAlignment parseMainAxisAlignment(){ + return MainAxisAlignment.values + .firstWhere((e) => e.toString() == 'MainAxisAlignment.' + this); + } + + + MainAxisSize parseMainAxisSize(){ + return MainAxisSize.values + .firstWhere((e) => e.toString() == 'MainAxisSize.' + this); + } + + + NavigationMode parseNavigationMode(){ + return NavigationMode.values + .firstWhere((e) => e.toString() == 'NavigationMode.' + this); + } + + + Orientation parseOrientation(){ + return Orientation.values + .firstWhere((e) => e.toString() == 'Orientation.' + this); + } + + + OverflowBarAlignment parseOverflowBarAlignment(){ + return OverflowBarAlignment.values + .firstWhere((e) => e.toString() == 'OverflowBarAlignment.' + this); + } + + + OverlayVisibilityMode parseOverlayVisibilityMode(){ + return OverlayVisibilityMode.values + .firstWhere((e) => e.toString() == 'OverlayVisibilityMode.' + this); + } + + + PaintingStyle parsePaintingStyle(){ + return PaintingStyle.values + .firstWhere((e) => e.toString() == 'PaintingStyle.' + this); + } + + + PathFillType parsePathFillType(){ + return PathFillType.values + .firstWhere((e) => e.toString() == 'PathFillType.' + this); + } + + + PathOperation parsePathOperation(){ + return PathOperation.values + .firstWhere((e) => e.toString() == 'PathOperation.' + this); + } + + + PlaceholderAlignment parsePlaceholderAlignment(){ + return PlaceholderAlignment.values + .firstWhere((e) => e.toString() == 'PlaceholderAlignment.' + this); + } + + + PlatformProvidedMenuItemType parsePlatformProvidedMenuItemType(){ + return PlatformProvidedMenuItemType.values + .firstWhere((e) => e.toString() == 'PlatformProvidedMenuItemType.' + this); + } + + + RefreshIndicatorMode parseRefreshIndicatorMode(){ + return RefreshIndicatorMode.values + .firstWhere((e) => e.toString() == 'RefreshIndicatorMode.' + this); + } + + + RenderComparison parseRenderComparison(){ + return RenderComparison.values + .firstWhere((e) => e.toString() == 'RenderComparison.' + this); + } + + + RouteInformationReportingType parseRouteInformationReportingType(){ + return RouteInformationReportingType.values + .firstWhere((e) => e.toString() == 'RouteInformationReportingType.' + this); + } + + + RoutePopDisposition parseRoutePopDisposition(){ + return RoutePopDisposition.values + .firstWhere((e) => e.toString() == 'RoutePopDisposition.' + this); + } + + + ScrollbarOrientation parseScrollbarOrientation(){ + return ScrollbarOrientation.values + .firstWhere((e) => e.toString() == 'ScrollbarOrientation.' + this); + } + + + ScrollIncrementType parseScrollIncrementType(){ + return ScrollIncrementType.values + .firstWhere((e) => e.toString() == 'ScrollIncrementType.' + this); + } + + + ScrollPositionAlignmentPolicy parseScrollPositionAlignmentPolicy(){ + return ScrollPositionAlignmentPolicy.values + .firstWhere((e) => e.toString() == 'ScrollPositionAlignmentPolicy.' + this); + } + + + ScrollViewKeyboardDismissBehavior parseScrollViewKeyboardDismissBehavior(){ + return ScrollViewKeyboardDismissBehavior.values + .firstWhere((e) => e.toString() == 'ScrollViewKeyboardDismissBehavior.' + this); + } + + + SelectionChangedCause parseSelectionChangedCause(){ + return SelectionChangedCause.values + .firstWhere((e) => e.toString() == 'SelectionChangedCause.' + this); + } + + + SmartDashesType parseSmartDashesType(){ + return SmartDashesType.values + .firstWhere((e) => e.toString() == 'SmartDashesType.' + this); + } + + + SmartQuotesType parseSmartQuotesType(){ + return SmartQuotesType.values + .firstWhere((e) => e.toString() == 'SmartQuotesType.' + this); + } + + + StackFit parseStackFit(){ + return StackFit.values + .firstWhere((e) => e.toString() == 'StackFit.' + this); + } + + + StrokeCap parseStrokeCap(){ + return StrokeCap.values + .firstWhere((e) => e.toString() == 'StrokeCap.' + this); + } + + + StrokeJoin parseStrokeJoin(){ + return StrokeJoin.values + .firstWhere((e) => e.toString() == 'StrokeJoin.' + this); + } + + + TableCellVerticalAlignment parseTableCellVerticalAlignment(){ + return TableCellVerticalAlignment.values + .firstWhere((e) => e.toString() == 'TableCellVerticalAlignment.' + this); + } + + + TargetPlatform parseTargetPlatform(){ + return TargetPlatform.values + .firstWhere((e) => e.toString() == 'TargetPlatform.' + this); + } + + + TextAffinity parseTextAffinity(){ + return TextAffinity.values + .firstWhere((e) => e.toString() == 'TextAffinity.' + this); + } + + + TextAlign parseTextAlign(){ + return TextAlign.values + .firstWhere((e) => e.toString() == 'TextAlign.' + this); + } + + + TextBaseline parseTextBaseline(){ + return TextBaseline.values + .firstWhere((e) => e.toString() == 'TextBaseline.' + this); + } + + + TextCapitalization parseTextCapitalization(){ + return TextCapitalization.values + .firstWhere((e) => e.toString() == 'TextCapitalization.' + this); + } + + + TextDecorationStyle parseTextDecorationStyle(){ + return TextDecorationStyle.values + .firstWhere((e) => e.toString() == 'TextDecorationStyle.' + this); + } + + + TextDirection parseTextDirection(){ + return TextDirection.values + .firstWhere((e) => e.toString() == 'TextDirection.' + this); + } + + + TextInputAction parseTextInputAction(){ + return TextInputAction.values + .firstWhere((e) => e.toString() == 'TextInputAction.' + this); + } + + + TextLeadingDistribution parseTextLeadingDistribution(){ + return TextLeadingDistribution.values + .firstWhere((e) => e.toString() == 'TextLeadingDistribution.' + this); + } + + + TextOverflow parseTextOverflow(){ + return TextOverflow.values + .firstWhere((e) => e.toString() == 'TextOverflow.' + this); + } + + + TextSelectionHandleType parseTextSelectionHandleType(){ + return TextSelectionHandleType.values + .firstWhere((e) => e.toString() == 'TextSelectionHandleType.' + this); + } + + + TextWidthBasis parseTextWidthBasis(){ + return TextWidthBasis.values + .firstWhere((e) => e.toString() == 'TextWidthBasis.' + this); + } + + + TileMode parseTileMode(){ + return TileMode.values + .firstWhere((e) => e.toString() == 'TileMode.' + this); + } + + + TraversalDirection parseTraversalDirection(){ + return TraversalDirection.values + .firstWhere((e) => e.toString() == 'TraversalDirection.' + this); + } + + + UnfocusDisposition parseUnfocusDisposition(){ + return UnfocusDisposition.values + .firstWhere((e) => e.toString() == 'UnfocusDisposition.' + this); + } + + + VertexMode parseVertexMode(){ + return VertexMode.values + .firstWhere((e) => e.toString() == 'VertexMode.' + this); + } + + + VerticalDirection parseVerticalDirection(){ + return VerticalDirection.values + .firstWhere((e) => e.toString() == 'VerticalDirection.' + this); + } + + + WrapAlignment parseWrapAlignment(){ + return WrapAlignment.values + .firstWhere((e) => e.toString() == 'WrapAlignment.' + this); + } + + + WrapCrossAlignment parseWrapCrossAlignment(){ + return WrapCrossAlignment.values + .firstWhere((e) => e.toString() == 'WrapCrossAlignment.' + this); + } + + + DiagnosticsTreeStyle parseDiagnosticsTreeStyle(){ + return DiagnosticsTreeStyle.values + .firstWhere((e) => e.toString() == 'DiagnosticsTreeStyle.' + this); + } + + + DragStartBehavior parseDragStartBehavior(){ + return DragStartBehavior.values + .firstWhere((e) => e.toString() == 'DragStartBehavior.' + this); + } + + + GestureDisposition parseGestureDisposition(){ + return GestureDisposition.values + .firstWhere((e) => e.toString() == 'GestureDisposition.' + this); + } + + + GestureRecognizerState parseGestureRecognizerState(){ + return GestureRecognizerState.values + .firstWhere((e) => e.toString() == 'GestureRecognizerState.' + this); + } + + + PointerDeviceKind parsePointerDeviceKind(){ + return PointerDeviceKind.values + .firstWhere((e) => e.toString() == 'PointerDeviceKind.' + this); + } + + + BottomNavigationBarLandscapeLayout parseBottomNavigationBarLandscapeLayout(){ + return BottomNavigationBarLandscapeLayout.values + .firstWhere((e) => e.toString() == 'BottomNavigationBarLandscapeLayout.' + this); + } + + + BottomNavigationBarType parseBottomNavigationBarType(){ + return BottomNavigationBarType.values + .firstWhere((e) => e.toString() == 'BottomNavigationBarType.' + this); + } + + + ButtonBarLayoutBehavior parseButtonBarLayoutBehavior(){ + return ButtonBarLayoutBehavior.values + .firstWhere((e) => e.toString() == 'ButtonBarLayoutBehavior.' + this); + } + + + ButtonTextTheme parseButtonTextTheme(){ + return ButtonTextTheme.values + .firstWhere((e) => e.toString() == 'ButtonTextTheme.' + this); + } + + + CollapseMode parseCollapseMode(){ + return CollapseMode.values + .firstWhere((e) => e.toString() == 'CollapseMode.' + this); + } + + + DatePickerEntryMode parseDatePickerEntryMode(){ + return DatePickerEntryMode.values + .firstWhere((e) => e.toString() == 'DatePickerEntryMode.' + this); + } + + + DatePickerMode parseDatePickerMode(){ + return DatePickerMode.values + .firstWhere((e) => e.toString() == 'DatePickerMode.' + this); + } + + + DayPeriod parseDayPeriod(){ + return DayPeriod.values + .firstWhere((e) => e.toString() == 'DayPeriod.' + this); + } + + + DrawerAlignment parseDrawerAlignment(){ + return DrawerAlignment.values + .firstWhere((e) => e.toString() == 'DrawerAlignment.' + this); + } + + + FloatingLabelBehavior parseFloatingLabelBehavior(){ + return FloatingLabelBehavior.values + .firstWhere((e) => e.toString() == 'FloatingLabelBehavior.' + this); + } + + + HourFormat parseHourFormat(){ + return HourFormat.values + .firstWhere((e) => e.toString() == 'HourFormat.' + this); + } + + + ListTileControlAffinity parseListTileControlAffinity(){ + return ListTileControlAffinity.values + .firstWhere((e) => e.toString() == 'ListTileControlAffinity.' + this); + } + + + ListTileStyle parseListTileStyle(){ + return ListTileStyle.values + .firstWhere((e) => e.toString() == 'ListTileStyle.' + this); + } + + + MaterialBannerClosedReason parseMaterialBannerClosedReason(){ + return MaterialBannerClosedReason.values + .firstWhere((e) => e.toString() == 'MaterialBannerClosedReason.' + this); + } + + + MaterialState parseMaterialState(){ + return MaterialState.values + .firstWhere((e) => e.toString() == 'MaterialState.' + this); + } + + + MaterialTapTargetSize parseMaterialTapTargetSize(){ + return MaterialTapTargetSize.values + .firstWhere((e) => e.toString() == 'MaterialTapTargetSize.' + this); + } + + + MaterialType parseMaterialType(){ + return MaterialType.values + .firstWhere((e) => e.toString() == 'MaterialType.' + this); + } + + + NavigationDestinationLabelBehavior parseNavigationDestinationLabelBehavior(){ + return NavigationDestinationLabelBehavior.values + .firstWhere((e) => e.toString() == 'NavigationDestinationLabelBehavior.' + this); + } + + + NavigationRailLabelType parseNavigationRailLabelType(){ + return NavigationRailLabelType.values + .firstWhere((e) => e.toString() == 'NavigationRailLabelType.' + this); + } + + + PopupMenuPosition parsePopupMenuPosition(){ + return PopupMenuPosition.values + .firstWhere((e) => e.toString() == 'PopupMenuPosition.' + this); + } + + + RefreshIndicatorTriggerMode parseRefreshIndicatorTriggerMode(){ + return RefreshIndicatorTriggerMode.values + .firstWhere((e) => e.toString() == 'RefreshIndicatorTriggerMode.' + this); + } + + + ScriptCategory parseScriptCategory(){ + return ScriptCategory.values + .firstWhere((e) => e.toString() == 'ScriptCategory.' + this); + } + + + ShowValueIndicator parseShowValueIndicator(){ + return ShowValueIndicator.values + .firstWhere((e) => e.toString() == 'ShowValueIndicator.' + this); + } + + + SnackBarBehavior parseSnackBarBehavior(){ + return SnackBarBehavior.values + .firstWhere((e) => e.toString() == 'SnackBarBehavior.' + this); + } + + + SnackBarClosedReason parseSnackBarClosedReason(){ + return SnackBarClosedReason.values + .firstWhere((e) => e.toString() == 'SnackBarClosedReason.' + this); + } + + + StepperType parseStepperType(){ + return StepperType.values + .firstWhere((e) => e.toString() == 'StepperType.' + this); + } + + + StepState parseStepState(){ + return StepState.values + .firstWhere((e) => e.toString() == 'StepState.' + this); + } + + + StretchMode parseStretchMode(){ + return StretchMode.values + .firstWhere((e) => e.toString() == 'StretchMode.' + this); + } + + + TabBarIndicatorSize parseTabBarIndicatorSize(){ + return TabBarIndicatorSize.values + .firstWhere((e) => e.toString() == 'TabBarIndicatorSize.' + this); + } + + + ThemeMode parseThemeMode(){ + return ThemeMode.values + .firstWhere((e) => e.toString() == 'ThemeMode.' + this); + } + + + Thumb parseThumb(){ + return Thumb.values + .firstWhere((e) => e.toString() == 'Thumb.' + this); + } + + + TimeOfDayFormat parseTimeOfDayFormat(){ + return TimeOfDayFormat.values + .firstWhere((e) => e.toString() == 'TimeOfDayFormat.' + this); + } + + + TimePickerEntryMode parseTimePickerEntryMode(){ + return TimePickerEntryMode.values + .firstWhere((e) => e.toString() == 'TimePickerEntryMode.' + this); + } + + + TooltipTriggerMode parseTooltipTriggerMode(){ + return TooltipTriggerMode.values + .firstWhere((e) => e.toString() == 'TooltipTriggerMode.' + this); + } + + + SpringType parseSpringType(){ + return SpringType.values + .firstWhere((e) => e.toString() == 'SpringType.' + this); + } + + + CacheExtentStyle parseCacheExtentStyle(){ + return CacheExtentStyle.values + .firstWhere((e) => e.toString() == 'CacheExtentStyle.' + this); + } + + + DebugSemanticsDumpOrder parseDebugSemanticsDumpOrder(){ + return DebugSemanticsDumpOrder.values + .firstWhere((e) => e.toString() == 'DebugSemanticsDumpOrder.' + this); + } + + + PerformanceOverlayOption parsePerformanceOverlayOption(){ + return PerformanceOverlayOption.values + .firstWhere((e) => e.toString() == 'PerformanceOverlayOption.' + this); + } + + + PlatformViewHitTestBehavior parsePlatformViewHitTestBehavior(){ + return PlatformViewHitTestBehavior.values + .firstWhere((e) => e.toString() == 'PlatformViewHitTestBehavior.' + this); + } + + + RenderAnimatedSizeState parseRenderAnimatedSizeState(){ + return RenderAnimatedSizeState.values + .firstWhere((e) => e.toString() == 'RenderAnimatedSizeState.' + this); + } + + + ScrollDirection parseScrollDirection(){ + return ScrollDirection.values + .firstWhere((e) => e.toString() == 'ScrollDirection.' + this); + } + + + SelectionEventType parseSelectionEventType(){ + return SelectionEventType.values + .firstWhere((e) => e.toString() == 'SelectionEventType.' + this); + } + + + SelectionResult parseSelectionResult(){ + return SelectionResult.values + .firstWhere((e) => e.toString() == 'SelectionResult.' + this); + } + + + SelectionStatus parseSelectionStatus(){ + return SelectionStatus.values + .firstWhere((e) => e.toString() == 'SelectionStatus.' + this); + } + + + SchedulerPhase parseSchedulerPhase(){ + return SchedulerPhase.values + .firstWhere((e) => e.toString() == 'SchedulerPhase.' + this); + } + + + DeviceOrientation parseDeviceOrientation(){ + return DeviceOrientation.values + .firstWhere((e) => e.toString() == 'DeviceOrientation.' + this); + } + + + FloatingCursorDragState parseFloatingCursorDragState(){ + return FloatingCursorDragState.values + .firstWhere((e) => e.toString() == 'FloatingCursorDragState.' + this); + } + + + KeyboardSide parseKeyboardSide(){ + return KeyboardSide.values + .firstWhere((e) => e.toString() == 'KeyboardSide.' + this); + } + + + KeyDataTransitMode parseKeyDataTransitMode(){ + return KeyDataTransitMode.values + .firstWhere((e) => e.toString() == 'KeyDataTransitMode.' + this); + } + + + MaxLengthEnforcement parseMaxLengthEnforcement(){ + return MaxLengthEnforcement.values + .firstWhere((e) => e.toString() == 'MaxLengthEnforcement.' + this); + } + + + ModifierKey parseModifierKey(){ + return ModifierKey.values + .firstWhere((e) => e.toString() == 'ModifierKey.' + this); + } + + + SystemSoundType parseSystemSoundType(){ + return SystemSoundType.values + .firstWhere((e) => e.toString() == 'SystemSoundType.' + this); + } + + + SystemUiMode parseSystemUiMode(){ + return SystemUiMode.values + .firstWhere((e) => e.toString() == 'SystemUiMode.' + this); + } + + + SystemUiOverlay parseSystemUiOverlay(){ + return SystemUiOverlay.values + .firstWhere((e) => e.toString() == 'SystemUiOverlay.' + this); + } + + + BoxHeightStyle parseBoxHeightStyle(){ + return BoxHeightStyle.values + .firstWhere((e) => e.toString() == 'BoxHeightStyle.' + this); + } + + + BoxWidthStyle parseBoxWidthStyle(){ + return BoxWidthStyle.values + .firstWhere((e) => e.toString() == 'BoxWidthStyle.' + this); + } + + + ClipOp parseClipOp(){ + return ClipOp.values + .firstWhere((e) => e.toString() == 'ClipOp.' + this); + } + + + DisplayFeatureState parseDisplayFeatureState(){ + return DisplayFeatureState.values + .firstWhere((e) => e.toString() == 'DisplayFeatureState.' + this); + } + + + DisplayFeatureType parseDisplayFeatureType(){ + return DisplayFeatureType.values + .firstWhere((e) => e.toString() == 'DisplayFeatureType.' + this); + } + + + FramePhase parseFramePhase(){ + return FramePhase.values + .firstWhere((e) => e.toString() == 'FramePhase.' + this); + } + + + ImageByteFormat parseImageByteFormat(){ + return ImageByteFormat.values + .firstWhere((e) => e.toString() == 'ImageByteFormat.' + this); + } + + + KeyEventType parseKeyEventType(){ + return KeyEventType.values + .firstWhere((e) => e.toString() == 'KeyEventType.' + this); + } + + + PixelFormat parsePixelFormat(){ + return PixelFormat.values + .firstWhere((e) => e.toString() == 'PixelFormat.' + this); + } + + + PointerChange parsePointerChange(){ + return PointerChange.values + .firstWhere((e) => e.toString() == 'PointerChange.' + this); + } + + + PointerSignalKind parsePointerSignalKind(){ + return PointerSignalKind.values + .firstWhere((e) => e.toString() == 'PointerSignalKind.' + this); + } + + + PointMode parsePointMode(){ + return PointMode.values + .firstWhere((e) => e.toString() == 'PointMode.' + this); + } + + + HttpClientResponseCompressionState parseHttpClientResponseCompressionState(){ + return HttpClientResponseCompressionState.values + .firstWhere((e) => e.toString() == 'HttpClientResponseCompressionState.' + this); + } + +} diff --git a/flutter-preview/flutter-preview-template/template-type-map-seed/index.ts b/flutter-preview/flutter-preview-template/template-type-map-seed/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/flutter-preview/flutter-preview-template/template-type-map-seed/package.json b/flutter-preview/flutter-preview-template/template-type-map-seed/package.json new file mode 100644 index 0000000..2431ea8 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-type-map-seed/package.json @@ -0,0 +1,9 @@ +{ + "name": "seeder", + "version": "0.0.0", + "devDependencies": { + "@types/node": "^18.14.0", + "ts-node": "^10.9.1", + "typescript": "^4.9.5" + } +} diff --git a/flutter-preview/flutter-preview-template/template-type-map-seed/yarn.lock b/flutter-preview/flutter-preview-template/template-type-map-seed/yarn.lock new file mode 100644 index 0000000..27957c8 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template-type-map-seed/yarn.lock @@ -0,0 +1,117 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== + +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" + integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== + +"@types/node@^18.14.0": + version "18.14.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.14.0.tgz#94c47b9217bbac49d4a67a967fdcdeed89ebb7d0" + integrity sha512-5EWrvLmglK+imbCJY0+INViFWUHg1AHel1sq4ZVSfdcNqGy9Edv3UB9IIzzg+xPaUcAgZYcfVs2fBcwDeZzU0A== + +acorn-walk@^8.1.1: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + +acorn@^8.4.1: + version "8.8.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +ts-node@^10.9.1: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + +typescript@^4.9.5: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== diff --git a/flutter-preview/flutter-preview-template/template_app/.gitignore b/flutter-preview/flutter-preview-template/template_app/.gitignore new file mode 100644 index 0000000..24476c5 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/flutter-preview/flutter-preview-template/template_app/.metadata b/flutter-preview/flutter-preview-template/template_app/.metadata new file mode 100644 index 0000000..32d8944 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/.metadata @@ -0,0 +1,30 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled. + +version: + revision: 135454af32477f815a7525073027a3ff9eff1bfd + channel: stable + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 135454af32477f815a7525073027a3ff9eff1bfd + base_revision: 135454af32477f815a7525073027a3ff9eff1bfd + - platform: web + create_revision: 135454af32477f815a7525073027a3ff9eff1bfd + base_revision: 135454af32477f815a7525073027a3ff9eff1bfd + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/flutter-preview/flutter-preview-template/template_app/README.md b/flutter-preview/flutter-preview-template/template_app/README.md new file mode 100644 index 0000000..657f5bd --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/README.md @@ -0,0 +1,16 @@ +# template_app + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/flutter-preview/flutter-preview-template/template_app/analysis_options.yaml b/flutter-preview/flutter-preview-template/template_app/analysis_options.yaml new file mode 100644 index 0000000..61b6c4d --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/analysis_options.yaml @@ -0,0 +1,29 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/initial_properties.dart b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/initial_properties.dart new file mode 100644 index 0000000..2d29b30 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/initial_properties.dart @@ -0,0 +1,15 @@ +import 'dart:ui'; +import 'package:flutter/widgets.dart'; +import 'package:flutter/material.dart'; + +Map FLUTTER_PREVIEW_TARGET_WIDGET_INITIAL_PROPERTIES = { + // start_flutter_preview_template:initial_properties + "name": "Flutter Preview", + "radius": 10, + "description": + "Flutter Preview is a tool that allows you to preview your Flutter app in the browser.", + "enabled": true, + "color": const Color(0xFF000000), + "alignment": 'start', + // end_flutter_preview_template:initial_properties +}; diff --git a/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/mappers/flutter_enums_ext.dart b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/mappers/flutter_enums_ext.dart new file mode 100644 index 0000000..6d1d716 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/mappers/flutter_enums_ext.dart @@ -0,0 +1,1595 @@ +/// +/// This file is generated by template-type-map-seed/enums/enums.seed.ts +/// Do not edit manually. +/// + +import 'package:flutter/animation.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/painting.dart'; +import 'package:flutter/physics.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:flutter/semantics.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; +import 'dart:ui'; +// import 'dart:wasm'; +import 'dart:async'; +import 'dart:collection'; +import 'dart:convert'; +import 'dart:core'; +import 'dart:developer'; +import 'dart:math'; +import 'dart:typed_data'; +// import 'dart:ffi'; +import 'dart:io'; +import 'dart:isolate'; +import 'dart:html'; +import 'dart:js'; +import 'dart:js_util'; + +T? flutterEnumFromString(String value) { + if (T == AnimationBehavior) { + return value.parseAnimationBehavior() as T; + } + + if (T == AnimationStatus) { + return value.parseAnimationStatus() as T; + } + + if (T == AndroidOverscrollIndicator) { + return value.parseAndroidOverscrollIndicator() as T; + } + + if (T == AppLifecycleState) { + return value.parseAppLifecycleState() as T; + } + + if (T == AutofillContextAction) { + return value.parseAutofillContextAction() as T; + } + + if (T == AutovalidateMode) { + return value.parseAutovalidateMode() as T; + } + + if (T == Axis) { + return value.parseAxis() as T; + } + + if (T == AxisDirection) { + return value.parseAxisDirection() as T; + } + + if (T == BannerLocation) { + return value.parseBannerLocation() as T; + } + + if (T == BlendMode) { + return value.parseBlendMode() as T; + } + + if (T == BlurStyle) { + return value.parseBlurStyle() as T; + } + + if (T == BorderStyle) { + return value.parseBorderStyle() as T; + } + + if (T == BoxFit) { + return value.parseBoxFit() as T; + } + + if (T == BoxShape) { + return value.parseBoxShape() as T; + } + + if (T == Brightness) { + return value.parseBrightness() as T; + } + + if (T == Clip) { + return value.parseClip() as T; + } + + if (T == ClipboardStatus) { + return value.parseClipboardStatus() as T; + } + + if (T == ConnectionState) { + return value.parseConnectionState() as T; + } + + if (T == CrossAxisAlignment) { + return value.parseCrossAxisAlignment() as T; + } + + if (T == CrossFadeState) { + return value.parseCrossFadeState() as T; + } + + if (T == CupertinoDatePickerMode) { + return value.parseCupertinoDatePickerMode() as T; + } + + if (T == CupertinoTimerPickerMode) { + return value.parseCupertinoTimerPickerMode() as T; + } + + if (T == CupertinoUserInterfaceLevelData) { + return value.parseCupertinoUserInterfaceLevelData() as T; + } + + if (T == DatePickerDateOrder) { + return value.parseDatePickerDateOrder() as T; + } + + if (T == DatePickerDateTimeOrder) { + return value.parseDatePickerDateTimeOrder() as T; + } + + if (T == DecorationPosition) { + return value.parseDecorationPosition() as T; + } + + if (T == DiagnosticLevel) { + return value.parseDiagnosticLevel() as T; + } + + if (T == DismissDirection) { + return value.parseDismissDirection() as T; + } + + if (T == FilterQuality) { + return value.parseFilterQuality() as T; + } + + if (T == FlexFit) { + return value.parseFlexFit() as T; + } + + if (T == FlutterLogoStyle) { + return value.parseFlutterLogoStyle() as T; + } + + if (T == FocusHighlightMode) { + return value.parseFocusHighlightMode() as T; + } + + if (T == FocusHighlightStrategy) { + return value.parseFocusHighlightStrategy() as T; + } + + if (T == FontStyle) { + return value.parseFontStyle() as T; + } + + if (T == GrowthDirection) { + return value.parseGrowthDirection() as T; + } + + if (T == HeroFlightDirection) { + return value.parseHeroFlightDirection() as T; + } + + if (T == HitTestBehavior) { + return value.parseHitTestBehavior() as T; + } + + if (T == ImageRepeat) { + return value.parseImageRepeat() as T; + } + + if (T == KeyEventResult) { + return value.parseKeyEventResult() as T; + } + + if (T == MainAxisAlignment) { + return value.parseMainAxisAlignment() as T; + } + + if (T == MainAxisSize) { + return value.parseMainAxisSize() as T; + } + + if (T == NavigationMode) { + return value.parseNavigationMode() as T; + } + + if (T == Orientation) { + return value.parseOrientation() as T; + } + + if (T == OverflowBarAlignment) { + return value.parseOverflowBarAlignment() as T; + } + + if (T == OverlayVisibilityMode) { + return value.parseOverlayVisibilityMode() as T; + } + + if (T == PaintingStyle) { + return value.parsePaintingStyle() as T; + } + + if (T == PathFillType) { + return value.parsePathFillType() as T; + } + + if (T == PathOperation) { + return value.parsePathOperation() as T; + } + + if (T == PlaceholderAlignment) { + return value.parsePlaceholderAlignment() as T; + } + + if (T == PlatformProvidedMenuItemType) { + return value.parsePlatformProvidedMenuItemType() as T; + } + + if (T == RefreshIndicatorMode) { + return value.parseRefreshIndicatorMode() as T; + } + + if (T == RenderComparison) { + return value.parseRenderComparison() as T; + } + + if (T == RouteInformationReportingType) { + return value.parseRouteInformationReportingType() as T; + } + + if (T == RoutePopDisposition) { + return value.parseRoutePopDisposition() as T; + } + + if (T == ScrollbarOrientation) { + return value.parseScrollbarOrientation() as T; + } + + if (T == ScrollIncrementType) { + return value.parseScrollIncrementType() as T; + } + + if (T == ScrollPositionAlignmentPolicy) { + return value.parseScrollPositionAlignmentPolicy() as T; + } + + if (T == ScrollViewKeyboardDismissBehavior) { + return value.parseScrollViewKeyboardDismissBehavior() as T; + } + + if (T == SelectionChangedCause) { + return value.parseSelectionChangedCause() as T; + } + + if (T == SmartDashesType) { + return value.parseSmartDashesType() as T; + } + + if (T == SmartQuotesType) { + return value.parseSmartQuotesType() as T; + } + + if (T == StackFit) { + return value.parseStackFit() as T; + } + + if (T == StrokeCap) { + return value.parseStrokeCap() as T; + } + + if (T == StrokeJoin) { + return value.parseStrokeJoin() as T; + } + + if (T == TableCellVerticalAlignment) { + return value.parseTableCellVerticalAlignment() as T; + } + + if (T == TargetPlatform) { + return value.parseTargetPlatform() as T; + } + + if (T == TextAffinity) { + return value.parseTextAffinity() as T; + } + + if (T == TextAlign) { + return value.parseTextAlign() as T; + } + + if (T == TextBaseline) { + return value.parseTextBaseline() as T; + } + + if (T == TextCapitalization) { + return value.parseTextCapitalization() as T; + } + + if (T == TextDecorationStyle) { + return value.parseTextDecorationStyle() as T; + } + + if (T == TextDirection) { + return value.parseTextDirection() as T; + } + + if (T == TextInputAction) { + return value.parseTextInputAction() as T; + } + + if (T == TextLeadingDistribution) { + return value.parseTextLeadingDistribution() as T; + } + + if (T == TextOverflow) { + return value.parseTextOverflow() as T; + } + + if (T == TextSelectionHandleType) { + return value.parseTextSelectionHandleType() as T; + } + + if (T == TextWidthBasis) { + return value.parseTextWidthBasis() as T; + } + + if (T == TileMode) { + return value.parseTileMode() as T; + } + + if (T == TraversalDirection) { + return value.parseTraversalDirection() as T; + } + + if (T == UnfocusDisposition) { + return value.parseUnfocusDisposition() as T; + } + + if (T == VertexMode) { + return value.parseVertexMode() as T; + } + + if (T == VerticalDirection) { + return value.parseVerticalDirection() as T; + } + + if (T == WrapAlignment) { + return value.parseWrapAlignment() as T; + } + + if (T == WrapCrossAlignment) { + return value.parseWrapCrossAlignment() as T; + } + + if (T == DiagnosticsTreeStyle) { + return value.parseDiagnosticsTreeStyle() as T; + } + + if (T == DragStartBehavior) { + return value.parseDragStartBehavior() as T; + } + + if (T == GestureDisposition) { + return value.parseGestureDisposition() as T; + } + + if (T == GestureRecognizerState) { + return value.parseGestureRecognizerState() as T; + } + + if (T == PointerDeviceKind) { + return value.parsePointerDeviceKind() as T; + } + + if (T == BottomNavigationBarLandscapeLayout) { + return value.parseBottomNavigationBarLandscapeLayout() as T; + } + + if (T == BottomNavigationBarType) { + return value.parseBottomNavigationBarType() as T; + } + + if (T == ButtonBarLayoutBehavior) { + return value.parseButtonBarLayoutBehavior() as T; + } + + if (T == ButtonTextTheme) { + return value.parseButtonTextTheme() as T; + } + + if (T == CollapseMode) { + return value.parseCollapseMode() as T; + } + + if (T == DatePickerEntryMode) { + return value.parseDatePickerEntryMode() as T; + } + + if (T == DatePickerMode) { + return value.parseDatePickerMode() as T; + } + + if (T == DayPeriod) { + return value.parseDayPeriod() as T; + } + + if (T == DrawerAlignment) { + return value.parseDrawerAlignment() as T; + } + + if (T == FloatingLabelBehavior) { + return value.parseFloatingLabelBehavior() as T; + } + + if (T == HourFormat) { + return value.parseHourFormat() as T; + } + + if (T == ListTileControlAffinity) { + return value.parseListTileControlAffinity() as T; + } + + if (T == ListTileStyle) { + return value.parseListTileStyle() as T; + } + + if (T == MaterialBannerClosedReason) { + return value.parseMaterialBannerClosedReason() as T; + } + + if (T == MaterialState) { + return value.parseMaterialState() as T; + } + + if (T == MaterialTapTargetSize) { + return value.parseMaterialTapTargetSize() as T; + } + + if (T == MaterialType) { + return value.parseMaterialType() as T; + } + + if (T == NavigationDestinationLabelBehavior) { + return value.parseNavigationDestinationLabelBehavior() as T; + } + + if (T == NavigationRailLabelType) { + return value.parseNavigationRailLabelType() as T; + } + + if (T == PopupMenuPosition) { + return value.parsePopupMenuPosition() as T; + } + + if (T == RefreshIndicatorTriggerMode) { + return value.parseRefreshIndicatorTriggerMode() as T; + } + + if (T == ScriptCategory) { + return value.parseScriptCategory() as T; + } + + if (T == ShowValueIndicator) { + return value.parseShowValueIndicator() as T; + } + + if (T == SnackBarBehavior) { + return value.parseSnackBarBehavior() as T; + } + + if (T == SnackBarClosedReason) { + return value.parseSnackBarClosedReason() as T; + } + + if (T == StepperType) { + return value.parseStepperType() as T; + } + + if (T == StepState) { + return value.parseStepState() as T; + } + + if (T == StretchMode) { + return value.parseStretchMode() as T; + } + + if (T == TabBarIndicatorSize) { + return value.parseTabBarIndicatorSize() as T; + } + + if (T == ThemeMode) { + return value.parseThemeMode() as T; + } + + if (T == Thumb) { + return value.parseThumb() as T; + } + + if (T == TimeOfDayFormat) { + return value.parseTimeOfDayFormat() as T; + } + + if (T == TimePickerEntryMode) { + return value.parseTimePickerEntryMode() as T; + } + + if (T == TooltipTriggerMode) { + return value.parseTooltipTriggerMode() as T; + } + + if (T == SpringType) { + return value.parseSpringType() as T; + } + + if (T == CacheExtentStyle) { + return value.parseCacheExtentStyle() as T; + } + + if (T == DebugSemanticsDumpOrder) { + return value.parseDebugSemanticsDumpOrder() as T; + } + + if (T == PerformanceOverlayOption) { + return value.parsePerformanceOverlayOption() as T; + } + + if (T == PlatformViewHitTestBehavior) { + return value.parsePlatformViewHitTestBehavior() as T; + } + + if (T == RenderAnimatedSizeState) { + return value.parseRenderAnimatedSizeState() as T; + } + + if (T == ScrollDirection) { + return value.parseScrollDirection() as T; + } + + if (T == SelectionEventType) { + return value.parseSelectionEventType() as T; + } + + if (T == SelectionResult) { + return value.parseSelectionResult() as T; + } + + if (T == SelectionStatus) { + return value.parseSelectionStatus() as T; + } + + if (T == SchedulerPhase) { + return value.parseSchedulerPhase() as T; + } + + if (T == DeviceOrientation) { + return value.parseDeviceOrientation() as T; + } + + if (T == FloatingCursorDragState) { + return value.parseFloatingCursorDragState() as T; + } + + if (T == KeyboardSide) { + return value.parseKeyboardSide() as T; + } + + if (T == KeyDataTransitMode) { + return value.parseKeyDataTransitMode() as T; + } + + if (T == MaxLengthEnforcement) { + return value.parseMaxLengthEnforcement() as T; + } + + if (T == ModifierKey) { + return value.parseModifierKey() as T; + } + + if (T == SystemSoundType) { + return value.parseSystemSoundType() as T; + } + + if (T == SystemUiMode) { + return value.parseSystemUiMode() as T; + } + + if (T == SystemUiOverlay) { + return value.parseSystemUiOverlay() as T; + } + + if (T == BoxHeightStyle) { + return value.parseBoxHeightStyle() as T; + } + + if (T == BoxWidthStyle) { + return value.parseBoxWidthStyle() as T; + } + + if (T == ClipOp) { + return value.parseClipOp() as T; + } + + if (T == DisplayFeatureState) { + return value.parseDisplayFeatureState() as T; + } + + if (T == DisplayFeatureType) { + return value.parseDisplayFeatureType() as T; + } + + if (T == FramePhase) { + return value.parseFramePhase() as T; + } + + if (T == ImageByteFormat) { + return value.parseImageByteFormat() as T; + } + + if (T == KeyEventType) { + return value.parseKeyEventType() as T; + } + + if (T == PixelFormat) { + return value.parsePixelFormat() as T; + } + + if (T == PointerChange) { + return value.parsePointerChange() as T; + } + + if (T == PointerSignalKind) { + return value.parsePointerSignalKind() as T; + } + + if (T == PointMode) { + return value.parsePointMode() as T; + } + + if (T == HttpClientResponseCompressionState) { + return value.parseHttpClientResponseCompressionState() as T; + } + + return null as T; +} + +bool isFlutterEmum(Type type) { + return type == AnimationBehavior || + type == AnimationStatus || + type == AndroidOverscrollIndicator || + type == AppLifecycleState || + type == AutofillContextAction || + type == AutovalidateMode || + type == Axis || + type == AxisDirection || + type == BannerLocation || + type == BlendMode || + type == BlurStyle || + type == BorderStyle || + type == BoxFit || + type == BoxShape || + type == Brightness || + type == Clip || + type == ClipboardStatus || + type == ConnectionState || + type == CrossAxisAlignment || + type == CrossFadeState || + type == CupertinoDatePickerMode || + type == CupertinoTimerPickerMode || + type == CupertinoUserInterfaceLevelData || + type == DatePickerDateOrder || + type == DatePickerDateTimeOrder || + type == DecorationPosition || + type == DiagnosticLevel || + type == DismissDirection || + type == FilterQuality || + type == FlexFit || + type == FlutterLogoStyle || + type == FocusHighlightMode || + type == FocusHighlightStrategy || + type == FontStyle || + type == GrowthDirection || + type == HeroFlightDirection || + type == HitTestBehavior || + type == ImageRepeat || + type == KeyEventResult || + type == MainAxisAlignment || + type == MainAxisSize || + type == NavigationMode || + type == Orientation || + type == OverflowBarAlignment || + type == OverlayVisibilityMode || + type == PaintingStyle || + type == PathFillType || + type == PathOperation || + type == PlaceholderAlignment || + type == PlatformProvidedMenuItemType || + type == RefreshIndicatorMode || + type == RenderComparison || + type == RouteInformationReportingType || + type == RoutePopDisposition || + type == ScrollbarOrientation || + type == ScrollIncrementType || + type == ScrollPositionAlignmentPolicy || + type == ScrollViewKeyboardDismissBehavior || + type == SelectionChangedCause || + type == SmartDashesType || + type == SmartQuotesType || + type == StackFit || + type == StrokeCap || + type == StrokeJoin || + type == TableCellVerticalAlignment || + type == TargetPlatform || + type == TextAffinity || + type == TextAlign || + type == TextBaseline || + type == TextCapitalization || + type == TextDecorationStyle || + type == TextDirection || + type == TextInputAction || + type == TextLeadingDistribution || + type == TextOverflow || + type == TextSelectionHandleType || + type == TextWidthBasis || + type == TileMode || + type == TraversalDirection || + type == UnfocusDisposition || + type == VertexMode || + type == VerticalDirection || + type == WrapAlignment || + type == WrapCrossAlignment || + type == DiagnosticsTreeStyle || + type == DragStartBehavior || + type == GestureDisposition || + type == GestureRecognizerState || + type == PointerDeviceKind || + type == BottomNavigationBarLandscapeLayout || + type == BottomNavigationBarType || + type == ButtonBarLayoutBehavior || + type == ButtonTextTheme || + type == CollapseMode || + type == DatePickerEntryMode || + type == DatePickerMode || + type == DayPeriod || + type == DrawerAlignment || + type == FloatingLabelBehavior || + type == HourFormat || + type == ListTileControlAffinity || + type == ListTileStyle || + type == MaterialBannerClosedReason || + type == MaterialState || + type == MaterialTapTargetSize || + type == MaterialType || + type == NavigationDestinationLabelBehavior || + type == NavigationRailLabelType || + type == PopupMenuPosition || + type == RefreshIndicatorTriggerMode || + type == ScriptCategory || + type == ShowValueIndicator || + type == SnackBarBehavior || + type == SnackBarClosedReason || + type == StepperType || + type == StepState || + type == StretchMode || + type == TabBarIndicatorSize || + type == ThemeMode || + type == Thumb || + type == TimeOfDayFormat || + type == TimePickerEntryMode || + type == TooltipTriggerMode || + type == SpringType || + type == CacheExtentStyle || + type == DebugSemanticsDumpOrder || + type == PerformanceOverlayOption || + type == PlatformViewHitTestBehavior || + type == RenderAnimatedSizeState || + type == ScrollDirection || + type == SelectionEventType || + type == SelectionResult || + type == SelectionStatus || + type == SchedulerPhase || + type == DeviceOrientation || + type == FloatingCursorDragState || + type == KeyboardSide || + type == KeyDataTransitMode || + type == MaxLengthEnforcement || + type == ModifierKey || + type == SystemSoundType || + type == SystemUiMode || + type == SystemUiOverlay || + type == BoxHeightStyle || + type == BoxWidthStyle || + type == ClipOp || + type == DisplayFeatureState || + type == DisplayFeatureType || + type == FramePhase || + type == ImageByteFormat || + type == KeyEventType || + type == PixelFormat || + type == PointerChange || + type == PointerSignalKind || + type == PointMode || + type == HttpClientResponseCompressionState; +} + +extension StringExtensionForEnums on String { + AnimationBehavior parseAnimationBehavior() { + return AnimationBehavior.values + .firstWhere((e) => e.toString() == 'AnimationBehavior.' + this); + } + + AnimationStatus parseAnimationStatus() { + return AnimationStatus.values + .firstWhere((e) => e.toString() == 'AnimationStatus.' + this); + } + + AndroidOverscrollIndicator parseAndroidOverscrollIndicator() { + return AndroidOverscrollIndicator.values.firstWhere( + (e) => e.toString() == 'AndroidOverscrollIndicator.' + this); + } + + AppLifecycleState parseAppLifecycleState() { + return AppLifecycleState.values + .firstWhere((e) => e.toString() == 'AppLifecycleState.' + this); + } + + AutofillContextAction parseAutofillContextAction() { + return AutofillContextAction.values + .firstWhere((e) => e.toString() == 'AutofillContextAction.' + this); + } + + AutovalidateMode parseAutovalidateMode() { + return AutovalidateMode.values + .firstWhere((e) => e.toString() == 'AutovalidateMode.' + this); + } + + Axis parseAxis() { + return Axis.values.firstWhere((e) => e.toString() == 'Axis.' + this); + } + + AxisDirection parseAxisDirection() { + return AxisDirection.values + .firstWhere((e) => e.toString() == 'AxisDirection.' + this); + } + + BannerLocation parseBannerLocation() { + return BannerLocation.values + .firstWhere((e) => e.toString() == 'BannerLocation.' + this); + } + + BlendMode parseBlendMode() { + return BlendMode.values + .firstWhere((e) => e.toString() == 'BlendMode.' + this); + } + + BlurStyle parseBlurStyle() { + return BlurStyle.values + .firstWhere((e) => e.toString() == 'BlurStyle.' + this); + } + + BorderStyle parseBorderStyle() { + return BorderStyle.values + .firstWhere((e) => e.toString() == 'BorderStyle.' + this); + } + + BoxFit parseBoxFit() { + return BoxFit.values.firstWhere((e) => e.toString() == 'BoxFit.' + this); + } + + BoxShape parseBoxShape() { + return BoxShape.values + .firstWhere((e) => e.toString() == 'BoxShape.' + this); + } + + Brightness parseBrightness() { + return Brightness.values + .firstWhere((e) => e.toString() == 'Brightness.' + this); + } + + Clip parseClip() { + return Clip.values.firstWhere((e) => e.toString() == 'Clip.' + this); + } + + ClipboardStatus parseClipboardStatus() { + return ClipboardStatus.values + .firstWhere((e) => e.toString() == 'ClipboardStatus.' + this); + } + + ConnectionState parseConnectionState() { + return ConnectionState.values + .firstWhere((e) => e.toString() == 'ConnectionState.' + this); + } + + CrossAxisAlignment parseCrossAxisAlignment() { + return CrossAxisAlignment.values + .firstWhere((e) => e.toString() == 'CrossAxisAlignment.' + this); + } + + CrossFadeState parseCrossFadeState() { + return CrossFadeState.values + .firstWhere((e) => e.toString() == 'CrossFadeState.' + this); + } + + CupertinoDatePickerMode parseCupertinoDatePickerMode() { + return CupertinoDatePickerMode.values + .firstWhere((e) => e.toString() == 'CupertinoDatePickerMode.' + this); + } + + CupertinoTimerPickerMode parseCupertinoTimerPickerMode() { + return CupertinoTimerPickerMode.values + .firstWhere((e) => e.toString() == 'CupertinoTimerPickerMode.' + this); + } + + CupertinoUserInterfaceLevelData parseCupertinoUserInterfaceLevelData() { + return CupertinoUserInterfaceLevelData.values.firstWhere( + (e) => e.toString() == 'CupertinoUserInterfaceLevelData.' + this); + } + + DatePickerDateOrder parseDatePickerDateOrder() { + return DatePickerDateOrder.values + .firstWhere((e) => e.toString() == 'DatePickerDateOrder.' + this); + } + + DatePickerDateTimeOrder parseDatePickerDateTimeOrder() { + return DatePickerDateTimeOrder.values + .firstWhere((e) => e.toString() == 'DatePickerDateTimeOrder.' + this); + } + + DecorationPosition parseDecorationPosition() { + return DecorationPosition.values + .firstWhere((e) => e.toString() == 'DecorationPosition.' + this); + } + + DiagnosticLevel parseDiagnosticLevel() { + return DiagnosticLevel.values + .firstWhere((e) => e.toString() == 'DiagnosticLevel.' + this); + } + + DismissDirection parseDismissDirection() { + return DismissDirection.values + .firstWhere((e) => e.toString() == 'DismissDirection.' + this); + } + + FilterQuality parseFilterQuality() { + return FilterQuality.values + .firstWhere((e) => e.toString() == 'FilterQuality.' + this); + } + + FlexFit parseFlexFit() { + return FlexFit.values.firstWhere((e) => e.toString() == 'FlexFit.' + this); + } + + FlutterLogoStyle parseFlutterLogoStyle() { + return FlutterLogoStyle.values + .firstWhere((e) => e.toString() == 'FlutterLogoStyle.' + this); + } + + FocusHighlightMode parseFocusHighlightMode() { + return FocusHighlightMode.values + .firstWhere((e) => e.toString() == 'FocusHighlightMode.' + this); + } + + FocusHighlightStrategy parseFocusHighlightStrategy() { + return FocusHighlightStrategy.values + .firstWhere((e) => e.toString() == 'FocusHighlightStrategy.' + this); + } + + FontStyle parseFontStyle() { + return FontStyle.values + .firstWhere((e) => e.toString() == 'FontStyle.' + this); + } + + GrowthDirection parseGrowthDirection() { + return GrowthDirection.values + .firstWhere((e) => e.toString() == 'GrowthDirection.' + this); + } + + HeroFlightDirection parseHeroFlightDirection() { + return HeroFlightDirection.values + .firstWhere((e) => e.toString() == 'HeroFlightDirection.' + this); + } + + HitTestBehavior parseHitTestBehavior() { + return HitTestBehavior.values + .firstWhere((e) => e.toString() == 'HitTestBehavior.' + this); + } + + ImageRepeat parseImageRepeat() { + return ImageRepeat.values + .firstWhere((e) => e.toString() == 'ImageRepeat.' + this); + } + + KeyEventResult parseKeyEventResult() { + return KeyEventResult.values + .firstWhere((e) => e.toString() == 'KeyEventResult.' + this); + } + + MainAxisAlignment parseMainAxisAlignment() { + return MainAxisAlignment.values + .firstWhere((e) => e.toString() == 'MainAxisAlignment.' + this); + } + + MainAxisSize parseMainAxisSize() { + return MainAxisSize.values + .firstWhere((e) => e.toString() == 'MainAxisSize.' + this); + } + + NavigationMode parseNavigationMode() { + return NavigationMode.values + .firstWhere((e) => e.toString() == 'NavigationMode.' + this); + } + + Orientation parseOrientation() { + return Orientation.values + .firstWhere((e) => e.toString() == 'Orientation.' + this); + } + + OverflowBarAlignment parseOverflowBarAlignment() { + return OverflowBarAlignment.values + .firstWhere((e) => e.toString() == 'OverflowBarAlignment.' + this); + } + + OverlayVisibilityMode parseOverlayVisibilityMode() { + return OverlayVisibilityMode.values + .firstWhere((e) => e.toString() == 'OverlayVisibilityMode.' + this); + } + + PaintingStyle parsePaintingStyle() { + return PaintingStyle.values + .firstWhere((e) => e.toString() == 'PaintingStyle.' + this); + } + + PathFillType parsePathFillType() { + return PathFillType.values + .firstWhere((e) => e.toString() == 'PathFillType.' + this); + } + + PathOperation parsePathOperation() { + return PathOperation.values + .firstWhere((e) => e.toString() == 'PathOperation.' + this); + } + + PlaceholderAlignment parsePlaceholderAlignment() { + return PlaceholderAlignment.values + .firstWhere((e) => e.toString() == 'PlaceholderAlignment.' + this); + } + + PlatformProvidedMenuItemType parsePlatformProvidedMenuItemType() { + return PlatformProvidedMenuItemType.values.firstWhere( + (e) => e.toString() == 'PlatformProvidedMenuItemType.' + this); + } + + RefreshIndicatorMode parseRefreshIndicatorMode() { + return RefreshIndicatorMode.values + .firstWhere((e) => e.toString() == 'RefreshIndicatorMode.' + this); + } + + RenderComparison parseRenderComparison() { + return RenderComparison.values + .firstWhere((e) => e.toString() == 'RenderComparison.' + this); + } + + RouteInformationReportingType parseRouteInformationReportingType() { + return RouteInformationReportingType.values.firstWhere( + (e) => e.toString() == 'RouteInformationReportingType.' + this); + } + + RoutePopDisposition parseRoutePopDisposition() { + return RoutePopDisposition.values + .firstWhere((e) => e.toString() == 'RoutePopDisposition.' + this); + } + + ScrollbarOrientation parseScrollbarOrientation() { + return ScrollbarOrientation.values + .firstWhere((e) => e.toString() == 'ScrollbarOrientation.' + this); + } + + ScrollIncrementType parseScrollIncrementType() { + return ScrollIncrementType.values + .firstWhere((e) => e.toString() == 'ScrollIncrementType.' + this); + } + + ScrollPositionAlignmentPolicy parseScrollPositionAlignmentPolicy() { + return ScrollPositionAlignmentPolicy.values.firstWhere( + (e) => e.toString() == 'ScrollPositionAlignmentPolicy.' + this); + } + + ScrollViewKeyboardDismissBehavior parseScrollViewKeyboardDismissBehavior() { + return ScrollViewKeyboardDismissBehavior.values.firstWhere( + (e) => e.toString() == 'ScrollViewKeyboardDismissBehavior.' + this); + } + + SelectionChangedCause parseSelectionChangedCause() { + return SelectionChangedCause.values + .firstWhere((e) => e.toString() == 'SelectionChangedCause.' + this); + } + + SmartDashesType parseSmartDashesType() { + return SmartDashesType.values + .firstWhere((e) => e.toString() == 'SmartDashesType.' + this); + } + + SmartQuotesType parseSmartQuotesType() { + return SmartQuotesType.values + .firstWhere((e) => e.toString() == 'SmartQuotesType.' + this); + } + + StackFit parseStackFit() { + return StackFit.values + .firstWhere((e) => e.toString() == 'StackFit.' + this); + } + + StrokeCap parseStrokeCap() { + return StrokeCap.values + .firstWhere((e) => e.toString() == 'StrokeCap.' + this); + } + + StrokeJoin parseStrokeJoin() { + return StrokeJoin.values + .firstWhere((e) => e.toString() == 'StrokeJoin.' + this); + } + + TableCellVerticalAlignment parseTableCellVerticalAlignment() { + return TableCellVerticalAlignment.values.firstWhere( + (e) => e.toString() == 'TableCellVerticalAlignment.' + this); + } + + TargetPlatform parseTargetPlatform() { + return TargetPlatform.values + .firstWhere((e) => e.toString() == 'TargetPlatform.' + this); + } + + TextAffinity parseTextAffinity() { + return TextAffinity.values + .firstWhere((e) => e.toString() == 'TextAffinity.' + this); + } + + TextAlign parseTextAlign() { + return TextAlign.values + .firstWhere((e) => e.toString() == 'TextAlign.' + this); + } + + TextBaseline parseTextBaseline() { + return TextBaseline.values + .firstWhere((e) => e.toString() == 'TextBaseline.' + this); + } + + TextCapitalization parseTextCapitalization() { + return TextCapitalization.values + .firstWhere((e) => e.toString() == 'TextCapitalization.' + this); + } + + TextDecorationStyle parseTextDecorationStyle() { + return TextDecorationStyle.values + .firstWhere((e) => e.toString() == 'TextDecorationStyle.' + this); + } + + TextDirection parseTextDirection() { + return TextDirection.values + .firstWhere((e) => e.toString() == 'TextDirection.' + this); + } + + TextInputAction parseTextInputAction() { + return TextInputAction.values + .firstWhere((e) => e.toString() == 'TextInputAction.' + this); + } + + TextLeadingDistribution parseTextLeadingDistribution() { + return TextLeadingDistribution.values + .firstWhere((e) => e.toString() == 'TextLeadingDistribution.' + this); + } + + TextOverflow parseTextOverflow() { + return TextOverflow.values + .firstWhere((e) => e.toString() == 'TextOverflow.' + this); + } + + TextSelectionHandleType parseTextSelectionHandleType() { + return TextSelectionHandleType.values + .firstWhere((e) => e.toString() == 'TextSelectionHandleType.' + this); + } + + TextWidthBasis parseTextWidthBasis() { + return TextWidthBasis.values + .firstWhere((e) => e.toString() == 'TextWidthBasis.' + this); + } + + TileMode parseTileMode() { + return TileMode.values + .firstWhere((e) => e.toString() == 'TileMode.' + this); + } + + TraversalDirection parseTraversalDirection() { + return TraversalDirection.values + .firstWhere((e) => e.toString() == 'TraversalDirection.' + this); + } + + UnfocusDisposition parseUnfocusDisposition() { + return UnfocusDisposition.values + .firstWhere((e) => e.toString() == 'UnfocusDisposition.' + this); + } + + VertexMode parseVertexMode() { + return VertexMode.values + .firstWhere((e) => e.toString() == 'VertexMode.' + this); + } + + VerticalDirection parseVerticalDirection() { + return VerticalDirection.values + .firstWhere((e) => e.toString() == 'VerticalDirection.' + this); + } + + WrapAlignment parseWrapAlignment() { + return WrapAlignment.values + .firstWhere((e) => e.toString() == 'WrapAlignment.' + this); + } + + WrapCrossAlignment parseWrapCrossAlignment() { + return WrapCrossAlignment.values + .firstWhere((e) => e.toString() == 'WrapCrossAlignment.' + this); + } + + DiagnosticsTreeStyle parseDiagnosticsTreeStyle() { + return DiagnosticsTreeStyle.values + .firstWhere((e) => e.toString() == 'DiagnosticsTreeStyle.' + this); + } + + DragStartBehavior parseDragStartBehavior() { + return DragStartBehavior.values + .firstWhere((e) => e.toString() == 'DragStartBehavior.' + this); + } + + GestureDisposition parseGestureDisposition() { + return GestureDisposition.values + .firstWhere((e) => e.toString() == 'GestureDisposition.' + this); + } + + GestureRecognizerState parseGestureRecognizerState() { + return GestureRecognizerState.values + .firstWhere((e) => e.toString() == 'GestureRecognizerState.' + this); + } + + PointerDeviceKind parsePointerDeviceKind() { + return PointerDeviceKind.values + .firstWhere((e) => e.toString() == 'PointerDeviceKind.' + this); + } + + BottomNavigationBarLandscapeLayout parseBottomNavigationBarLandscapeLayout() { + return BottomNavigationBarLandscapeLayout.values.firstWhere( + (e) => e.toString() == 'BottomNavigationBarLandscapeLayout.' + this); + } + + BottomNavigationBarType parseBottomNavigationBarType() { + return BottomNavigationBarType.values + .firstWhere((e) => e.toString() == 'BottomNavigationBarType.' + this); + } + + ButtonBarLayoutBehavior parseButtonBarLayoutBehavior() { + return ButtonBarLayoutBehavior.values + .firstWhere((e) => e.toString() == 'ButtonBarLayoutBehavior.' + this); + } + + ButtonTextTheme parseButtonTextTheme() { + return ButtonTextTheme.values + .firstWhere((e) => e.toString() == 'ButtonTextTheme.' + this); + } + + CollapseMode parseCollapseMode() { + return CollapseMode.values + .firstWhere((e) => e.toString() == 'CollapseMode.' + this); + } + + DatePickerEntryMode parseDatePickerEntryMode() { + return DatePickerEntryMode.values + .firstWhere((e) => e.toString() == 'DatePickerEntryMode.' + this); + } + + DatePickerMode parseDatePickerMode() { + return DatePickerMode.values + .firstWhere((e) => e.toString() == 'DatePickerMode.' + this); + } + + DayPeriod parseDayPeriod() { + return DayPeriod.values + .firstWhere((e) => e.toString() == 'DayPeriod.' + this); + } + + DrawerAlignment parseDrawerAlignment() { + return DrawerAlignment.values + .firstWhere((e) => e.toString() == 'DrawerAlignment.' + this); + } + + FloatingLabelBehavior parseFloatingLabelBehavior() { + return FloatingLabelBehavior.values + .firstWhere((e) => e.toString() == 'FloatingLabelBehavior.' + this); + } + + HourFormat parseHourFormat() { + return HourFormat.values + .firstWhere((e) => e.toString() == 'HourFormat.' + this); + } + + ListTileControlAffinity parseListTileControlAffinity() { + return ListTileControlAffinity.values + .firstWhere((e) => e.toString() == 'ListTileControlAffinity.' + this); + } + + ListTileStyle parseListTileStyle() { + return ListTileStyle.values + .firstWhere((e) => e.toString() == 'ListTileStyle.' + this); + } + + MaterialBannerClosedReason parseMaterialBannerClosedReason() { + return MaterialBannerClosedReason.values.firstWhere( + (e) => e.toString() == 'MaterialBannerClosedReason.' + this); + } + + MaterialState parseMaterialState() { + return MaterialState.values + .firstWhere((e) => e.toString() == 'MaterialState.' + this); + } + + MaterialTapTargetSize parseMaterialTapTargetSize() { + return MaterialTapTargetSize.values + .firstWhere((e) => e.toString() == 'MaterialTapTargetSize.' + this); + } + + MaterialType parseMaterialType() { + return MaterialType.values + .firstWhere((e) => e.toString() == 'MaterialType.' + this); + } + + NavigationDestinationLabelBehavior parseNavigationDestinationLabelBehavior() { + return NavigationDestinationLabelBehavior.values.firstWhere( + (e) => e.toString() == 'NavigationDestinationLabelBehavior.' + this); + } + + NavigationRailLabelType parseNavigationRailLabelType() { + return NavigationRailLabelType.values + .firstWhere((e) => e.toString() == 'NavigationRailLabelType.' + this); + } + + PopupMenuPosition parsePopupMenuPosition() { + return PopupMenuPosition.values + .firstWhere((e) => e.toString() == 'PopupMenuPosition.' + this); + } + + RefreshIndicatorTriggerMode parseRefreshIndicatorTriggerMode() { + return RefreshIndicatorTriggerMode.values.firstWhere( + (e) => e.toString() == 'RefreshIndicatorTriggerMode.' + this); + } + + ScriptCategory parseScriptCategory() { + return ScriptCategory.values + .firstWhere((e) => e.toString() == 'ScriptCategory.' + this); + } + + ShowValueIndicator parseShowValueIndicator() { + return ShowValueIndicator.values + .firstWhere((e) => e.toString() == 'ShowValueIndicator.' + this); + } + + SnackBarBehavior parseSnackBarBehavior() { + return SnackBarBehavior.values + .firstWhere((e) => e.toString() == 'SnackBarBehavior.' + this); + } + + SnackBarClosedReason parseSnackBarClosedReason() { + return SnackBarClosedReason.values + .firstWhere((e) => e.toString() == 'SnackBarClosedReason.' + this); + } + + StepperType parseStepperType() { + return StepperType.values + .firstWhere((e) => e.toString() == 'StepperType.' + this); + } + + StepState parseStepState() { + return StepState.values + .firstWhere((e) => e.toString() == 'StepState.' + this); + } + + StretchMode parseStretchMode() { + return StretchMode.values + .firstWhere((e) => e.toString() == 'StretchMode.' + this); + } + + TabBarIndicatorSize parseTabBarIndicatorSize() { + return TabBarIndicatorSize.values + .firstWhere((e) => e.toString() == 'TabBarIndicatorSize.' + this); + } + + ThemeMode parseThemeMode() { + return ThemeMode.values + .firstWhere((e) => e.toString() == 'ThemeMode.' + this); + } + + Thumb parseThumb() { + return Thumb.values.firstWhere((e) => e.toString() == 'Thumb.' + this); + } + + TimeOfDayFormat parseTimeOfDayFormat() { + return TimeOfDayFormat.values + .firstWhere((e) => e.toString() == 'TimeOfDayFormat.' + this); + } + + TimePickerEntryMode parseTimePickerEntryMode() { + return TimePickerEntryMode.values + .firstWhere((e) => e.toString() == 'TimePickerEntryMode.' + this); + } + + TooltipTriggerMode parseTooltipTriggerMode() { + return TooltipTriggerMode.values + .firstWhere((e) => e.toString() == 'TooltipTriggerMode.' + this); + } + + SpringType parseSpringType() { + return SpringType.values + .firstWhere((e) => e.toString() == 'SpringType.' + this); + } + + CacheExtentStyle parseCacheExtentStyle() { + return CacheExtentStyle.values + .firstWhere((e) => e.toString() == 'CacheExtentStyle.' + this); + } + + DebugSemanticsDumpOrder parseDebugSemanticsDumpOrder() { + return DebugSemanticsDumpOrder.values + .firstWhere((e) => e.toString() == 'DebugSemanticsDumpOrder.' + this); + } + + PerformanceOverlayOption parsePerformanceOverlayOption() { + return PerformanceOverlayOption.values + .firstWhere((e) => e.toString() == 'PerformanceOverlayOption.' + this); + } + + PlatformViewHitTestBehavior parsePlatformViewHitTestBehavior() { + return PlatformViewHitTestBehavior.values.firstWhere( + (e) => e.toString() == 'PlatformViewHitTestBehavior.' + this); + } + + RenderAnimatedSizeState parseRenderAnimatedSizeState() { + return RenderAnimatedSizeState.values + .firstWhere((e) => e.toString() == 'RenderAnimatedSizeState.' + this); + } + + ScrollDirection parseScrollDirection() { + return ScrollDirection.values + .firstWhere((e) => e.toString() == 'ScrollDirection.' + this); + } + + SelectionEventType parseSelectionEventType() { + return SelectionEventType.values + .firstWhere((e) => e.toString() == 'SelectionEventType.' + this); + } + + SelectionResult parseSelectionResult() { + return SelectionResult.values + .firstWhere((e) => e.toString() == 'SelectionResult.' + this); + } + + SelectionStatus parseSelectionStatus() { + return SelectionStatus.values + .firstWhere((e) => e.toString() == 'SelectionStatus.' + this); + } + + SchedulerPhase parseSchedulerPhase() { + return SchedulerPhase.values + .firstWhere((e) => e.toString() == 'SchedulerPhase.' + this); + } + + DeviceOrientation parseDeviceOrientation() { + return DeviceOrientation.values + .firstWhere((e) => e.toString() == 'DeviceOrientation.' + this); + } + + FloatingCursorDragState parseFloatingCursorDragState() { + return FloatingCursorDragState.values + .firstWhere((e) => e.toString() == 'FloatingCursorDragState.' + this); + } + + KeyboardSide parseKeyboardSide() { + return KeyboardSide.values + .firstWhere((e) => e.toString() == 'KeyboardSide.' + this); + } + + KeyDataTransitMode parseKeyDataTransitMode() { + return KeyDataTransitMode.values + .firstWhere((e) => e.toString() == 'KeyDataTransitMode.' + this); + } + + MaxLengthEnforcement parseMaxLengthEnforcement() { + return MaxLengthEnforcement.values + .firstWhere((e) => e.toString() == 'MaxLengthEnforcement.' + this); + } + + ModifierKey parseModifierKey() { + return ModifierKey.values + .firstWhere((e) => e.toString() == 'ModifierKey.' + this); + } + + SystemSoundType parseSystemSoundType() { + return SystemSoundType.values + .firstWhere((e) => e.toString() == 'SystemSoundType.' + this); + } + + SystemUiMode parseSystemUiMode() { + return SystemUiMode.values + .firstWhere((e) => e.toString() == 'SystemUiMode.' + this); + } + + SystemUiOverlay parseSystemUiOverlay() { + return SystemUiOverlay.values + .firstWhere((e) => e.toString() == 'SystemUiOverlay.' + this); + } + + BoxHeightStyle parseBoxHeightStyle() { + return BoxHeightStyle.values + .firstWhere((e) => e.toString() == 'BoxHeightStyle.' + this); + } + + BoxWidthStyle parseBoxWidthStyle() { + return BoxWidthStyle.values + .firstWhere((e) => e.toString() == 'BoxWidthStyle.' + this); + } + + ClipOp parseClipOp() { + return ClipOp.values.firstWhere((e) => e.toString() == 'ClipOp.' + this); + } + + DisplayFeatureState parseDisplayFeatureState() { + return DisplayFeatureState.values + .firstWhere((e) => e.toString() == 'DisplayFeatureState.' + this); + } + + DisplayFeatureType parseDisplayFeatureType() { + return DisplayFeatureType.values + .firstWhere((e) => e.toString() == 'DisplayFeatureType.' + this); + } + + FramePhase parseFramePhase() { + return FramePhase.values + .firstWhere((e) => e.toString() == 'FramePhase.' + this); + } + + ImageByteFormat parseImageByteFormat() { + return ImageByteFormat.values + .firstWhere((e) => e.toString() == 'ImageByteFormat.' + this); + } + + KeyEventType parseKeyEventType() { + return KeyEventType.values + .firstWhere((e) => e.toString() == 'KeyEventType.' + this); + } + + PixelFormat parsePixelFormat() { + return PixelFormat.values + .firstWhere((e) => e.toString() == 'PixelFormat.' + this); + } + + PointerChange parsePointerChange() { + return PointerChange.values + .firstWhere((e) => e.toString() == 'PointerChange.' + this); + } + + PointerSignalKind parsePointerSignalKind() { + return PointerSignalKind.values + .firstWhere((e) => e.toString() == 'PointerSignalKind.' + this); + } + + PointMode parsePointMode() { + return PointMode.values + .firstWhere((e) => e.toString() == 'PointMode.' + this); + } + + HttpClientResponseCompressionState parseHttpClientResponseCompressionState() { + return HttpClientResponseCompressionState.values.firstWhere( + (e) => e.toString() == 'HttpClientResponseCompressionState.' + this); + } +} diff --git a/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/mappers/flutter_types_ext.dart b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/mappers/flutter_types_ext.dart new file mode 100644 index 0000000..cceb836 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/mappers/flutter_types_ext.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; + +// EXTENSIONS +extension StringToBool on String { + bool parseBool() { + return this.toLowerCase() == 'true'; + } +} + +extension StringToColor on String { + Color parseColor() { + // if string starts with #, remove it + if (this.startsWith("#")) { + return Color(int.parse(this.substring(1, 7), radix: 16) + 0xFF000000); + } else { + return Color(int.parse(this, radix: 16) + 0xFF000000); + } + } +} + +extension StringToIcon on String { + Icon parseIcon() { + // TODO: parse icon + return Icon(Icons.add); + } +} diff --git a/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/mappers/mappers.dart b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/mappers/mappers.dart new file mode 100644 index 0000000..b92d368 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/mappers/mappers.dart @@ -0,0 +1,2 @@ +export './flutter_enums_ext.dart'; +export './flutter_types_ext.dart'; diff --git a/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/preview.dart b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/preview.dart new file mode 100644 index 0000000..9494a2b --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/preview.dart @@ -0,0 +1,3 @@ +export './properties_value_mapper.dart'; +export './initial_properties.dart'; +export './properties_value_state.dart'; diff --git a/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/properties_value.dart b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/properties_value.dart new file mode 100644 index 0000000..0183594 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/properties_value.dart @@ -0,0 +1,105 @@ +import 'dart:html' as html; +import 'package:flutter/widgets.dart'; +import './properties_value_state.dart'; +import './mappers/mappers.dart'; + +T value( + BuildContext context, + String key, +) { + // Callbacks + if (T == Function || T == Function()) { + return makeCallbackEventEmitter(key) as T; + } + + final value = PropertiesStateContainer.of(context)!.properties[key]; + + // core types + // - Number - int, double, num + // - Boolean - bool + // - String - String + // - List - List + // - Map - Map + + // number - https://dart.dev/guides/language/numbers + if (T == num || T == int || T == double) { + if (value == null) { + return 0 as T; + } + + if (value is String) { + if (T is int) { + try { + return int.parse(value) as T; + } catch (e) {} + } + if (T is double) { + try { + return double.parse(value) as T; + } catch (e) {} + } + return num.parse(value) as T; + } else { + return value as T; + } + } + + // boolean + if (T == bool) { + if (value == null) { + return false as T; + } + + if (value is bool) { + return value as T; + } else { + // parse string to boolean + if (value is String) { + return value.parseBool() as T; + } + return value as T; + } + } + + // string + if (T == String) { + if (value == null) { + return "" as T; + } + return value.toString() as T; + } + + // Color + if (T == Color) { + if (value is String) { + return value.parseColor() as T; + } + return value as T; + } + + // Icon + if (T == Icon) { + if (value is String) { + return value.parseIcon() as T; + } + return value as T; + } + + if (isFlutterEmum(T)) { + return flutterEnumFromString(value) as T; + } + + return value; +} + +Function() makeCallbackEventEmitter(String name) { + return ([dynamic args]) { + // Send a event to the parent webapp when the widget is tapped + // post message + html.window.parent?.postMessage({ + "event": "@inapp/function-invocation-event", + "name": name, + "args": args + }, "*"); + }; +} diff --git a/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/properties_value_mapper.dart b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/properties_value_mapper.dart new file mode 100644 index 0000000..a0436fd --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/properties_value_mapper.dart @@ -0,0 +1,37 @@ +import 'package:flutter/widgets.dart'; +import './properties_value.dart'; +import './target_widget.dart'; + +class PropertiesMapper extends StatelessWidget { + const PropertiesMapper({super.key}); + + @override + Widget build(BuildContext context) { + // read the value of the "name" property from the parent state container + // start_flutter_preview_template:property_variable_declarations + final name = value(context, "name"); + final radius = value(context, "radius"); + final description = value(context, "description"); + final enabled = value(context, "enabled"); + final color = value(context, "color"); + final alignment = value(context, "alignment"); + final onTap = value(context, "onTap"); + // end_flutter_preview_template:property_variable_declarations + + return Column( + children: [ + // start_flutter_preview_template:widget_instantiation + Sample1Widget( + name, + radius: radius, + description: description, + enabled: enabled, + color: color, + alignment: alignment, + onTap: onTap, + ), + // end_flutter_preview_template:widget_instantiation + ], + ); + } +} diff --git a/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/properties_value_state.dart b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/properties_value_state.dart new file mode 100644 index 0000000..1ab920d --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/properties_value_state.dart @@ -0,0 +1,77 @@ +import 'dart:html' as html; +import 'package:flutter/widgets.dart'; + +// Define a state container widget that manages a map of properties +class PropertiesStateContainer extends InheritedWidget { + final Map properties; + + const PropertiesStateContainer({ + required this.properties, + required Widget child, + Key? key, + }) : super(key: key, child: child); + + // Define a static method to easily access the inherited widget from child widgets + static PropertiesStateContainer? of(BuildContext context) { + return context + .dependOnInheritedWidgetOfExactType(); + } + + // We only need to rebuild this widget when the properties map changes + @override + bool updateShouldNotify(PropertiesStateContainer old) { + return properties != old.properties; + } +} + +// State manager widget that listens for property change events and updates the state container +class PropertiesStateManager extends StatefulWidget { + final Map initialProperties; + final Widget child; + + const PropertiesStateManager( + {required this.child, required this.initialProperties, Key? key}) + : super(key: key); + + @override + _PropertiesStateManagerState createState() => _PropertiesStateManagerState(); +} + +class _PropertiesStateManagerState extends State { + late Map _properties; + + @override + void initState() { + super.initState(); + _properties = widget.initialProperties; + } + + // Define a method to update a property value + void setProperty(String key, dynamic value) { + setState(() { + _properties = {..._properties, key: value}; + }); + } + + @override + Widget build(BuildContext context) { + // Provide the properties map to child widgets using the state container + return PropertiesStateContainer( + properties: _properties, child: widget.child); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + + // Listen for property change events from the parent webapp + html.window.onMessage.listen((event) { + final dynamic data = event.data; + if (data["event"] == "@inapp/property-change") { + final key = data["key"]; + final value = data["value"]; + setProperty(key, value); + } + }); + } +} diff --git a/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/target_widget.dart b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/target_widget.dart new file mode 100644 index 0000000..a72a4b3 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/lib/.flutter_preview_artifacts/target_widget.dart @@ -0,0 +1,3 @@ +// start_flutter_preview_template:target_widget +export '../samples/sample_1.dart'; +// end_flutter_preview_template:target_widget \ No newline at end of file diff --git a/flutter-preview/flutter-preview-template/template_app/lib/main.dart b/flutter-preview/flutter-preview-template/template_app/lib/main.dart new file mode 100644 index 0000000..9f40d5f --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/lib/main.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; +import '.flutter_preview_artifacts/preview.dart'; + +void main() { + runApp(const FlutterPreview()); +} + +class FlutterPreview extends StatelessWidget { + const FlutterPreview({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + debugShowCheckedModeBanner: false, + title: + // start_flutter_preview_template:title + "Flutter Widget Preview" + // end_flutter_preview_template:title + , + theme: ThemeData(), + home: Scaffold( + body: PropertiesStateManager( + initialProperties: FLUTTER_PREVIEW_TARGET_WIDGET_INITIAL_PROPERTIES, + child: PropertiesMapper(), + ))); + } +} diff --git a/flutter-preview/flutter-preview-template/template_app/lib/samples/sample_1.dart b/flutter-preview/flutter-preview-template/template_app/lib/samples/sample_1.dart new file mode 100644 index 0000000..7ad0ab3 --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/lib/samples/sample_1.dart @@ -0,0 +1,73 @@ +import 'package:flutter/material.dart'; + +enum WidgetVariant { loading, loaded, error } + +class Data { + final String name; + final String description; + + Data(this.name, this.description); +} + +class Sample1Widget extends StatelessWidget { + final String name; + final Function() onTap; + final int radius; + final String? description; + final Color? color; + final bool enabled; + final CrossAxisAlignment alignment; + final WidgetVariant variant; + + const Sample1Widget( + this.name, { + required this.onTap, + required this.radius, + this.description, + this.color, + this.enabled = false, + this.alignment = CrossAxisAlignment.start, + this.variant = WidgetVariant.loaded, + Key? key, + }) : super(key: key); + + String variantText() { + switch (variant) { + case WidgetVariant.loading: + return "Loading..."; + case WidgetVariant.loaded: + return "Loaded"; + case WidgetVariant.error: + return "Error"; + } + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: this.onTap, + child: Opacity( + opacity: enabled ? 1 : 0.5, + child: Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(this.radius.toDouble()), + color: this.color ?? Colors.blue), + child: Column(crossAxisAlignment: this.alignment, children: [ + Text( + this.name, + style: TextStyle(fontSize: 21, color: Colors.white), + ), + SizedBox(height: 8), + Text( + this.description ?? '', + style: TextStyle(fontSize: 14, color: Colors.white), + ), + Text( + this.variantText(), + style: TextStyle(fontSize: 14, color: Colors.white), + ), + ]), + ))); + } +} diff --git a/flutter-preview/flutter-preview-template/template_app/pubspec.lock b/flutter-preview/flutter-preview-template/template_app/pubspec.lock new file mode 100644 index 0000000..82c48dc --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/pubspec.lock @@ -0,0 +1,65 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.16.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + provider: + dependency: "direct main" + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.5" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" +sdks: + dart: ">=2.17.6 <3.0.0" + flutter: ">=1.16.0" diff --git a/flutter-preview/flutter-preview-template/template_app/pubspec.yaml b/flutter-preview/flutter-preview-template/template_app/pubspec.yaml new file mode 100644 index 0000000..f3f5a3e --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/pubspec.yaml @@ -0,0 +1,8 @@ +name: flutter_preview_template +environment: + sdk: ">=2.17.6 <3.0.0" + +dependencies: + flutter: + sdk: flutter + provider: ^6.0.0 diff --git a/flutter-preview/flutter-preview-template/template_app/web/favicon.png b/flutter-preview/flutter-preview-template/template_app/web/favicon.png new file mode 100644 index 0000000..8aaa46a Binary files /dev/null and b/flutter-preview/flutter-preview-template/template_app/web/favicon.png differ diff --git a/flutter-preview/flutter-preview-template/template_app/web/icons/Icon-192.png b/flutter-preview/flutter-preview-template/template_app/web/icons/Icon-192.png new file mode 100644 index 0000000..b749bfe Binary files /dev/null and b/flutter-preview/flutter-preview-template/template_app/web/icons/Icon-192.png differ diff --git a/flutter-preview/flutter-preview-template/template_app/web/icons/Icon-512.png b/flutter-preview/flutter-preview-template/template_app/web/icons/Icon-512.png new file mode 100644 index 0000000..88cfd48 Binary files /dev/null and b/flutter-preview/flutter-preview-template/template_app/web/icons/Icon-512.png differ diff --git a/flutter-preview/flutter-preview-template/template_app/web/icons/Icon-maskable-192.png b/flutter-preview/flutter-preview-template/template_app/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000..eb9b4d7 Binary files /dev/null and b/flutter-preview/flutter-preview-template/template_app/web/icons/Icon-maskable-192.png differ diff --git a/flutter-preview/flutter-preview-template/template_app/web/icons/Icon-maskable-512.png b/flutter-preview/flutter-preview-template/template_app/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000..d69c566 Binary files /dev/null and b/flutter-preview/flutter-preview-template/template_app/web/icons/Icon-maskable-512.png differ diff --git a/flutter-preview/flutter-preview-template/template_app/web/index.html b/flutter-preview/flutter-preview-template/template_app/web/index.html new file mode 100644 index 0000000..58b20ee --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/web/index.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + template_app + + + + + + + + + + diff --git a/flutter-preview/flutter-preview-template/template_app/web/manifest.json b/flutter-preview/flutter-preview-template/template_app/web/manifest.json new file mode 100644 index 0000000..571447c --- /dev/null +++ b/flutter-preview/flutter-preview-template/template_app/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "template_app", + "short_name": "template_app", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/flutter-preview/flutter-preview-vscode-iframe/iframe.test.html b/flutter-preview/flutter-preview-vscode-iframe/iframe.test.html new file mode 100644 index 0000000..c43e505 --- /dev/null +++ b/flutter-preview/flutter-preview-vscode-iframe/iframe.test.html @@ -0,0 +1,9 @@ + + + + + + +
+ + diff --git a/flutter-preview/flutter-preview-vscode-iframe/listener.js b/flutter-preview/flutter-preview-vscode-iframe/listener.js new file mode 100644 index 0000000..82ac366 --- /dev/null +++ b/flutter-preview/flutter-preview-vscode-iframe/listener.js @@ -0,0 +1,13 @@ +// iframe listener + +// test. +// the message from webview app will be received here. + +window.addEventListener("message", (event) => { + const message = event.data; // The json data that the webview sent + switch (message.command) { + case "alert": + alert(message.text); + return; + } +}); diff --git a/flutter-preview/flutter-preview-vscode-iframe/package.json b/flutter-preview/flutter-preview-vscode-iframe/package.json new file mode 100644 index 0000000..a1eac64 --- /dev/null +++ b/flutter-preview/flutter-preview-vscode-iframe/package.json @@ -0,0 +1,7 @@ +{ + "name": "@flutter-preview/vscode-iframe-dev", + "description": "DEV only package for testing & integrating iframe source to be used on vscode (a webview host)", + "dependencies": { + "@flutter-preview/webview": "0.0.2" + } +} diff --git a/flutter-preview/flutter-preview-vscode/flutter-preview-vscode.ts b/flutter-preview/flutter-preview-vscode/flutter-preview-vscode.ts index ab58e62..1b87348 100644 --- a/flutter-preview/flutter-preview-vscode/flutter-preview-vscode.ts +++ b/flutter-preview/flutter-preview-vscode/flutter-preview-vscode.ts @@ -1,6 +1,6 @@ import * as vscode from "vscode"; import path from "path"; -import { Analyzer } from "@flutter-preview/analyzer"; +import { Analyzer, WidgetAnalysis } from "@flutter-preview/analyzer"; import { FlutterDaemon } from "./daemon"; import { appurl, @@ -11,10 +11,14 @@ import { VSCodeCommand, } from "@flutter-preview/webview"; import { locatePubspec } from "pubspec"; +import assert from "assert"; const langs = ["dart"] as const; -const APP_HOST = "https://flutter-preview.webview.vscode.grida.co/app"; // "http://localhost:6632"; +const APP_HOST = "http://localhost:6632/app"; +// "https://flutter-preview.webview.vscode.grida.co/app"; // + +const analysis: Map> = new Map(); export class FlutterPreviewVSCode { readonly namespace: string; @@ -35,19 +39,48 @@ export class FlutterPreviewVSCode { vscode.languages.registerCodeLensProvider(langs, { provideCodeLenses: async (document: vscode.TextDocument) => { + console.log("analyzing components for..", document.fileName); + const text = document.getText(); const analyzer = new Analyzer(text); const components = await analyzer.widgets(); + + console.log("analyzed components", components); + + analysis.set(document.fileName, components); + const lenses = components .map((_class) => { return _class.constructors.map((_constructor) => { const args = [document, _class.id, _constructor.name]; - // TODO: support widgets with required arguments - // at this moment, we don't support widgets with required arguments - if (_constructor.analysis.requires_arguments) { - return; + const { + requires_properties, + required_properties, + required_and_unsupported_properties, + contains_required_unsupported_properties, + contains_unsupported_properties, + } = _constructor.analysis; + + // console.log( + // _constructor.name, + // "@required args:", + // required_arguments + // ); + + if (contains_required_unsupported_properties) { + const _try_to_fix_el = required_and_unsupported_properties[0]; + const start = document.positionAt(_class.start + 2); + const lens = new vscode.CodeLens( + new vscode.Range(start, start), + { + command: this.commandId, + arguments: args, + title: `⚠️ Can't Preview ${_class.name}. (Make ${_try_to_fix_el.name} optional)`, + } + ); + return lens; } // factory constructors @@ -68,19 +101,14 @@ export class FlutterPreviewVSCode { } // default widget constructor - if (_constructor.name === _class.name) { - // for default widget constructor, provide lense at top of the class declaration, not the constructor. - const start = document.positionAt(_class.start + 2); - const lens = new vscode.CodeLens( - new vscode.Range(start, start), - { - command: this.commandId, - arguments: args, - title: `⚡️ Preview ${_class.name}`, - } - ); - return lens; - } + // for default widget constructor, provide lense at top of the class declaration, not the constructor. + const start = document.positionAt(_class.start + 2); + const lens = new vscode.CodeLens(new vscode.Range(start, start), { + command: this.commandId, + arguments: args, + title: `⚡️ Preview ${_class.name}`, + }); + return lens; }); }) .flat() @@ -101,6 +129,7 @@ async function cmd_dart_preview_handler( widgetId: string, constructorId: string ) { + const { fileName } = document; const panel_title = `Preview: ${widgetId}`; const panel = vscode.window.createWebviewPanel( @@ -145,6 +174,28 @@ async function cmd_dart_preview_handler( }, }; + // get the widget analysis + const widget_analysis = analysis + .get(fileName) + ?.find((w) => w.id === widgetId); + + assert(widget_analysis, `Widget analysis not found for ${widgetId}`); + + // get the constructor analysis + const constructor_analysis = widget_analysis?.constructors.find( + (c) => c.name === constructorId + ); + + assert( + constructor_analysis, + `Constructor analysis not found for ${widgetId}.${constructorId}` + ); + + // map the properties to property metadata to pass to the preview service + // TODO: const properties = constructor_analysis..properties.map( + + console.log("analysis", widget_analysis, constructor_analysis); + // run flutter daemon const daemon = FlutterDaemon.instance; diff --git a/flutter-preview/flutter-preview-webview-protocol/index.ts b/flutter-preview/flutter-preview-webview-protocol/index.ts index 6efb343..ea338f3 100644 --- a/flutter-preview/flutter-preview-webview-protocol/index.ts +++ b/flutter-preview/flutter-preview-webview-protocol/index.ts @@ -1,5 +1,6 @@ export type VSCodeCommand = VSCodeOpenExternalCommand; export type VSCodeNotification = NotifyVSCodeThatAppIsReady; +export type EventToInApp = NotifyPropertyChange; export interface VSCodeOpenExternalCommand { command: "vscode.env.openExternal"; @@ -10,6 +11,12 @@ export interface NotifyVSCodeThatAppIsReady { event: "webview-ready"; } +export interface NotifyPropertyChange { + event: "@inapp/property-change"; + key: string; + value: any; +} + export type Action = | HotRestartAction | WebLaunchUrlAction diff --git a/flutter-preview/flutter-preview-webview/components/dock.tsx b/flutter-preview/flutter-preview-webview/components/dock.tsx new file mode 100644 index 0000000..aa2c9b7 --- /dev/null +++ b/flutter-preview/flutter-preview-webview/components/dock.tsx @@ -0,0 +1,114 @@ +import React from "react"; +import { + PropertyLines, + PropertyLine, + PropertyInput, + PropertyCheckboxInput, + PropertySelectInput, + PropertyColorInput, +} from "@editor-ui/property"; +import styled from "@emotion/styled"; + +export type Property = + | EnumProperty + | { + key: string; + type: "number" | "text"; + value: string | number; + } + | { + key: string; + type: "boolean"; + value: boolean; + } + | { + key: string; + type: "color"; + value: string; + }; + +type EnumProperty = { + key: string; + value: string; + type: "enum"; + options?: Array<{ label: string; value: string }> | Array; +}; + +interface DockProps { + properties: Array; + onPropertyChange: (key: string, value: any) => void; +} + +export function Dock({ properties, onPropertyChange }: DockProps) { + const Input = ({ + property: p, + onChange, + }: { + property: Property; + onChange: (value: any) => void; + }) => { + switch (p.type) { + case "boolean": + return ( + + ); + case "color": + return ( + + ); + case "enum": + return ( + + ); + default: { + return ( + + ); + } + } + }; + + return ( + + Props + + {properties.map((p, i) => { + return ( + + { + onPropertyChange(p.key, v); + }} + /> + + ); + })} + + + ); +} + +const DockLayout = styled.div` + display: flex; + flex-direction: column; +`; + +const DockHeader = styled.div` + display: flex; + flex-direction: row; + padding: 14px; +`; diff --git a/flutter-preview/flutter-preview-webview/core/type-mapper.ts b/flutter-preview/flutter-preview-webview/core/type-mapper.ts new file mode 100644 index 0000000..1c563ec --- /dev/null +++ b/flutter-preview/flutter-preview-webview/core/type-mapper.ts @@ -0,0 +1,47 @@ +import { type as typeanalyze } from "@flutter-preview/analyzer"; + +type MappedControlMeta = + | { + type: "number" | "boolean" | "text" | "color"; + } + | { + type: "enum"; + options?: Array<{ label: string; value: string }> | Array; + }; + +export function mapTypes(type: typeanalyze.DartType): MappedControlMeta { + switch (type) { + case "int": + return { type: "number" }; + case "double": + return { type: "number" }; + case "num": + return { type: "number" }; + case "bool": + return { type: "boolean" }; + case "String": + return { type: "text" }; + case "dynamic": + return { type: "text" }; + } + + switch (type) { + case "Color": + return { type: "color" }; + } + + // enums + const maybeEnum = typeanalyze.isTypeFlutterEnum(type); + if (maybeEnum) { + return { + type: "enum", + options: maybeEnum.values?.map((v) => ({ + label: maybeEnum.name + "." + v, + value: v, + })), + }; + } + + // else + return { type: "text" }; +} diff --git a/flutter-preview/flutter-preview-webview/next.config.js b/flutter-preview/flutter-preview-webview/next.config.js index c51567d..33f3575 100644 --- a/flutter-preview/flutter-preview-webview/next.config.js +++ b/flutter-preview/flutter-preview-webview/next.config.js @@ -1,7 +1,11 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, - transpilePackages: ["@flutter-preview/webview"], + transpilePackages: [ + "@flutter-preview/webview", + // ui components + "@editor-ui/properties", + ], }; module.exports = nextConfig; diff --git a/flutter-preview/flutter-preview-webview/package.json b/flutter-preview/flutter-preview-webview/package.json index bc092ce..622a1ec 100644 --- a/flutter-preview/flutter-preview-webview/package.json +++ b/flutter-preview/flutter-preview-webview/package.json @@ -9,6 +9,7 @@ "lint": "next lint" }, "dependencies": { + "@flutter-builder/metadata-enums": "^0.0.0", "@next/font": "13.1.6", "@radix-ui/react-icons": "^1.1.1", "@radix-ui/react-tooltip": "^1.0.3", @@ -26,4 +27,4 @@ "react-use-measure": "2.1.1", "typescript": "4.9.4" } -} \ No newline at end of file +} diff --git a/flutter-preview/flutter-preview-webview/pages/_app.tsx b/flutter-preview/flutter-preview-webview/pages/_app.tsx index c055f25..dd0d959 100644 --- a/flutter-preview/flutter-preview-webview/pages/_app.tsx +++ b/flutter-preview/flutter-preview-webview/pages/_app.tsx @@ -1,6 +1,25 @@ -import '../styles/globals.css' -import type { AppProps } from 'next/app' +import "../styles/globals.css"; +import type { AppProps } from "next/app"; +import { EditorPropertyThemeProvider } from "@editor-ui/property"; export default function App({ Component, pageProps }: AppProps) { - return + return ( + + + + ); } diff --git a/flutter-preview/flutter-preview-webview/pages/app.tsx b/flutter-preview/flutter-preview-webview/pages/app.tsx index 0a685c9..6eb6bef 100644 --- a/flutter-preview/flutter-preview-webview/pages/app.tsx +++ b/flutter-preview/flutter-preview-webview/pages/app.tsx @@ -9,11 +9,14 @@ import { AppStopAction, VSCodeOpenExternalCommand, NotifyVSCodeThatAppIsReady, + NotifyPropertyChange, } from "@flutter-preview/webview"; import { Appbar } from "components/appbar"; import { Stage } from "components/stage"; import { LoadingView } from "components/loading"; import { ErrorView } from "components/error"; +import { Dock, Property } from "components/dock"; +import { mapTypes } from "core/type-mapper"; export default function FlutterWidgetPreview({ initial, @@ -38,6 +41,8 @@ export default function FlutterWidgetPreview({ setRefresh((prev) => prev + 1); }, [setRefresh]); + const appWindowRef = React.useRef(null); + useEffect(() => { // send message to vscode to notify that the webview is ready // initially, once. @@ -92,6 +97,46 @@ export default function FlutterWidgetPreview({ } }; + const properties_meta = [ + { + key: "name", + default: "Flutter Preview", + type: "String", + }, + { + key: "radius", + default: 12, + type: "int", + }, + { + key: "description", + default: + "Flutter Preview is a tool that allows you to preview your Flutter app in the browser", + type: "String", + }, + { + key: "color", + default: "#000000", + type: "Color", + }, + { + key: "enabled", + default: true, + type: "bool", + }, + { + key: "alignment", + default: "start", + type: "rendering/CrossAxisAlignment", + }, + ] as const; + + const properties = properties_meta.map((p) => ({ + key: p.key, + value: p.default, + ...mapTypes(p.type), + })) as Array; + return ( <> @@ -106,13 +151,28 @@ export default function FlutterWidgetPreview({ /> setSize(size)} fullsize={fullsize}> {webLaunchUrl ? ( - + ) : error ? ( ) : ( )} + { + const msg: NotifyPropertyChange = { + event: "@inapp/property-change", + key, + value, + }; + appWindowRef?.current?.contentWindow?.postMessage(msg, "*"); + }} + /> ); @@ -126,27 +186,33 @@ export default function FlutterWidgetPreview({ * * @returns */ -function WebLaunchPreview({ - src, - refreshKey, -}: { - src: string; - refreshKey: number; -}) { +const WebLaunchPreview = React.forwardRef(function WebLaunchPreview( + { + src, + refreshKey, + }: { + src: string; + refreshKey: number; + }, + ref?: React.Ref +) { return ( - + ); -} +}); -function ContentFrame({ - refreshKey, - src, -}: { - refreshKey: number; - src: string; -}) { +const ContentFrame = React.forwardRef(function ContentFrame( + { + refreshKey, + src, + }: { + refreshKey: number; + src: string; + }, + ref?: React.Ref +) { return (