From dc359d46a8aadc8677354faccf9f707eb5d858c9 Mon Sep 17 00:00:00 2001 From: Divyanshu Bhargava Date: Tue, 20 Feb 2024 14:27:37 +0400 Subject: [PATCH] Refactor imports --- examples/mirai_gallery/macos/Podfile.lock | 2 +- .../macos/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- examples/mirai_gallery/pubspec.lock | 58 +++++++++++++------ .../mirai_dialog_action.g.dart | 1 + packages/mirai/lib/src/framework/mirai.dart | 11 +--- .../src/parsers/mirai_align/mirai_align.dart | 2 +- .../parsers/mirai_center/mirai_center.dart | 2 +- .../mirai_check_box_widget.dart | 2 + .../src/parsers/mirai_form/mirai_form.dart | 2 +- .../mirai_form_field/mirai_form_field.dart | 2 + .../mirai_fractionally_sized_box.dart | 2 +- .../mirai_refresh_indicator_parser.dart | 6 +- .../parsers/mirai_switch/mirai_switch.dart | 2 + .../mirai_switch/mirai_switch_parser.dart | 2 +- .../widget/mirai_switch_widget.dart | 2 +- .../lib/src/parsers/mirai_tab/mirai_tab.dart | 2 + packages/mirai/lib/src/parsers/parsers.dart | 9 ++- packages/mirai/lib/src/utils/widget_type.dart | 2 +- 19 files changed, 73 insertions(+), 40 deletions(-) diff --git a/examples/mirai_gallery/macos/Podfile.lock b/examples/mirai_gallery/macos/Podfile.lock index 79862f06..1f6779f9 100644 --- a/examples/mirai_gallery/macos/Podfile.lock +++ b/examples/mirai_gallery/macos/Podfile.lock @@ -13,4 +13,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367 -COCOAPODS: 1.12.1 +COCOAPODS: 1.14.3 diff --git a/examples/mirai_gallery/macos/Runner.xcodeproj/project.pbxproj b/examples/mirai_gallery/macos/Runner.xcodeproj/project.pbxproj index 39f233b6..110378e8 100644 --- a/examples/mirai_gallery/macos/Runner.xcodeproj/project.pbxproj +++ b/examples/mirai_gallery/macos/Runner.xcodeproj/project.pbxproj @@ -258,7 +258,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 331C80D4294CF70F00263BE5 = { diff --git a/examples/mirai_gallery/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/examples/mirai_gallery/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index ca25b4d5..8d1ec463 100644 --- a/examples/mirai_gallery/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/examples/mirai_gallery/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ _$$MiraiDialogActionImplToJson( const _$TraversalEdgeBehaviorEnumMap = { TraversalEdgeBehavior.closedLoop: 'closedLoop', TraversalEdgeBehavior.leaveFlutterView: 'leaveFlutterView', + TraversalEdgeBehavior.parentScope: 'parentScope', }; diff --git a/packages/mirai/lib/src/framework/mirai.dart b/packages/mirai/lib/src/framework/mirai.dart index 1007bf96..e066beff 100644 --- a/packages/mirai/lib/src/framework/mirai.dart +++ b/packages/mirai/lib/src/framework/mirai.dart @@ -8,15 +8,6 @@ import 'package:mirai/src/action_parsers/action_parsers.dart'; import 'package:mirai/src/framework/mirai_registry.dart'; import 'package:mirai/src/network/mirai_network.dart'; import 'package:mirai/src/network/mirai_request.dart'; -import 'package:mirai/src/parsers/mirai_align/mirai_align_parser.dart'; -import 'package:mirai/src/parsers/mirai_center/mirai_center_parser.dart'; -import 'package:mirai/src/parsers/mirai_check_box_widget/mirai_check_box_widget_parser.dart'; -import 'package:mirai/src/parsers/mirai_form/mirai_form_parser.dart'; -import 'package:mirai/src/parsers/mirai_form_field/mirai_form_field_parser.dart'; -import 'package:mirai/src/parsers/mirai_fractionally_sized_box/mirai_fractionally_sized_box_parser.dart'; -import 'package:mirai/src/parsers/mirai_refresh_indicator/mirai_refresh_indicator_parser.dart'; -import 'package:mirai/src/parsers/mirai_switch/mirai_switch_parser.dart'; -import 'package:mirai/src/parsers/mirai_tab/mirai_tab_parser.dart'; import 'package:mirai/src/parsers/parsers.dart'; import 'package:mirai/src/utils/log.dart'; import 'package:mirai_framework/mirai_framework.dart'; @@ -58,7 +49,7 @@ class Mirai { const MiraiBottomNavigationBarParser(), const MiraiListViewParser(), const MiraiDefaultTabControllerParser(), - const MiraiScrollViewParser(), + const MiraiSingleChildScrollViewParser(), const MiraiAlertDialogParser(), const MiraiTabParser(), const MiraiFormParser(), diff --git a/packages/mirai/lib/src/parsers/mirai_align/mirai_align.dart b/packages/mirai/lib/src/parsers/mirai_align/mirai_align.dart index 3341a28f..94ee40b6 100644 --- a/packages/mirai/lib/src/parsers/mirai_align/mirai_align.dart +++ b/packages/mirai/lib/src/parsers/mirai_align/mirai_align.dart @@ -1,7 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:mirai/src/parsers/parsers.dart'; -export 'package:mirai/src/parsers/mirai_stack/mirai_stack_parser.dart'; +export 'package:mirai/src/parsers/mirai_align/mirai_align_parser.dart'; part 'mirai_align.freezed.dart'; part 'mirai_align.g.dart'; diff --git a/packages/mirai/lib/src/parsers/mirai_center/mirai_center.dart b/packages/mirai/lib/src/parsers/mirai_center/mirai_center.dart index aaf9754e..569f5ac8 100644 --- a/packages/mirai/lib/src/parsers/mirai_center/mirai_center.dart +++ b/packages/mirai/lib/src/parsers/mirai_center/mirai_center.dart @@ -1,6 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; -export 'package:mirai/src/parsers/mirai_sized_box/mirai_sized_box_parser.dart'; +export 'package:mirai/src/parsers/mirai_center/mirai_center_parser.dart'; part 'mirai_center.freezed.dart'; part 'mirai_center.g.dart'; diff --git a/packages/mirai/lib/src/parsers/mirai_check_box_widget/mirai_check_box_widget.dart b/packages/mirai/lib/src/parsers/mirai_check_box_widget/mirai_check_box_widget.dart index 726bfd09..429a9cc7 100644 --- a/packages/mirai/lib/src/parsers/mirai_check_box_widget/mirai_check_box_widget.dart +++ b/packages/mirai/lib/src/parsers/mirai_check_box_widget/mirai_check_box_widget.dart @@ -1,6 +1,8 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:mirai/src/parsers/mirai_material_color/mirai_material_color.dart'; +export 'package:mirai/src/parsers/mirai_check_box_widget/mirai_check_box_widget_parser.dart'; + part 'mirai_check_box_widget.freezed.dart'; part 'mirai_check_box_widget.g.dart'; diff --git a/packages/mirai/lib/src/parsers/mirai_form/mirai_form.dart b/packages/mirai/lib/src/parsers/mirai_form/mirai_form.dart index af09e6d3..14ff52e9 100644 --- a/packages/mirai/lib/src/parsers/mirai_form/mirai_form.dart +++ b/packages/mirai/lib/src/parsers/mirai_form/mirai_form.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -export 'package:mirai/src/parsers/mirai_form/mirai_form.dart'; +export 'package:mirai/src/parsers/mirai_form/mirai_form_parser.dart'; part 'mirai_form.freezed.dart'; part 'mirai_form.g.dart'; diff --git a/packages/mirai/lib/src/parsers/mirai_form_field/mirai_form_field.dart b/packages/mirai/lib/src/parsers/mirai_form_field/mirai_form_field.dart index 5d04cbca..d42b8af6 100644 --- a/packages/mirai/lib/src/parsers/mirai_form_field/mirai_form_field.dart +++ b/packages/mirai/lib/src/parsers/mirai_form_field/mirai_form_field.dart @@ -1,5 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; +export 'package:mirai/src/parsers/mirai_form_field/mirai_form_field_parser.dart'; + part 'mirai_form_field.freezed.dart'; part 'mirai_form_field.g.dart'; diff --git a/packages/mirai/lib/src/parsers/mirai_fractionally_sized_box/mirai_fractionally_sized_box.dart b/packages/mirai/lib/src/parsers/mirai_fractionally_sized_box/mirai_fractionally_sized_box.dart index cd1be2e7..1d40b952 100644 --- a/packages/mirai/lib/src/parsers/mirai_fractionally_sized_box/mirai_fractionally_sized_box.dart +++ b/packages/mirai/lib/src/parsers/mirai_fractionally_sized_box/mirai_fractionally_sized_box.dart @@ -1,7 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:mirai/mirai.dart'; -export 'package:mirai/src/parsers/mirai_sized_box/mirai_sized_box_parser.dart'; +export 'package:mirai/src/parsers/mirai_fractionally_sized_box/mirai_fractionally_sized_box_parser.dart'; part 'mirai_fractionally_sized_box.freezed.dart'; part 'mirai_fractionally_sized_box.g.dart'; diff --git a/packages/mirai/lib/src/parsers/mirai_refresh_indicator/mirai_refresh_indicator_parser.dart b/packages/mirai/lib/src/parsers/mirai_refresh_indicator/mirai_refresh_indicator_parser.dart index 726da9f9..5ce449ea 100644 --- a/packages/mirai/lib/src/parsers/mirai_refresh_indicator/mirai_refresh_indicator_parser.dart +++ b/packages/mirai/lib/src/parsers/mirai_refresh_indicator/mirai_refresh_indicator_parser.dart @@ -2,9 +2,11 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:mirai/mirai.dart'; +import 'package:mirai/src/framework/framework.dart'; import 'package:mirai/src/parsers/mirai_refresh_indicator/mirai_refresh_indicator.dart'; +import 'package:mirai/src/utils/color_utils.dart'; import 'package:mirai/src/utils/widget_type.dart'; +import 'package:mirai_framework/mirai_framework.dart'; class MiraiRefreshIndicatorParser extends MiraiParser { const MiraiRefreshIndicatorParser(); @@ -63,7 +65,7 @@ class _RefreshIndicatorWidgetState extends State<_RefreshIndicatorWidget> { } } }, - color: widget.model.color.toColor(context), + color: widget.model.color?.toColor(context), backgroundColor: widget.model.backgroundColor.toColor(context), semanticsLabel: widget.model.semanticsLabel, semanticsValue: widget.model.semanticsValue, diff --git a/packages/mirai/lib/src/parsers/mirai_switch/mirai_switch.dart b/packages/mirai/lib/src/parsers/mirai_switch/mirai_switch.dart index 9c9a8ae4..e580a744 100644 --- a/packages/mirai/lib/src/parsers/mirai_switch/mirai_switch.dart +++ b/packages/mirai/lib/src/parsers/mirai_switch/mirai_switch.dart @@ -4,6 +4,8 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:mirai/mirai.dart'; import 'package:mirai/src/parsers/mirai_material_color/mirai_material_color.dart'; +export 'package:mirai/src/parsers/mirai_switch/mirai_switch_parser.dart'; + part 'mirai_switch.freezed.dart'; part 'mirai_switch.g.dart'; diff --git a/packages/mirai/lib/src/parsers/mirai_switch/mirai_switch_parser.dart b/packages/mirai/lib/src/parsers/mirai_switch/mirai_switch_parser.dart index f4d7dde4..d60c1f11 100644 --- a/packages/mirai/lib/src/parsers/mirai_switch/mirai_switch_parser.dart +++ b/packages/mirai/lib/src/parsers/mirai_switch/mirai_switch_parser.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:mirai/mirai.dart'; import 'package:mirai/src/parsers/mirai_switch/mirai_switch.dart'; import 'package:mirai/src/parsers/mirai_switch/widget/mirai_switch_widget.dart'; import 'package:mirai/src/utils/widget_type.dart'; +import 'package:mirai_framework/mirai_framework.dart'; class MiraiSwitchParser extends MiraiParser { const MiraiSwitchParser(); diff --git a/packages/mirai/lib/src/parsers/mirai_switch/widget/mirai_switch_widget.dart b/packages/mirai/lib/src/parsers/mirai_switch/widget/mirai_switch_widget.dart index 8cf34d74..c0c15e9a 100644 --- a/packages/mirai/lib/src/parsers/mirai_switch/widget/mirai_switch_widget.dart +++ b/packages/mirai/lib/src/parsers/mirai_switch/widget/mirai_switch_widget.dart @@ -1,6 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:mirai/mirai.dart'; +import 'package:mirai/src/framework/framework.dart'; import 'package:mirai/src/parsers/mirai_material_color/mirai_material_color.dart'; import 'package:mirai/src/parsers/mirai_switch/mirai_switch.dart'; diff --git a/packages/mirai/lib/src/parsers/mirai_tab/mirai_tab.dart b/packages/mirai/lib/src/parsers/mirai_tab/mirai_tab.dart index fef8b8fa..305934e5 100644 --- a/packages/mirai/lib/src/parsers/mirai_tab/mirai_tab.dart +++ b/packages/mirai/lib/src/parsers/mirai_tab/mirai_tab.dart @@ -1,6 +1,8 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:mirai/src/parsers/mirai_edge_insets/mirai_edge_insets.dart'; +export 'package:mirai/src/parsers/mirai_tab/mirai_tab_parser.dart'; + part 'mirai_tab.freezed.dart'; part 'mirai_tab.g.dart'; diff --git a/packages/mirai/lib/src/parsers/parsers.dart b/packages/mirai/lib/src/parsers/parsers.dart index 20ccab00..6b55a48b 100644 --- a/packages/mirai/lib/src/parsers/parsers.dart +++ b/packages/mirai/lib/src/parsers/parsers.dart @@ -17,6 +17,8 @@ export 'package:mirai/src/parsers/mirai_box_shadow/mirai_box_shadow.dart'; export 'package:mirai/src/parsers/mirai_button_style/mirai_button_style.dart'; export 'package:mirai/src/parsers/mirai_card/mirai_card.dart'; export 'package:mirai/src/parsers/mirai_card_theme_data/mirai_card_theme_data.dart'; +export 'package:mirai/src/parsers/mirai_center/mirai_center.dart'; +export 'package:mirai/src/parsers/mirai_check_box_widget/mirai_check_box_widget.dart'; export 'package:mirai/src/parsers/mirai_column/mirai_column.dart'; export 'package:mirai/src/parsers/mirai_container/mirai_container.dart'; export 'package:mirai/src/parsers/mirai_container_image/mirai_container_image.dart'; @@ -29,6 +31,8 @@ export 'package:mirai/src/parsers/mirai_flexible/mirai_flexible.dart'; export 'package:mirai/src/parsers/mirai_floating_action_button/mirai_floating_action_button.dart'; export 'package:mirai/src/parsers/mirai_floating_action_button_theme_data/mirai_floating_action_button_theme_data.dart'; export 'package:mirai/src/parsers/mirai_form/mirai_form.dart'; +export 'package:mirai/src/parsers/mirai_form_field/mirai_form_field.dart'; +export 'package:mirai/src/parsers/mirai_fractionally_sized_box/mirai_fractionally_sized_box.dart'; export 'package:mirai/src/parsers/mirai_gradient/mirai_gradient.dart'; export 'package:mirai/src/parsers/mirai_icon/mirai_icon.dart'; export 'package:mirai/src/parsers/mirai_icon_button/mirai_icon_button.dart'; @@ -45,13 +49,16 @@ export 'package:mirai/src/parsers/mirai_outlined_button/mirai_outlined_button.da export 'package:mirai/src/parsers/mirai_padding/mirai_padding.dart'; export 'package:mirai/src/parsers/mirai_page_view/mirai_page_view.dart'; export 'package:mirai/src/parsers/mirai_positioned/mirai_positioned.dart'; +export 'package:mirai/src/parsers/mirai_refresh_indicator/mirai_refresh_indicator.dart'; export 'package:mirai/src/parsers/mirai_row/mirai_row.dart'; export 'package:mirai/src/parsers/mirai_safe_area/mirai_safe_area.dart'; export 'package:mirai/src/parsers/mirai_scaffold/mirai_scaffold.dart'; -export 'package:mirai/src/parsers/mirai_scroll_view/mirai_scroll_view.dart'; +export 'package:mirai/src/parsers/mirai_single_child_scroll_view/mirai_single_child_scroll_view.dart'; export 'package:mirai/src/parsers/mirai_size/mirai_size.dart'; export 'package:mirai/src/parsers/mirai_sized_box/mirai_sized_box.dart'; export 'package:mirai/src/parsers/mirai_stack/mirai_stack.dart'; +export 'package:mirai/src/parsers/mirai_switch/mirai_switch.dart'; +export 'package:mirai/src/parsers/mirai_tab/mirai_tab.dart'; export 'package:mirai/src/parsers/mirai_tab_bar/mirai_tab_bar.dart'; export 'package:mirai/src/parsers/mirai_tab_bar_theme_data/mirai_tab_bar_theme_data.dart'; export 'package:mirai/src/parsers/mirai_tab_bar_view/mirai_tab_bar_view.dart'; diff --git a/packages/mirai/lib/src/utils/widget_type.dart b/packages/mirai/lib/src/utils/widget_type.dart index d9c2e9e4..e28b3f50 100644 --- a/packages/mirai/lib/src/utils/widget_type.dart +++ b/packages/mirai/lib/src/utils/widget_type.dart @@ -28,7 +28,7 @@ enum WidgetType { bottomNavigationBar, listView, defaultTabController, - scrollView, + singleChildScrollView, tab, form, formField,