Skip to content

Props support #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 48 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
fe7090f
add light analyzer configurations
softmarshmallow Feb 15, 2023
c66aeef
add templater package
softmarshmallow Feb 15, 2023
f2c07fd
add vscode iframe package
softmarshmallow Feb 15, 2023
e80c9e3
add dock component & ui package
softmarshmallow Feb 15, 2023
2646608
update prop change event messaging
softmarshmallow Feb 15, 2023
d0b2062
add demo dart app that changes property dynamicly inside a webview app.
softmarshmallow Feb 15, 2023
c969c8a
bump ui
softmarshmallow Feb 16, 2023
da5a16e
update template app
softmarshmallow Feb 16, 2023
cd851f8
wip - enum support
softmarshmallow Feb 18, 2023
6375409
mv dart doc parser
softmarshmallow Feb 18, 2023
0292371
add enum parser from flutter docs
softmarshmallow Feb 18, 2023
acc2b18
add parsing info for values and descriptions
softmarshmallow Feb 18, 2023
34e557d
rm duplicates
softmarshmallow Feb 18, 2023
f640657
rm unused
softmarshmallow Feb 18, 2023
63f1be1
fix typo
softmarshmallow Feb 18, 2023
f4dc0d4
publish `@flutter-builder/metadata-enums` package
softmarshmallow Feb 18, 2023
d8f2e49
add supported property types doc
softmarshmallow Feb 18, 2023
a755014
update control mapping on dock
softmarshmallow Feb 18, 2023
af9f878
add enum type mapper with options
softmarshmallow Feb 18, 2023
0033090
add flutter enum type mapper on template with generated script
softmarshmallow Feb 18, 2023
4631f57
add flutter enum type mapper on template
softmarshmallow Feb 18, 2023
1f1a389
bump ui
softmarshmallow Feb 18, 2023
39e22b0
update sample example
softmarshmallow Feb 18, 2023
a707ed8
made isOptional false by default
softmarshmallow Feb 19, 2023
029c0b3
add constructor props sample
softmarshmallow Feb 19, 2023
c4c20e9
update example
softmarshmallow Feb 19, 2023
797599b
bump ver
softmarshmallow Feb 19, 2023
2c209a2
pub flutter-ast
softmarshmallow Feb 19, 2023
e4ac087
add type analyzer
softmarshmallow Feb 20, 2023
df44a6c
add props type cheking on widget analyzer
softmarshmallow Feb 20, 2023
116997e
update vscode & webview
softmarshmallow Feb 20, 2023
071fb4b
add `@flutter-preview/template package`
softmarshmallow Feb 21, 2023
df55cc9
update template_app structure
softmarshmallow Feb 21, 2023
880cad4
update import for template
softmarshmallow Feb 21, 2023
2268ece
fix blocked logic
softmarshmallow Feb 21, 2023
f2e83ce
adding tab for dock
softmarshmallow Feb 21, 2023
4addb10
yarn
softmarshmallow Feb 21, 2023
cb6df38
update demo project
softmarshmallow Feb 21, 2023
4f62b12
update template templates
softmarshmallow Feb 21, 2023
51e07a2
add ts template builder (syncer)
softmarshmallow Feb 21, 2023
89a7e38
synced templates (v2)
softmarshmallow Feb 21, 2023
5a3ec7c
move legacy to v1
softmarshmallow Feb 21, 2023
6c11e07
fix initial properties template
softmarshmallow Feb 21, 2023
c5088e6
update template builder with reaquired artifacts
softmarshmallow Feb 21, 2023
5b0c5ec
add props meta passing
softmarshmallow Feb 21, 2023
da73ea4
update callback mapping
softmarshmallow Feb 21, 2023
3fa0ac1
add instanciation& initial props seeding
softmarshmallow Feb 21, 2023
7b79b17
add fallback types init
softmarshmallow Feb 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions examples/flutter_demo/lib/samples/preview_target_2.dart
Original file line number Diff line number Diff line change
@@ -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),
),
]),
)));
}
}
2 changes: 1 addition & 1 deletion flutter-ast/flutter-ast-node/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ interface DartConstructor extends AstNode {

interface DartProperty extends DartCore {
/**
* @default true
* @default false
*/
isOptional: boolean;

Expand Down
2 changes: 1 addition & 1 deletion flutter-ast/flutter-ast-node/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion flutter-ast/flutter_ast/examples/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
Loading