json_flit 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/demo/Gemfile +1 -1
- data/demo/Gemfile.lock +9 -5
- data/demo/app/controllers/welcome_controller.rb +4 -0
- data/demo/app/views/welcome/show.html.erb +2 -0
- data/lib/json_flit/builder.rb +16 -0
- data/lib/json_flit/factory/align.rb +13 -0
- data/lib/json_flit/factory/animated_align.rb +7 -0
- data/lib/json_flit/factory/animated_container.rb +7 -0
- data/lib/json_flit/factory/animated_cross_fade.rb +7 -0
- data/lib/json_flit/factory/animated_default_text_style.rb +7 -0
- data/lib/json_flit/factory/animated_opacity.rb +7 -0
- data/lib/json_flit/factory/animated_padding.rb +7 -0
- data/lib/json_flit/factory/animated_physical_model.rb +7 -0
- data/lib/json_flit/factory/animated_positioned.rb +7 -0
- data/lib/json_flit/factory/animated_positioned_directional.rb +7 -0
- data/lib/json_flit/factory/animated_size.rb +7 -0
- data/lib/json_flit/factory/animated_switcher.rb +7 -0
- data/lib/json_flit/factory/animated_theme.rb +7 -0
- data/lib/json_flit/factory/app_bar.rb +13 -0
- data/lib/json_flit/factory/aspect_ratio.rb +7 -0
- data/lib/json_flit/factory/asset_image.rb +7 -0
- data/lib/json_flit/factory/base.rb +7 -0
- data/lib/json_flit/factory/baseline.rb +7 -0
- data/lib/json_flit/factory/button_bar.rb +7 -0
- data/lib/json_flit/factory/card.rb +7 -0
- data/lib/json_flit/factory/center.rb +7 -0
- data/lib/json_flit/factory/checkbox.rb +7 -0
- data/lib/json_flit/factory/circular_progress_indicator.rb +7 -0
- data/lib/json_flit/factory/clip_oval.rb +7 -0
- data/lib/json_flit/factory/clip_path.rb +7 -0
- data/lib/json_flit/factory/clip_rect.rb +7 -0
- data/lib/json_flit/factory/clip_rrect.rb +7 -0
- data/lib/json_flit/factory/column.rb +7 -0
- data/lib/json_flit/factory/comment.rb +7 -0
- data/lib/json_flit/factory/conditional.rb +7 -0
- data/lib/json_flit/factory/container.rb +7 -0
- data/lib/json_flit/factory/cupertino_switch.rb +7 -0
- data/lib/json_flit/factory/custom_scroll_view.rb +7 -0
- data/lib/json_flit/factory/directionality.rb +7 -0
- data/lib/json_flit/factory/dropdown_button_form_field.rb +7 -0
- data/lib/json_flit/factory/dynamic.rb +7 -0
- data/lib/json_flit/factory/elevated_button.rb +7 -0
- data/lib/json_flit/factory/expanded.rb +7 -0
- data/lib/json_flit/factory/fitted_box.rb +7 -0
- data/lib/json_flit/factory/flexible.rb +7 -0
- data/lib/json_flit/factory/floating_action_button.rb +7 -0
- data/lib/json_flit/factory/form.rb +7 -0
- data/lib/json_flit/factory/fractional_translation.rb +7 -0
- data/lib/json_flit/factory/fractionally_sized.rb +7 -0
- data/lib/json_flit/factory/gesture_detector.rb +7 -0
- data/lib/json_flit/factory/grid_view.rb +7 -0
- data/lib/json_flit/factory/hero.rb +7 -0
- data/lib/json_flit/factory/icon.rb +7 -0
- data/lib/json_flit/factory/icon_button.rb +7 -0
- data/lib/json_flit/factory/ignore_pointer.rb +7 -0
- data/lib/json_flit/factory/indexed_stack.rb +7 -0
- data/lib/json_flit/factory/ink_well.rb +7 -0
- data/lib/json_flit/factory/input_error.rb +7 -0
- data/lib/json_flit/factory/interactive_viewer.rb +7 -0
- data/lib/json_flit/factory/intrinisic_height.rb +7 -0
- data/lib/json_flit/factory/intrinisic_width.rb +7 -0
- data/lib/json_flit/factory/limited_box.rb +7 -0
- data/lib/json_flit/factory/linear_progress_indicator.rb +7 -0
- data/lib/json_flit/factory/list_tile.rb +7 -0
- data/lib/json_flit/factory/list_view.rb +7 -0
- data/lib/json_flit/factory/material.rb +7 -0
- data/lib/json_flit/factory/memory_image.rb +7 -0
- data/lib/json_flit/factory/network_image.rb +7 -0
- data/lib/json_flit/factory/offstage.rb +7 -0
- data/lib/json_flit/factory/opacity.rb +7 -0
- data/lib/json_flit/factory/outlined_button.rb +7 -0
- data/lib/json_flit/factory/overflow_box.rb +7 -0
- data/lib/json_flit/factory/padding.rb +7 -0
- data/lib/json_flit/factory/placeholder.rb +7 -0
- data/lib/json_flit/factory/popup_menu_button.rb +7 -0
- data/lib/json_flit/factory/positioned.rb +7 -0
- data/lib/json_flit/factory/primary_scroll_container.rb +7 -0
- data/lib/json_flit/factory/radio.rb +7 -0
- data/lib/json_flit/factory/rich_text.rb +7 -0
- data/lib/json_flit/factory/row.rb +7 -0
- data/lib/json_flit/factory/safe_area.rb +7 -0
- data/lib/json_flit/factory/save_context.rb +7 -0
- data/lib/json_flit/factory/scaffold.rb +19 -0
- data/lib/json_flit/factory/scroll_configuration.rb +7 -0
- data/lib/json_flit/factory/scrollbar.rb +7 -0
- data/lib/json_flit/factory/set_default_value.rb +7 -0
- data/lib/json_flit/factory/set_scroll_container.rb +7 -0
- data/lib/json_flit/factory/set_value.rb +7 -0
- data/lib/json_flit/factory/single_child_scroll_view.rb +7 -0
- data/lib/json_flit/factory/sized_box.rb +7 -0
- data/lib/json_flit/factory/sliver_grid.rb +7 -0
- data/lib/json_flit/factory/sliver_list.rb +7 -0
- data/lib/json_flit/factory/sliver_padding.rb +7 -0
- data/lib/json_flit/factory/sliver_to_box_adapter.rb +7 -0
- data/lib/json_flit/factory/stack.rb +13 -0
- data/lib/json_flit/factory/switch.rb +7 -0
- data/lib/json_flit/factory/text.rb +7 -0
- data/lib/json_flit/factory/text_button.rb +7 -0
- data/lib/json_flit/factory/text_form_field.rb +7 -0
- data/lib/json_flit/factory/theme.rb +7 -0
- data/lib/json_flit/factory/tooltip.rb +7 -0
- data/lib/json_flit/factory/tween_animation.rb +7 -0
- data/lib/json_flit/factory/wrap.rb +7 -0
- data/lib/json_flit/registry.rb +98 -98
- data/lib/json_flit/version.rb +1 -1
- data/lib/json_flit.rb +4 -0
- metadata +101 -2
@@ -0,0 +1,19 @@
|
|
1
|
+
module JsonFlit
|
2
|
+
module Factory
|
3
|
+
class Scaffold
|
4
|
+
def initialize(registry:, layout:, data:)
|
5
|
+
args = layout['args']
|
6
|
+
|
7
|
+
@app_bar = JsonFlit::Builder.new(registry: registry, layout: args['appBar'], data: data)
|
8
|
+
@body = JsonFlit::Builder.new(registry: registry, layout: args['body'], data: data)
|
9
|
+
end
|
10
|
+
|
11
|
+
def build
|
12
|
+
Flit::ScaffoldComponent.new(
|
13
|
+
app_bar: @app_bar.build,
|
14
|
+
body: @body.build
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/json_flit/registry.rb
CHANGED
@@ -1,104 +1,104 @@
|
|
1
1
|
module JsonFlit
|
2
2
|
class Registry
|
3
3
|
DEFAULT_COMPONENT_LIST = {
|
4
|
-
'align' => '
|
5
|
-
'animated_align' => '
|
6
|
-
'animated_container' => '
|
7
|
-
'animated_cross_fade' => '
|
8
|
-
'animated_default_text_style' => '
|
9
|
-
'animated_opacity' => '
|
10
|
-
'animated_padding' => '
|
11
|
-
'animated_physical_model' => '
|
12
|
-
'animated_positioned' => '
|
13
|
-
'animated_positioned_directional' => '
|
14
|
-
'animated_size' => '
|
15
|
-
'animated_switcher' => '
|
16
|
-
'animated_theme' => '
|
17
|
-
'app_bar' => '
|
18
|
-
'aspect_ratio' => '
|
19
|
-
'asset_image' => '
|
20
|
-
'base' => '
|
21
|
-
'baseline' => '
|
22
|
-
'button_bar' => '
|
23
|
-
'card' => '
|
24
|
-
'center' => '
|
25
|
-
'checkbox' => '
|
26
|
-
'circular_progress_indicator' => '
|
27
|
-
'clip_oval' => '
|
28
|
-
'clip_path' => '
|
29
|
-
'clip_rect' => '
|
30
|
-
'clip_rrect' => '
|
31
|
-
'column' => '
|
32
|
-
'comment' => '
|
33
|
-
'conditional' => '
|
34
|
-
'container' => '
|
35
|
-
'cupertino_switch' => '
|
36
|
-
'custom_scroll_view' => '
|
37
|
-
'directionality' => '
|
38
|
-
'dropdown_button_form_field' => '
|
39
|
-
'dynamic' => '
|
40
|
-
'elevated_button' => '
|
41
|
-
'expanded' => '
|
42
|
-
'fitted_box' => '
|
43
|
-
'flexible' => '
|
44
|
-
'floating_action_button' => '
|
45
|
-
'form' => '
|
46
|
-
'fractional_translation' => '
|
47
|
-
'fractionally_sized' => '
|
48
|
-
'gesture_detector' => '
|
49
|
-
'grid_view' => '
|
50
|
-
'hero' => '
|
51
|
-
'icon_button' => '
|
52
|
-
'icon' => '
|
53
|
-
'ignore_pointer' => '
|
54
|
-
'indexed_stack' => '
|
55
|
-
'ink_well' => '
|
56
|
-
'input_error' => '
|
57
|
-
'interactive_viewer' => '
|
58
|
-
'intrinsic_height' => '
|
59
|
-
'intrinsic_width' => '
|
60
|
-
'limited_box' => '
|
61
|
-
'linear_progress_indicator' => '
|
62
|
-
'list_tile' => '
|
63
|
-
'list_view' => '
|
64
|
-
'material' => '
|
65
|
-
'memory_image' => '
|
66
|
-
'network_image' => '
|
67
|
-
'offstage' => '
|
68
|
-
'opacity' => '
|
69
|
-
'outlined_button' => '
|
70
|
-
'overflow_box' => '
|
71
|
-
'padding' => '
|
72
|
-
'placeholder' => '
|
73
|
-
'popup_menu_button' => '
|
74
|
-
'positioned' => '
|
75
|
-
'primary_scroll_container' => '
|
76
|
-
'radio' => '
|
77
|
-
'rich_text' => '
|
78
|
-
'row' => '
|
79
|
-
'safe_area' => '
|
80
|
-
'save_context' => '
|
81
|
-
'scaffold' => '
|
82
|
-
'scroll_configuration' => '
|
83
|
-
'scrollbar' => '
|
84
|
-
'set_default_value' => '
|
85
|
-
'set_scroll_container' => '
|
86
|
-
'set_value' => '
|
87
|
-
'single_child_scroll_view' => '
|
88
|
-
'sized_box' => '
|
89
|
-
'sliver_grid' => '
|
90
|
-
'sliver_list' => '
|
91
|
-
'sliver_padding' => '
|
92
|
-
'sliver_to_box_adapter' => '
|
93
|
-
'stack' => '
|
94
|
-
'switch' => '
|
95
|
-
'text_button' => '
|
96
|
-
'text' => '
|
97
|
-
'text_form_field' => '
|
98
|
-
'theme' => '
|
99
|
-
'tooltip' => '
|
100
|
-
'tween_animation' => '
|
101
|
-
'wrap' => '
|
4
|
+
'align' => 'JsonFlit::Factory::Align',
|
5
|
+
'animated_align' => 'JsonFlit::Factory::AnimatedAlign',
|
6
|
+
'animated_container' => 'JsonFlit::Factory::AnimatedContainer',
|
7
|
+
'animated_cross_fade' => 'JsonFlit::Factory::AnimatedCrossFade',
|
8
|
+
'animated_default_text_style' => 'JsonFlit::Factory::AnimatedDefaultTextStyle',
|
9
|
+
'animated_opacity' => 'JsonFlit::Factory::AnimatedOpacity',
|
10
|
+
'animated_padding' => 'JsonFlit::Factory::AnimatedPadding',
|
11
|
+
'animated_physical_model' => 'JsonFlit::Factory::AnimatedPhysicalModel',
|
12
|
+
'animated_positioned' => 'JsonFlit::Factory::AnimatedPositioned',
|
13
|
+
'animated_positioned_directional' => 'JsonFlit::Factory::AnimatedPositionedDirectional',
|
14
|
+
'animated_size' => 'JsonFlit::Factory::AnimateSize',
|
15
|
+
'animated_switcher' => 'JsonFlit::Factory::AnimatedSwitcher',
|
16
|
+
'animated_theme' => 'JsonFlit::Factory::AnimatedTheme',
|
17
|
+
'app_bar' => 'JsonFlit::Factory::AppBar',
|
18
|
+
'aspect_ratio' => 'JsonFlit::Factory::AspectRatio',
|
19
|
+
'asset_image' => 'JsonFlit::Factory::AssetImage',
|
20
|
+
'base' => 'JsonFlit::Factory::Base',
|
21
|
+
'baseline' => 'JsonFlit::Factory::Baseline',
|
22
|
+
'button_bar' => 'JsonFlit::Factory::ButtonBar',
|
23
|
+
'card' => 'JsonFlit::Factory::Card',
|
24
|
+
'center' => 'JsonFlit::Factory::Center',
|
25
|
+
'checkbox' => 'JsonFlit::Factory::Checkbox',
|
26
|
+
'circular_progress_indicator' => 'JsonFlit::Factory::CircularProgressIndicator',
|
27
|
+
'clip_oval' => 'JsonFlit::Factory::ClipOval',
|
28
|
+
'clip_path' => 'JsonFlit::Factory::ClipPath',
|
29
|
+
'clip_rect' => 'JsonFlit::Factory::ClipRect',
|
30
|
+
'clip_rrect' => 'JsonFlit::Factory::ClipRrect',
|
31
|
+
'column' => 'JsonFlit::Factory::Column',
|
32
|
+
'comment' => 'JsonFlit::Factory::Comment',
|
33
|
+
'conditional' => 'JsonFlit::Factory::Conditional',
|
34
|
+
'container' => 'JsonFlit::Factory::Container',
|
35
|
+
'cupertino_switch' => 'JsonFlit::Factory::CupertinoSwitch',
|
36
|
+
'custom_scroll_view' => 'JsonFlit::Factory::CustomScrollView',
|
37
|
+
'directionality' => 'JsonFlit::Factory::Directionality',
|
38
|
+
'dropdown_button_form_field' => 'JsonFlit::Factory::DropdownButtonFormField',
|
39
|
+
'dynamic' => 'JsonFlit::Factory::Dynamic',
|
40
|
+
'elevated_button' => 'JsonFlit::Factory::ElevatedButton',
|
41
|
+
'expanded' => 'JsonFlit::Factory::Expanded',
|
42
|
+
'fitted_box' => 'JsonFlit::Factory::FittedBox',
|
43
|
+
'flexible' => 'JsonFlit::Factory::Flexible',
|
44
|
+
'floating_action_button' => 'JsonFlit::Factory::FloatingActionButton',
|
45
|
+
'form' => 'JsonFlit::Factory::Form',
|
46
|
+
'fractional_translation' => 'JsonFlit::Factory::FractionalTranslation',
|
47
|
+
'fractionally_sized' => 'JsonFlit::Factory::FractionallySized',
|
48
|
+
'gesture_detector' => 'JsonFlit::Factory::GestureDetector',
|
49
|
+
'grid_view' => 'JsonFlit::Factory::GridView',
|
50
|
+
'hero' => 'JsonFlit::Factory::Hero',
|
51
|
+
'icon_button' => 'JsonFlit::Factory::IconButton',
|
52
|
+
'icon' => 'JsonFlit::Factory::Icon',
|
53
|
+
'ignore_pointer' => 'JsonFlit::Factory::IgnorePointer',
|
54
|
+
'indexed_stack' => 'JsonFlit::Factory::IndexedStack',
|
55
|
+
'ink_well' => 'JsonFlit::Factory::InkWell',
|
56
|
+
'input_error' => 'JsonFlit::Factory::InputError',
|
57
|
+
'interactive_viewer' => 'JsonFlit::Factory::InteractiveViewer',
|
58
|
+
'intrinsic_height' => 'JsonFlit::Factory::IntrinsicHeight',
|
59
|
+
'intrinsic_width' => 'JsonFlit::Factory::IntinsicWidth',
|
60
|
+
'limited_box' => 'JsonFlit::Factory::LimitedBox',
|
61
|
+
'linear_progress_indicator' => 'JsonFlit::Factory::LinearProgressIndidicator',
|
62
|
+
'list_tile' => 'JsonFlit::Factory::ListTile',
|
63
|
+
'list_view' => 'JsonFlit::Factory::ListView',
|
64
|
+
'material' => 'JsonFlit::Factory::Material',
|
65
|
+
'memory_image' => 'JsonFlit::Factory::MemoryImage',
|
66
|
+
'network_image' => 'JsonFlit::Factory::NetworkImage',
|
67
|
+
'offstage' => 'JsonFlit::Factory::Offstage',
|
68
|
+
'opacity' => 'JsonFlit::Factory::Opacity',
|
69
|
+
'outlined_button' => 'JsonFlit::Factory::OutlinedButton',
|
70
|
+
'overflow_box' => 'JsonFlit::Factory::OverflowBox',
|
71
|
+
'padding' => 'JsonFlit::Factory::Padding',
|
72
|
+
'placeholder' => 'JsonFlit::Factory::Placeholder',
|
73
|
+
'popup_menu_button' => 'JsonFlit::Factory::PopupMenuButton',
|
74
|
+
'positioned' => 'JsonFlit::Factory::Positioned',
|
75
|
+
'primary_scroll_container' => 'JsonFlit::Factory::PrimaryScrollContainer',
|
76
|
+
'radio' => 'JsonFlit::Factory::Radio',
|
77
|
+
'rich_text' => 'JsonFlit::Factory::RichText',
|
78
|
+
'row' => 'JsonFlit::Factory::Row',
|
79
|
+
'safe_area' => 'JsonFlit::Factory::SafeArea',
|
80
|
+
'save_context' => 'JsonFlit::Factory::SaveContext',
|
81
|
+
'scaffold' => 'JsonFlit::Factory::Scaffold',
|
82
|
+
'scroll_configuration' => 'JsonFlit::Factory::ScrollConfiguration',
|
83
|
+
'scrollbar' => 'JsonFlit::Factory::Scrollbar',
|
84
|
+
'set_default_value' => 'JsonFlit::Factory::SetDefaultValue',
|
85
|
+
'set_scroll_container' => 'JsonFlit::Factory::SetScrollContainer',
|
86
|
+
'set_value' => 'JsonFlit::Factory::SetValue',
|
87
|
+
'single_child_scroll_view' => 'JsonFlit::Factory::SingleChildScrollView',
|
88
|
+
'sized_box' => 'JsonFlit::Factory::SizedBox',
|
89
|
+
'sliver_grid' => 'JsonFlit::Factory::SliverGrid',
|
90
|
+
'sliver_list' => 'JsonFlit::Factory::SliverList',
|
91
|
+
'sliver_padding' => 'JsonFlit::Factory::SliverPadding',
|
92
|
+
'sliver_to_box_adapter' => 'JsonFlit::Factory::SliverToBoxAdapter',
|
93
|
+
'stack' => 'JsonFlit::Factory::Stack',
|
94
|
+
'switch' => 'JsonFlit::Factory::Switch',
|
95
|
+
'text_button' => 'JsonFlit::Factory::TextButton',
|
96
|
+
'text' => 'JsonFlit::Factory::Text',
|
97
|
+
'text_form_field' => 'JsonFlit::Factory::TextFormField',
|
98
|
+
'theme' => 'JsonFlit::Factory::Theme',
|
99
|
+
'tooltip' => 'JsonFlit::Factory::Tooltip',
|
100
|
+
'tween_animation' => 'JsonFlit::Factory::TweenAnimation',
|
101
|
+
'wrap' => 'JsonFlit::Factory::Wrap'
|
102
102
|
}.freeze
|
103
103
|
|
104
104
|
DEFAULT_METHOD_LIST = {
|
data/lib/json_flit/version.rb
CHANGED
data/lib/json_flit.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "json_flit/version"
|
4
|
+
require_relative "json_flit/registry"
|
5
|
+
require_relative "json_flit/builder"
|
6
|
+
require_relative "json_flit/factory/base"
|
7
|
+
Dir["#{File.dirname(__FILE__)}/json_flit/factory/**/*.rb"].each { |f| require f }
|
4
8
|
|
5
9
|
module JsonFlit
|
6
10
|
class Error < StandardError; end
|