├── .code.yml ├── .gitignore ├── CHANGELOG.md ├── Documentation └── 接入指南.md ├── LICENSE ├── README.md ├── android ├── .gitignore ├── CMakeLists.txt ├── build.gradle ├── config.gradle ├── consumer-rules.pro ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── proguard-rules.pro ├── settings.gradle └── src │ ├── main │ ├── AndroidManifest.xml │ ├── cpp │ │ ├── include │ │ │ ├── MXFFICallbackManager.h │ │ │ ├── jni_helper.h │ │ │ ├── mxflutter_app.h │ │ │ └── mxflutter_ffi.h │ │ └── sdk │ │ │ ├── CMakeLists.txt │ │ │ ├── MXFFICallbackManager.cpp │ │ │ ├── jni_helper.cpp │ │ │ ├── mxflutter_app.cpp │ │ │ └── mxflutter_ffi.cpp │ ├── java │ │ └── com │ │ │ └── mojitox │ │ │ └── mxflutter │ │ │ ├── MXFlutterPlugin.java │ │ │ └── framework │ │ │ ├── JsFlutterApp.java │ │ │ ├── JsFlutterEngine.java │ │ │ ├── callback │ │ │ ├── ExecuteScriptCallback.java │ │ │ └── InvokeJSValueCallback.java │ │ │ ├── common │ │ │ └── JsLoadErrorMsg.kt │ │ │ ├── constants │ │ │ ├── ApiName.java │ │ │ ├── JsConstant.java │ │ │ ├── JsObjectType.java │ │ │ ├── MethodChannelConstant.java │ │ │ └── MxConfig.java │ │ │ ├── executor │ │ │ ├── JobExecutor.java │ │ │ ├── JsTask.java │ │ │ ├── TaskName.java │ │ │ ├── ThreadExecutor.java │ │ │ └── UiThread.java │ │ │ ├── ffi │ │ │ └── MxFlutterFfi.java │ │ │ ├── js │ │ │ ├── BaseJsEngine.java │ │ │ ├── BaseJsExecutor.java │ │ │ ├── IJsEngine.java │ │ │ ├── IJsExecutor.java │ │ │ └── JsEngineLoader.java │ │ │ └── utils │ │ │ ├── ClassUtils.java │ │ │ ├── FileUtils.java │ │ │ ├── MxLog.java │ │ │ └── SafelyLibraryLoader.java │ ├── jniLibs │ │ ├── arm64-v8a │ │ │ ├── libj2v8.so │ │ │ └── libmxflutter.so │ │ ├── armeabi-v7a │ │ │ ├── libj2v8.so │ │ │ └── libmxflutter.so │ │ ├── x86 │ │ │ ├── libj2v8.so │ │ │ └── libmxflutter.so │ │ └── x86_64 │ │ │ ├── libj2v8.so │ │ │ └── libmxflutter.so │ └── v8 │ │ └── com │ │ ├── debug │ │ ├── Debugger.kt │ │ ├── MXDebug.kt │ │ ├── Mappers.kt │ │ ├── Protocol.kt │ │ ├── Runtime.kt │ │ ├── ScriptProviderImp.kt │ │ ├── ScriptSourceProvider.kt │ │ ├── StethoHelper.kt │ │ └── V8Messenger.kt │ │ ├── eclipsesource │ │ └── v8 │ │ │ ├── JavaCallback.java │ │ │ ├── JavaVoidCallback.java │ │ │ ├── LibraryLoader.java │ │ │ ├── NodeJS.java │ │ │ ├── Platform.java │ │ │ ├── PlatformDetector.java │ │ │ ├── ReferenceHandler.java │ │ │ ├── Releasable.java │ │ │ ├── SignatureProvider.java │ │ │ ├── V8.java │ │ │ ├── V8Array.java │ │ │ ├── V8ArrayBuffer.java │ │ │ ├── V8Function.java │ │ │ ├── V8Locker.java │ │ │ ├── V8Object.java │ │ │ ├── V8ResultUndefined.java │ │ │ ├── V8RuntimeException.java │ │ │ ├── V8ScriptCompilationException.java │ │ │ ├── V8ScriptException.java │ │ │ ├── V8ScriptExecutionException.java │ │ │ ├── V8TypedArray.java │ │ │ ├── V8Value.java │ │ │ ├── debug │ │ │ ├── BreakEvent.java │ │ │ ├── BreakHandler.java │ │ │ ├── CompileEvent.java │ │ │ ├── DebugHandler.java │ │ │ ├── EventData.java │ │ │ ├── ExceptionEvent.java │ │ │ ├── ExecutionState.java │ │ │ ├── ScriptBreakPoint.java │ │ │ ├── StepAction.java │ │ │ ├── V8DebugServer.java │ │ │ └── mirror │ │ │ │ ├── ArrayMirror.java │ │ │ │ ├── BooleanMirror.java │ │ │ │ ├── Frame.java │ │ │ │ ├── FunctionMirror.java │ │ │ │ ├── Mirror.java │ │ │ │ ├── NullMirror.java │ │ │ │ ├── NumberMirror.java │ │ │ │ ├── ObjectMirror.java │ │ │ │ ├── PropertiesArray.java │ │ │ │ ├── PropertyMirror.java │ │ │ │ ├── Scope.java │ │ │ │ ├── SourceLocation.java │ │ │ │ ├── StringMirror.java │ │ │ │ ├── UndefinedMirror.java │ │ │ │ └── ValueMirror.java │ │ │ ├── inspector │ │ │ ├── DebuggerConnectionListener.java │ │ │ ├── V8Inspector.java │ │ │ └── V8InspectorDelegate.java │ │ │ └── utils │ │ │ ├── ArrayBuffer.java │ │ │ ├── ConcurrentV8.java │ │ │ ├── MemoryManager.java │ │ │ ├── SingleTypeAdapter.java │ │ │ ├── TypeAdapter.java │ │ │ ├── TypedArray.java │ │ │ ├── V8Executor.java │ │ │ ├── V8Map.java │ │ │ ├── V8ObjectUtils.java │ │ │ ├── V8PropertyMap.java │ │ │ ├── V8Runnable.java │ │ │ └── V8Thread.java │ │ └── mojitox │ │ └── mxflutter │ │ └── framework │ │ └── js │ │ ├── JsEngineProvider.java │ │ └── v8 │ │ ├── Console.java │ │ ├── MXNativeJSFlutterApp.java │ │ ├── V8JsEngine.java │ │ ├── V8JsExecutor.java │ │ └── V8JsModule.java │ ├── test │ └── java │ │ └── com │ │ └── mojitox │ │ └── mxflutter │ │ └── framework │ │ ├── JsFlutterAppTest.java │ │ ├── JsFlutterEngineTest.java │ │ ├── MockApplication.java │ │ ├── constants │ │ └── MxConfigTest.java │ │ ├── js │ │ └── JsEngineProviderTest.java │ │ └── utils │ │ └── FileUtilTest.java │ ├── testV8 │ └── java │ │ └── com │ │ └── mojitox │ │ └── mxflutter │ │ └── framework │ │ └── ffi │ │ └── MxFlutterFfiTest.java │ └── testX5 │ └── java │ └── com │ └── mojitox │ └── mxflutter │ └── framework │ └── ffi │ └── MxFlutterFfiTest.java ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── mojitox │ │ │ │ └── mxflutter │ │ │ │ └── example │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ ├── build.gradle │ ├── gradle.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── MXFlutterOCFrameworkTests │ │ └── Info.plist │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ └── project.pbxproj │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ └── main.dart ├── mxflutter-ts-proj │ └── mxflutter-homepage │ │ ├── .gitignore │ │ ├── .prettierrc.yml │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ └── index.ts │ │ ├── tsconfig.es5.json │ │ ├── tsconfig.json │ │ └── yarn.lock ├── mxflutter_js_bundle │ └── bizBundle.zip ├── pubspec.lock ├── pubspec.yaml ├── test │ └── widget_test.dart └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ └── Icon-512.png │ ├── index.html │ └── manifest.json ├── ios ├── .clang-format ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── MXFlutterOCFramework │ │ ├── Common │ │ │ ├── MXCommon.h │ │ │ ├── MXCommon.m │ │ │ └── MXFDispose.h │ │ ├── JSBridge │ │ │ ├── MXBridgeModule.h │ │ │ ├── MXJSBridge.h │ │ │ └── MXJSBridge.m │ │ ├── JSModule.h │ │ ├── JSModule.m │ │ ├── MXFFIImpl.h │ │ ├── MXFFIImpl.m │ │ ├── MXJSAPI.h │ │ ├── MXJSAPI.m │ │ ├── MXJSEngine.h │ │ ├── MXJSEngine.m │ │ ├── MXJSExecutor.h │ │ ├── MXJSExecutor.m │ │ ├── MXJSFlutterApp.h │ │ ├── MXJSFlutterApp.m │ │ ├── MXJSFlutterDefines.h │ │ ├── MXJSFlutterEngine.h │ │ └── MXJSFlutterEngine.m │ ├── MXFlutterPlugin.h │ └── MXFlutterPlugin.m ├── MXFFI │ ├── MXFFI.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── MXFFI.xcscheme │ ├── MXFFI │ │ ├── Info.plist │ │ ├── MXFFI.h │ │ ├── MXFFI.m │ │ ├── MXFFICallbackManager.h │ │ └── MXFFICallbackManager.mm │ ├── MXFFITests │ │ ├── Info.plist │ │ └── MXFFITests.m │ ├── Products │ │ └── MXFFI.framework │ │ │ ├── Headers │ │ │ ├── MXFFI.h │ │ │ └── MXFFICallbackManager.h │ │ │ ├── Info.plist │ │ │ ├── MXFFI │ │ │ └── Modules │ │ │ └── module.modulemap │ └── readme.txt ├── Tests │ ├── MXFlutterOCFrameworkTest+bridge.h │ └── MXFlutterOCFrameworkTests.m └── mxflutter.podspec ├── js_lib └── main.zip ├── lib ├── mxflutter.dart ├── mxflutter_test.dart └── src │ ├── bundle_zip │ ├── mx_bundle_zip.dart │ └── src │ │ ├── bundle_zip_manager.dart │ │ ├── module_info.dart │ │ └── utils.dart │ ├── ffi │ ├── ffi.dart │ └── ffi_callback_manager.dart │ ├── mirror │ ├── mx_mirror.dart │ ├── readme.md │ └── src │ │ ├── mx_closure.dart │ │ ├── mx_common_function.dart │ │ ├── mx_function_invoke.dart │ │ ├── mx_mirror.dart │ │ └── mx_mirror_object.dart │ ├── mirror_reg_fun_map │ ├── mx_mirror_common_func.dart │ ├── mx_mirror_func_reg.dart │ └── mx_mirror_widget_func.dart │ ├── mx_build_owner.dart │ ├── mx_common.dart │ ├── mx_flutter.dart │ ├── mx_flutter_app.dart │ ├── mx_handler.dart │ ├── mx_host_widget.dart │ ├── mx_js_bridge.dart │ ├── mx_mixin.dart │ ├── mx_platform_channel.dart │ ├── mx_widget.dart │ ├── mx_widgets_binding_proxy.dart │ ├── widgets │ ├── mx_widgets.dart │ └── src │ │ └── packages │ │ ├── flutter │ │ ├── animation.dart │ │ ├── cupertino.dart │ │ ├── foundation.dart │ │ ├── gestures.dart │ │ ├── material.dart │ │ ├── painting.dart │ │ ├── physics.dart │ │ ├── rendering.dart │ │ ├── scheduler.dart │ │ ├── semantics.dart │ │ ├── services.dart │ │ ├── src │ │ │ ├── animation │ │ │ │ ├── animation.dart │ │ │ │ ├── animation_controller.dart │ │ │ │ ├── animations.dart │ │ │ │ ├── curves.dart │ │ │ │ ├── tween.dart │ │ │ │ └── tween_sequence.dart │ │ │ ├── cupertino │ │ │ │ ├── action_sheet.dart │ │ │ │ ├── activity_indicator.dart │ │ │ │ ├── app.dart │ │ │ │ ├── bottom_tab_bar.dart │ │ │ │ ├── button.dart │ │ │ │ ├── colors.dart │ │ │ │ ├── context_menu.dart │ │ │ │ ├── context_menu_action.dart │ │ │ │ ├── date_picker.dart │ │ │ │ ├── dialog.dart │ │ │ │ ├── icon_theme_data.dart │ │ │ │ ├── icons.dart │ │ │ │ ├── interface_level.dart │ │ │ │ ├── localizations.dart │ │ │ │ ├── nav_bar.dart │ │ │ │ ├── page_scaffold.dart │ │ │ │ ├── picker.dart │ │ │ │ ├── refresh.dart │ │ │ │ ├── route.dart │ │ │ │ ├── scrollbar.dart │ │ │ │ ├── segmented_control.dart │ │ │ │ ├── slider.dart │ │ │ │ ├── sliding_segmented_control.dart │ │ │ │ ├── switch.dart │ │ │ │ ├── tab_scaffold.dart │ │ │ │ ├── tab_view.dart │ │ │ │ ├── text_field.dart │ │ │ │ ├── text_selection.dart │ │ │ │ ├── text_theme.dart │ │ │ │ ├── theme.dart │ │ │ │ └── thumb_painter.dart │ │ │ ├── foundation │ │ │ │ ├── annotations.dart │ │ │ │ ├── basic_types.dart │ │ │ │ ├── binding.dart │ │ │ │ ├── bitfield.dart │ │ │ │ ├── change_notifier.dart │ │ │ │ ├── diagnostics.dart │ │ │ │ ├── key.dart │ │ │ │ ├── licenses.dart │ │ │ │ ├── node.dart │ │ │ │ ├── platform.dart │ │ │ │ ├── serialization.dart │ │ │ │ ├── stack_frame.dart │ │ │ │ ├── synchronous_future.dart │ │ │ │ └── unicode.dart │ │ │ ├── gestures │ │ │ │ ├── arena.dart │ │ │ │ ├── converter.dart │ │ │ │ ├── drag.dart │ │ │ │ ├── drag_details.dart │ │ │ │ ├── eager.dart │ │ │ │ ├── events.dart │ │ │ │ ├── force_press.dart │ │ │ │ ├── hit_test.dart │ │ │ │ ├── long_press.dart │ │ │ │ ├── lsq_solver.dart │ │ │ │ ├── monodrag.dart │ │ │ │ ├── multidrag.dart │ │ │ │ ├── multitap.dart │ │ │ │ ├── pointer_router.dart │ │ │ │ ├── pointer_signal_resolver.dart │ │ │ │ ├── recognizer.dart │ │ │ │ ├── resampler.dart │ │ │ │ ├── scale.dart │ │ │ │ ├── tap.dart │ │ │ │ ├── team.dart │ │ │ │ └── velocity_tracker.dart │ │ │ ├── material │ │ │ │ ├── about.dart │ │ │ │ ├── animated_icons.dart │ │ │ │ ├── app.dart │ │ │ │ ├── app_bar.dart │ │ │ │ ├── app_bar_theme.dart │ │ │ │ ├── arc.dart │ │ │ │ ├── back_button.dart │ │ │ │ ├── banner.dart │ │ │ │ ├── banner_theme.dart │ │ │ │ ├── bottom_app_bar.dart │ │ │ │ ├── bottom_app_bar_theme.dart │ │ │ │ ├── bottom_navigation_bar.dart │ │ │ │ ├── bottom_navigation_bar_theme.dart │ │ │ │ ├── bottom_sheet.dart │ │ │ │ ├── bottom_sheet_theme.dart │ │ │ │ ├── button.dart │ │ │ │ ├── button_bar.dart │ │ │ │ ├── button_bar_theme.dart │ │ │ │ ├── button_style.dart │ │ │ │ ├── button_style_button.dart │ │ │ │ ├── button_theme.dart │ │ │ │ ├── card.dart │ │ │ │ ├── card_theme.dart │ │ │ │ ├── checkbox.dart │ │ │ │ ├── checkbox_list_tile.dart │ │ │ │ ├── chip.dart │ │ │ │ ├── chip_theme.dart │ │ │ │ ├── circle_avatar.dart │ │ │ │ ├── color_scheme.dart │ │ │ │ ├── colors.dart │ │ │ │ ├── data_table.dart │ │ │ │ ├── data_table_source.dart │ │ │ │ ├── data_table_theme.dart │ │ │ │ ├── dialog.dart │ │ │ │ ├── dialog_theme.dart │ │ │ │ ├── divider.dart │ │ │ │ ├── divider_theme.dart │ │ │ │ ├── drawer.dart │ │ │ │ ├── drawer_header.dart │ │ │ │ ├── dropdown.dart │ │ │ │ ├── elevated_button.dart │ │ │ │ ├── elevated_button_theme.dart │ │ │ │ ├── elevation_overlay.dart │ │ │ │ ├── expand_icon.dart │ │ │ │ ├── expansion_panel.dart │ │ │ │ ├── expansion_tile.dart │ │ │ │ ├── feedback.dart │ │ │ │ ├── flat_button.dart │ │ │ │ ├── flexible_space_bar.dart │ │ │ │ ├── floating_action_button.dart │ │ │ │ ├── floating_action_button_location.dart │ │ │ │ ├── floating_action_button_theme.dart │ │ │ │ ├── flutter_logo.dart │ │ │ │ ├── grid_tile.dart │ │ │ │ ├── grid_tile_bar.dart │ │ │ │ ├── icon_button.dart │ │ │ │ ├── icons.dart │ │ │ │ ├── ink_decoration.dart │ │ │ │ ├── ink_highlight.dart │ │ │ │ ├── ink_ripple.dart │ │ │ │ ├── ink_splash.dart │ │ │ │ ├── ink_well.dart │ │ │ │ ├── input_border.dart │ │ │ │ ├── input_decorator.dart │ │ │ │ ├── list_tile.dart │ │ │ │ ├── material.dart │ │ │ │ ├── material_button.dart │ │ │ │ ├── material_localizations.dart │ │ │ │ ├── material_state.dart │ │ │ │ ├── mergeable_material.dart │ │ │ │ ├── navigation_rail.dart │ │ │ │ ├── navigation_rail_theme.dart │ │ │ │ ├── outline_button.dart │ │ │ │ ├── outlined_button.dart │ │ │ │ ├── outlined_button_theme.dart │ │ │ │ ├── page.dart │ │ │ │ ├── page_transitions_theme.dart │ │ │ │ ├── paginated_data_table.dart │ │ │ │ ├── pickers │ │ │ │ │ ├── calendar_date_picker.dart │ │ │ │ │ ├── calendar_date_range_picker.dart │ │ │ │ │ ├── date_picker_common.dart │ │ │ │ │ ├── date_picker_deprecated.dart │ │ │ │ │ ├── date_picker_header.dart │ │ │ │ │ ├── input_date_picker.dart │ │ │ │ │ └── input_date_range_picker.dart │ │ │ │ ├── popup_menu.dart │ │ │ │ ├── popup_menu_theme.dart │ │ │ │ ├── progress_indicator.dart │ │ │ │ ├── radio.dart │ │ │ │ ├── radio_list_tile.dart │ │ │ │ ├── raised_button.dart │ │ │ │ ├── range_slider.dart │ │ │ │ ├── refresh_indicator.dart │ │ │ │ ├── reorderable_list.dart │ │ │ │ ├── scaffold.dart │ │ │ │ ├── scrollbar.dart │ │ │ │ ├── search.dart │ │ │ │ ├── selectable_text.dart │ │ │ │ ├── slider.dart │ │ │ │ ├── slider_theme.dart │ │ │ │ ├── snack_bar.dart │ │ │ │ ├── snack_bar_theme.dart │ │ │ │ ├── stepper.dart │ │ │ │ ├── switch.dart │ │ │ │ ├── switch_list_tile.dart │ │ │ │ ├── tab_bar_theme.dart │ │ │ │ ├── tab_controller.dart │ │ │ │ ├── tab_indicator.dart │ │ │ │ ├── tabs.dart │ │ │ │ ├── text_button.dart │ │ │ │ ├── text_button_theme.dart │ │ │ │ ├── text_field.dart │ │ │ │ ├── text_form_field.dart │ │ │ │ ├── text_selection_theme.dart │ │ │ │ ├── text_theme.dart │ │ │ │ ├── theme.dart │ │ │ │ ├── theme_data.dart │ │ │ │ ├── time.dart │ │ │ │ ├── time_picker.dart │ │ │ │ ├── time_picker_theme.dart │ │ │ │ ├── toggle_buttons.dart │ │ │ │ ├── toggle_buttons_theme.dart │ │ │ │ ├── toggleable.dart │ │ │ │ ├── tooltip.dart │ │ │ │ ├── tooltip_theme.dart │ │ │ │ ├── typography.dart │ │ │ │ └── user_accounts_drawer_header.dart │ │ │ ├── painting │ │ │ │ ├── alignment.dart │ │ │ │ ├── basic_types.dart │ │ │ │ ├── beveled_rectangle_border.dart │ │ │ │ ├── border_radius.dart │ │ │ │ ├── borders.dart │ │ │ │ ├── box_border.dart │ │ │ │ ├── box_decoration.dart │ │ │ │ ├── box_fit.dart │ │ │ │ ├── box_shadow.dart │ │ │ │ ├── circle_border.dart │ │ │ │ ├── clip.dart │ │ │ │ ├── colors.dart │ │ │ │ ├── continuous_rectangle_border.dart │ │ │ │ ├── debug.dart │ │ │ │ ├── decoration.dart │ │ │ │ ├── decoration_image.dart │ │ │ │ ├── edge_insets.dart │ │ │ │ ├── flutter_logo.dart │ │ │ │ ├── fractional_offset.dart │ │ │ │ ├── gradient.dart │ │ │ │ ├── image_cache.dart │ │ │ │ ├── image_provider.dart │ │ │ │ ├── image_resolution.dart │ │ │ │ ├── image_stream.dart │ │ │ │ ├── inline_span.dart │ │ │ │ ├── matrix_utils.dart │ │ │ │ ├── notched_shapes.dart │ │ │ │ ├── placeholder_span.dart │ │ │ │ ├── rounded_rectangle_border.dart │ │ │ │ ├── shader_warm_up.dart │ │ │ │ ├── shape_decoration.dart │ │ │ │ ├── stadium_border.dart │ │ │ │ ├── strut_style.dart │ │ │ │ ├── text_painter.dart │ │ │ │ ├── text_span.dart │ │ │ │ └── text_style.dart │ │ │ ├── physics │ │ │ │ ├── clamped_simulation.dart │ │ │ │ ├── friction_simulation.dart │ │ │ │ ├── gravity_simulation.dart │ │ │ │ ├── simulation.dart │ │ │ │ ├── spring_simulation.dart │ │ │ │ └── tolerance.dart │ │ │ ├── rendering │ │ │ │ ├── animated_size.dart │ │ │ │ ├── binding.dart │ │ │ │ ├── box.dart │ │ │ │ ├── custom_layout.dart │ │ │ │ ├── custom_paint.dart │ │ │ │ ├── editable.dart │ │ │ │ ├── error.dart │ │ │ │ ├── flex.dart │ │ │ │ ├── flow.dart │ │ │ │ ├── image.dart │ │ │ │ ├── layer.dart │ │ │ │ ├── list_body.dart │ │ │ │ ├── list_wheel_viewport.dart │ │ │ │ ├── mouse_cursor.dart │ │ │ │ ├── mouse_tracking.dart │ │ │ │ ├── object.dart │ │ │ │ ├── paragraph.dart │ │ │ │ ├── performance_overlay.dart │ │ │ │ ├── platform_view.dart │ │ │ │ ├── proxy_box.dart │ │ │ │ ├── proxy_sliver.dart │ │ │ │ ├── rotated_box.dart │ │ │ │ ├── shifted_box.dart │ │ │ │ ├── sliver.dart │ │ │ │ ├── sliver_fill.dart │ │ │ │ ├── sliver_fixed_extent_list.dart │ │ │ │ ├── sliver_grid.dart │ │ │ │ ├── sliver_list.dart │ │ │ │ ├── sliver_multi_box_adaptor.dart │ │ │ │ ├── sliver_padding.dart │ │ │ │ ├── sliver_persistent_header.dart │ │ │ │ ├── stack.dart │ │ │ │ ├── table.dart │ │ │ │ ├── table_border.dart │ │ │ │ ├── texture.dart │ │ │ │ ├── tweens.dart │ │ │ │ ├── view.dart │ │ │ │ ├── viewport.dart │ │ │ │ ├── viewport_offset.dart │ │ │ │ └── wrap.dart │ │ │ ├── scheduler │ │ │ │ ├── binding.dart │ │ │ │ ├── priority.dart │ │ │ │ └── ticker.dart │ │ │ ├── semantics │ │ │ │ ├── semantics.dart │ │ │ │ ├── semantics_event.dart │ │ │ │ └── semantics_service.dart │ │ │ ├── services │ │ │ │ ├── asset_bundle.dart │ │ │ │ ├── autofill.dart │ │ │ │ ├── binary_messenger.dart │ │ │ │ ├── clipboard.dart │ │ │ │ ├── font_loader.dart │ │ │ │ ├── haptic_feedback.dart │ │ │ │ ├── keyboard_key.dart │ │ │ │ ├── message_codec.dart │ │ │ │ ├── message_codecs.dart │ │ │ │ ├── platform_channel.dart │ │ │ │ ├── platform_messages.dart │ │ │ │ ├── platform_views.dart │ │ │ │ ├── raw_keyboard.dart │ │ │ │ ├── raw_keyboard_android.dart │ │ │ │ ├── raw_keyboard_fuchsia.dart │ │ │ │ ├── raw_keyboard_linux.dart │ │ │ │ ├── raw_keyboard_macos.dart │ │ │ │ ├── raw_keyboard_web.dart │ │ │ │ ├── raw_keyboard_windows.dart │ │ │ │ ├── restoration.dart │ │ │ │ ├── system_channels.dart │ │ │ │ ├── system_chrome.dart │ │ │ │ ├── system_navigator.dart │ │ │ │ ├── system_sound.dart │ │ │ │ ├── text_editing.dart │ │ │ │ ├── text_formatter.dart │ │ │ │ └── text_input.dart │ │ │ └── widgets │ │ │ │ ├── actions.dart │ │ │ │ ├── animated_cross_fade.dart │ │ │ │ ├── animated_list.dart │ │ │ │ ├── animated_size.dart │ │ │ │ ├── animated_switcher.dart │ │ │ │ ├── annotated_region.dart │ │ │ │ ├── app.dart │ │ │ │ ├── async.dart │ │ │ │ ├── autofill.dart │ │ │ │ ├── automatic_keep_alive.dart │ │ │ │ ├── banner.dart │ │ │ │ ├── basic.dart │ │ │ │ ├── binding.dart │ │ │ │ ├── bottom_navigation_bar_item.dart │ │ │ │ ├── color_filter.dart │ │ │ │ ├── container.dart │ │ │ │ ├── dismissible.dart │ │ │ │ ├── disposable_build_context.dart │ │ │ │ ├── drag_target.dart │ │ │ │ ├── draggable_scrollable_sheet.dart │ │ │ │ ├── dual_transition_builder.dart │ │ │ │ ├── editable_text.dart │ │ │ │ ├── fade_in_image.dart │ │ │ │ ├── focus_manager.dart │ │ │ │ ├── focus_scope.dart │ │ │ │ ├── focus_traversal.dart │ │ │ │ ├── form.dart │ │ │ │ ├── framework.dart │ │ │ │ ├── gesture_detector.dart │ │ │ │ ├── grid_paper.dart │ │ │ │ ├── heroes.dart │ │ │ │ ├── icon.dart │ │ │ │ ├── icon_data.dart │ │ │ │ ├── icon_theme.dart │ │ │ │ ├── icon_theme_data.dart │ │ │ │ ├── image.dart │ │ │ │ ├── image_filter.dart │ │ │ │ ├── image_icon.dart │ │ │ │ ├── implicit_animations.dart │ │ │ │ ├── inherited_model.dart │ │ │ │ ├── inherited_notifier.dart │ │ │ │ ├── inherited_theme.dart │ │ │ │ ├── interactive_viewer.dart │ │ │ │ ├── layout_builder.dart │ │ │ │ ├── list_wheel_scroll_view.dart │ │ │ │ ├── localizations.dart │ │ │ │ ├── media_query.dart │ │ │ │ ├── modal_barrier.dart │ │ │ │ ├── navigation_toolbar.dart │ │ │ │ ├── navigator.dart │ │ │ │ ├── nested_scroll_view.dart │ │ │ │ ├── notification_listener.dart │ │ │ │ ├── orientation_builder.dart │ │ │ │ ├── overflow_bar.dart │ │ │ │ ├── overlay.dart │ │ │ │ ├── overscroll_indicator.dart │ │ │ │ ├── page_storage.dart │ │ │ │ ├── page_view.dart │ │ │ │ ├── pages.dart │ │ │ │ ├── performance_overlay.dart │ │ │ │ ├── placeholder.dart │ │ │ │ ├── platform_view.dart │ │ │ │ ├── preferred_size.dart │ │ │ │ ├── primary_scroll_controller.dart │ │ │ │ ├── raw_keyboard_listener.dart │ │ │ │ ├── restoration.dart │ │ │ │ ├── restoration_properties.dart │ │ │ │ ├── router.dart │ │ │ │ ├── routes.dart │ │ │ │ ├── safe_area.dart │ │ │ │ ├── scroll_activity.dart │ │ │ │ ├── scroll_aware_image_provider.dart │ │ │ │ ├── scroll_configuration.dart │ │ │ │ ├── scroll_context.dart │ │ │ │ ├── scroll_controller.dart │ │ │ │ ├── scroll_metrics.dart │ │ │ │ ├── scroll_notification.dart │ │ │ │ ├── scroll_physics.dart │ │ │ │ ├── scroll_position.dart │ │ │ │ ├── scroll_position_with_single_context.dart │ │ │ │ ├── scroll_simulation.dart │ │ │ │ ├── scroll_view.dart │ │ │ │ ├── scrollable.dart │ │ │ │ ├── scrollbar.dart │ │ │ │ ├── semantics_debugger.dart │ │ │ │ ├── shortcuts.dart │ │ │ │ ├── single_child_scroll_view.dart │ │ │ │ ├── size_changed_layout_notifier.dart │ │ │ │ ├── sliver.dart │ │ │ │ ├── sliver_fill.dart │ │ │ │ ├── sliver_layout_builder.dart │ │ │ │ ├── sliver_persistent_header.dart │ │ │ │ ├── sliver_prototype_extent_list.dart │ │ │ │ ├── spacer.dart │ │ │ │ ├── status_transitions.dart │ │ │ │ ├── table.dart │ │ │ │ ├── text.dart │ │ │ │ ├── text_selection.dart │ │ │ │ ├── texture.dart │ │ │ │ ├── ticker_provider.dart │ │ │ │ ├── title.dart │ │ │ │ ├── transitions.dart │ │ │ │ ├── tween_animation_builder.dart │ │ │ │ ├── unique_widget.dart │ │ │ │ ├── value_listenable_builder.dart │ │ │ │ ├── viewport.dart │ │ │ │ ├── visibility.dart │ │ │ │ ├── widget_inspector.dart │ │ │ │ ├── widget_span.dart │ │ │ │ └── will_pop_scope.dart │ │ └── widgets.dart │ │ ├── meta │ │ ├── meta.dart │ │ └── meta_meta.dart │ │ ├── mx_dart_sdk.dart │ │ └── vector_math │ │ └── vector_math_64.dart │ └── widgets_patch │ ├── material_patches.dart │ ├── patches.dart │ └── widgets_patches.dart ├── mxflutterlogo.png ├── pubspec.lock ├── pubspec.yaml └── test ├── flutter ├── flutter_test_alternative.dart ├── foundation │ └── bit_field_test.dart ├── material │ └── raised_button_test.dart ├── painting │ └── alignment_test.dart ├── physics │ └── tolerance_test.dart ├── rendering │ ├── mock_canvas.dart │ └── recording_canvas.dart ├── scheduler │ └── priority_test.dart └── widget │ ├── container.clipBehaviour.with.shadow.png │ ├── container_test.dart │ ├── container_test.getClipPath.BoxDecoration.png │ ├── container_test.getClipPath.FlutterLogoDecoration.png │ ├── container_test.getClipPath.ShapeDecoration.png │ └── container_test.getClipPath.UnderlineTabIndicator.png ├── mirror_test ├── mx_func_invoke_test.dart ├── mx_lifecycle_obj.dart ├── mx_mirror_lifecycle_obj_test.dart └── mx_mirror_test.dart ├── mxflutter_test.dart └── util ├── button_widget_parser.dart ├── mx_mock_build_context.dart ├── mx_widget_to_json.dart └── text_widget_parser.dart /.code.yml: -------------------------------------------------------------------------------- 1 | source: 2 | # 文件或目录使用绝对路径,绝对路径按代码库根目录计算,以/开头。 3 | # 提供产品代码库中编写的测试代码存放目录或文件名格式,以便后续代码统计环节进行排除等特殊处理 4 | # 不要使用.*/等正则表达式屏蔽掉所有代码,会导致部门代码量骤减从而影响部门代码得分,还会导致Coverity扫不到任何代码而失败 5 | # 请勿使用Tab键,将会导致yaml解析出错 6 | test_source: 7 | #用于匹配文件; 匹配方式为正则表达式。 8 | filepath_regex: [".*/java/test/.*", ".*/test.java"] 9 | # 提供产品代码库中工具或框架自动生成的且在代码库中的代码,没有可为空。以便后续代码统计环节进行排除等特殊处理。 10 | auto_generate_source: 11 | # 自动生成代码文件的正则表达式,若无统一标识格式,可以指定具体目录,样例可参考test_source举例 12 | # filepath_regex: ["/mxflutter_bundle_update_plugin/example/mxflutter_js_bundle/*.js"] 13 | # 提供产品代码库中直接以源码形式存在的第三方代码目录或代码文件名的正则表达。 14 | # 此处备注的第三方代码在后续统计代码量环节会被排除,若代码库中不存在需要排除的第三方代码,该项配置标识可为空 15 | third_party_source: 16 | #第三方代码文件的正则表达式,若无统一标识格式,可以指定具体目录,样例可参考test_source举例 17 | filepath_regex: [".*/com.eclipsesource.v8/.*"] -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | .idea 9 | example/.flutter-plugins 10 | example/.flutter-plugins-dependencies 11 | .last_build_id 12 | IDEWorkspaceChecks.plist 13 | example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata 14 | example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings 15 | example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme 16 | example/ios/Runner.xcworkspace/contents.xcworkspacedata 17 | example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings 18 | 19 | 20 | node_modules/ 21 | package-lock.json -------------------------------------------------------------------------------- /android/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.4.1) 2 | message("CMAKE_SOURCE_DIR = ${CMAKE_SOURCE_DIR}") 3 | include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include) 4 | 5 | set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g") 6 | set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") 7 | 8 | set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s") 9 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") 10 | 11 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}) 12 | 13 | ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/src/main/cpp/sdk) -------------------------------------------------------------------------------- /android/config.gradle: -------------------------------------------------------------------------------- 1 | //config 2 | ext { 3 | USE_V8 = true //是否使用v8,false的话使用x5 4 | USE_V8_SO_DOWNLOAD = false //使用v8时是否动态下载so 5 | IS_RELEASE = false 6 | DELAY_JS_ENGINE_INIT = false //是否延迟初始化js引擎 7 | } -------------------------------------------------------------------------------- /android/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/android/consumer-rules.pro -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'mxflutter' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/cpp/include/jni_helper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by ericpsun on 2020/10/26. 3 | // 4 | 5 | #ifndef MXFLUTTER_JNI_HELPER_H 6 | #define MXFLUTTER_JNI_HELPER_H 7 | JNIEnv *get_env(int *attach); 8 | jint del_env(); 9 | #endif //MXFLUTTER_JNI_HELPER_H 10 | -------------------------------------------------------------------------------- /android/src/main/cpp/include/mxflutter_app.h: -------------------------------------------------------------------------------- 1 | // mxflutter_app.h 2 | // MXFlutterOCFramework 3 | // 4 | // Created by ericpsun on 2020/10/23. 5 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 6 | // Use of this source code is governed by a BSD-style license that can be 7 | // found in the LICENSE file. 8 | 9 | #ifndef MXFLUTTER_MXFLUTTER_APP_H 10 | #define MXFLUTTER_MXFLUTTER_APP_H 11 | 12 | #include 13 | 14 | jobject get_mx_flutter_ffi(); 15 | 16 | #endif //MXFLUTTER_MXFLUTTER_APP_H 17 | -------------------------------------------------------------------------------- /android/src/main/cpp/include/mxflutter_ffi.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by ericpsun on 2020/10/22. 3 | // 4 | 5 | #ifndef MXFLUTTER_MXFLUTTER_FFI_H 6 | #define MXFLUTTER_MXFLUTTER_FFI_H 7 | 8 | #include 9 | 10 | extern "C" JNIEXPORT __attribute__((used)) 11 | const char *syncPropsCallback(char *args); 12 | 13 | #endif //MXFLUTTER_MXFLUTTER_FFI_H 14 | -------------------------------------------------------------------------------- /android/src/main/cpp/sdk/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library( mxflutter 2 | 3 | SHARED 4 | 5 | mxflutter_ffi.cpp 6 | mxflutter_app.cpp 7 | jni_helper.cpp 8 | MXFFICallbackManager.cpp) 9 | 10 | # 从系统库中查找依赖库 11 | find_library( # Sets the name of the path variable. 12 | # 设置依赖库的名字,下面链接库的时候会用到 13 | log-lib 14 | 15 | # Specifies the name of the NDK library that 16 | # you want CMake to locate. 17 | 18 | # 查找log依赖库 19 | # {sdk-path}/ndk-bundle/sysroot/usr/include/android/log.h 20 | log ) 21 | 22 | # 配置库的依赖关系(链接关系) 23 | target_link_libraries( # Specifies the target library. 24 | # 目标库 25 | mxflutter 26 | 27 | # Links the target library to the log library 28 | # included in the NDK. 29 | # 依赖库,可以是多个 30 | ${log-lib} ) -------------------------------------------------------------------------------- /android/src/main/cpp/sdk/jni_helper.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by ericpsun on 2020/10/21. 3 | // 4 | #include 5 | #include 6 | JavaVM *global_jvm; 7 | 8 | JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) { 9 | JNIEnv *env = nullptr; 10 | jint result = -1; 11 | if (vm->GetEnv((void **) &env, JNI_VERSION_1_6) != JNI_OK) { 12 | return result; 13 | } 14 | global_jvm = vm; 15 | return JNI_VERSION_1_6; 16 | } 17 | 18 | JNIEnv *get_env(int *attach) { 19 | if (global_jvm == nullptr) return nullptr; 20 | 21 | *attach = 0; 22 | JNIEnv *jni_env = nullptr; 23 | 24 | int status = global_jvm->GetEnv((void **)&jni_env, JNI_VERSION_1_6); 25 | 26 | if (status == JNI_EDETACHED || jni_env == nullptr) { 27 | status = global_jvm->AttachCurrentThread(&jni_env, nullptr); 28 | if (status < 0) { 29 | jni_env = nullptr; 30 | } else { 31 | *attach = 1; 32 | } 33 | } 34 | return jni_env; 35 | } 36 | 37 | jint del_env() { 38 | return global_jvm->DetachCurrentThread(); 39 | } 40 | -------------------------------------------------------------------------------- /android/src/main/java/com/mojitox/mxflutter/framework/callback/ExecuteScriptCallback.java: -------------------------------------------------------------------------------- 1 | package com.mojitox.mxflutter.framework.callback; 2 | 3 | /** 4 | * create by ericpsun on 2020/11/6. 5 | */ 6 | public interface ExecuteScriptCallback { 7 | 8 | void onComplete(Object value); 9 | } 10 | -------------------------------------------------------------------------------- /android/src/main/java/com/mojitox/mxflutter/framework/callback/InvokeJSValueCallback.java: -------------------------------------------------------------------------------- 1 | package com.mojitox.mxflutter.framework.callback; 2 | 3 | import androidx.annotation.Nullable; 4 | 5 | public interface InvokeJSValueCallback { 6 | 7 | void onSuccess(@Nullable Object value); 8 | 9 | void onError(Error error); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /android/src/main/java/com/mojitox/mxflutter/framework/constants/JsObjectType.java: -------------------------------------------------------------------------------- 1 | package com.mojitox.mxflutter.framework.constants; 2 | 3 | /** 4 | * create by ericpsun on 2020/11/6. 5 | */ 6 | public enum JsObjectType { 7 | 8 | RUNTIME, 9 | APP_OBJECT, 10 | CURRENT_APP_OBJECT 11 | } 12 | -------------------------------------------------------------------------------- /android/src/main/java/com/mojitox/mxflutter/framework/executor/ThreadExecutor.java: -------------------------------------------------------------------------------- 1 | package com.mojitox.mxflutter.framework.executor; 2 | 3 | import java.util.concurrent.Executor; 4 | import java.util.concurrent.TimeUnit; 5 | 6 | public interface ThreadExecutor extends Executor { 7 | 8 | @Override 9 | void execute(Runnable command); 10 | 11 | void schedule(Runnable command, long delay, TimeUnit unit); 12 | } -------------------------------------------------------------------------------- /android/src/main/java/com/mojitox/mxflutter/framework/executor/UiThread.java: -------------------------------------------------------------------------------- 1 | package com.mojitox.mxflutter.framework.executor; 2 | 3 | import android.os.Handler; 4 | import android.os.Looper; 5 | import androidx.annotation.NonNull; 6 | 7 | public class UiThread { 8 | 9 | private static final Handler sHandler = new Handler(Looper.getMainLooper()); 10 | 11 | public static void postAtFrontOfQueue(@NonNull Runnable command) { 12 | sHandler.postAtFrontOfQueue(command); 13 | } 14 | 15 | public static void post(@NonNull Runnable command) { 16 | sHandler.post(command); 17 | } 18 | 19 | public static boolean isUIThread() { 20 | return Thread.currentThread().getId() == Looper.getMainLooper().getThread().getId(); 21 | } 22 | } -------------------------------------------------------------------------------- /android/src/main/java/com/mojitox/mxflutter/framework/js/IJsEngine.java: -------------------------------------------------------------------------------- 1 | package com.mojitox.mxflutter.framework.js; 2 | 3 | import com.mojitox.mxflutter.framework.callback.ExecuteScriptCallback; 4 | import io.flutter.plugin.common.MethodCall; 5 | import java.util.Map; 6 | 7 | /** 8 | * jsEngine抽象 9 | */ 10 | public interface IJsEngine { 11 | 12 | T getJsExecutor(); 13 | 14 | void callJSCallbackFunction(String callbackId, Map params); 15 | 16 | void callJSCallbackFunctionWithChannelName(String channelName, MethodCall methodCall, 17 | ExecuteScriptCallback callback); 18 | 19 | void onAttachedToFlutterEngine(); 20 | } 21 | -------------------------------------------------------------------------------- /android/src/main/java/com/mojitox/mxflutter/framework/js/IJsExecutor.java: -------------------------------------------------------------------------------- 1 | package com.mojitox.mxflutter.framework.js; 2 | 3 | import androidx.annotation.NonNull; 4 | import com.mojitox.mxflutter.framework.callback.ExecuteScriptCallback; 5 | import com.mojitox.mxflutter.framework.constants.JsObjectType; 6 | 7 | /** 8 | * create by ericpsun on 2020/11/6. 9 | */ 10 | public interface IJsExecutor { 11 | 12 | /** 13 | * 获取js引擎 14 | */ 15 | Runtime getRuntime(); 16 | 17 | void setRuntime(Runtime jsRuntime); 18 | 19 | /** 20 | * 关闭js引擎 清理main js & 业务js 21 | * @param cleanRunTime 是否清除runtime 22 | * @param callback 关闭回调 23 | */ 24 | void close(boolean cleanRunTime, ExecuteScriptCallback callback); 25 | 26 | boolean assertInitSuccess(@NonNull JsObjectType jsObjectType); 27 | 28 | void registerMxNativeJsFlutterApp(); 29 | } 30 | -------------------------------------------------------------------------------- /android/src/main/jniLibs/arm64-v8a/libj2v8.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/android/src/main/jniLibs/arm64-v8a/libj2v8.so -------------------------------------------------------------------------------- /android/src/main/jniLibs/arm64-v8a/libmxflutter.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/android/src/main/jniLibs/arm64-v8a/libmxflutter.so -------------------------------------------------------------------------------- /android/src/main/jniLibs/armeabi-v7a/libj2v8.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/android/src/main/jniLibs/armeabi-v7a/libj2v8.so -------------------------------------------------------------------------------- /android/src/main/jniLibs/armeabi-v7a/libmxflutter.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/android/src/main/jniLibs/armeabi-v7a/libmxflutter.so -------------------------------------------------------------------------------- /android/src/main/jniLibs/x86/libj2v8.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/android/src/main/jniLibs/x86/libj2v8.so -------------------------------------------------------------------------------- /android/src/main/jniLibs/x86/libmxflutter.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/android/src/main/jniLibs/x86/libmxflutter.so -------------------------------------------------------------------------------- /android/src/main/jniLibs/x86_64/libj2v8.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/android/src/main/jniLibs/x86_64/libj2v8.so -------------------------------------------------------------------------------- /android/src/main/jniLibs/x86_64/libmxflutter.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/android/src/main/jniLibs/x86_64/libmxflutter.so -------------------------------------------------------------------------------- /android/src/main/v8/com/debug/ScriptProviderImp.kt: -------------------------------------------------------------------------------- 1 | package com.debug 2 | 3 | class ScriptProviderImp : ScriptSourceProvider { 4 | override val allScriptIds: Collection 5 | get() = MXDebug.getScriptsName() 6 | 7 | override fun getSource(scriptId: String): String { 8 | return MXDebug.getScripts(scriptId) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /android/src/main/v8/com/debug/ScriptSourceProvider.kt: -------------------------------------------------------------------------------- 1 | package com.debug 2 | 3 | interface ScriptSourceProvider { 4 | 5 | val allScriptIds: Collection 6 | 7 | fun getSource(scriptId: String): String 8 | } 9 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/Platform.java: -------------------------------------------------------------------------------- 1 | package com.eclipsesource.v8; 2 | 3 | public class Platform { 4 | public static final String ANDROID = "android"; 5 | public static final String LINUX = "linux"; 6 | public static final String MACOSX = "macosx"; 7 | public static final String WINDOWS = "windows"; 8 | 9 | public static final String NATIVE_CLIENT = "nacl"; 10 | 11 | public static final String UNKNOWN = "unknown"; 12 | } 13 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/Releasable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2015 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8; 12 | 13 | import java.io.Closeable; 14 | 15 | /** 16 | * An interface used to denote all V8 Classes which can be released. 17 | */ 18 | public interface Releasable extends Closeable { 19 | 20 | /** 21 | * Release the underlying resources. Once an object is released 22 | * it typically cannot be used again. 23 | */ 24 | void close(); 25 | 26 | /** 27 | * Synonym for {@link #close()}. 28 | */ 29 | void release(); 30 | } 31 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/SignatureProvider.java: -------------------------------------------------------------------------------- 1 | package com.eclipsesource.v8; 2 | 3 | public interface SignatureProvider { 4 | public byte[] getSignature(String uri); 5 | } 6 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/V8ResultUndefined.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8; 12 | 13 | /** 14 | * An exception that's used to indicate that method that should have returned a 15 | * primitive, returned an Undefined instead. 16 | * 17 | * In Java, Undefined cannot be returned for all methods, especially if 18 | * the method returns a primitive (int, double, boolean) or a String. 19 | * In this case, if an Undefined should be returned from JS, then an instance 20 | * of this exception is thrown. 21 | */ 22 | @SuppressWarnings("serial") 23 | public class V8ResultUndefined extends V8RuntimeException { 24 | 25 | V8ResultUndefined(final String message) { 26 | super(message); 27 | } 28 | 29 | V8ResultUndefined() { 30 | super(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/V8RuntimeException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8; 12 | 13 | /** 14 | * A top-level exception used to indicate that a script failed. In most cases 15 | * a more specific exception will be thrown. 16 | */ 17 | @SuppressWarnings("serial") 18 | public class V8RuntimeException extends RuntimeException { 19 | 20 | V8RuntimeException() { 21 | } 22 | 23 | V8RuntimeException(final String message) { 24 | super(message); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/V8ScriptCompilationException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8; 12 | 13 | /** 14 | * An exception used to indicate that a script failed to compile. 15 | */ 16 | @SuppressWarnings("serial") 17 | public class V8ScriptCompilationException extends V8ScriptException { 18 | 19 | V8ScriptCompilationException(final String fileName, final int lineNumber, 20 | final String message, final String sourceLine, final int startColumn, final int endColumn) { 21 | super(fileName, lineNumber, message, sourceLine, startColumn, endColumn, null, null); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/debug/BreakHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8.debug; 12 | 13 | import com.eclipsesource.v8.V8Object; 14 | import com.eclipsesource.v8.debug.DebugHandler.DebugEvent; 15 | 16 | public interface BreakHandler { 17 | 18 | public void onBreak(DebugEvent type, ExecutionState state, EventData eventData, V8Object data); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/debug/CompileEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8.debug; 12 | 13 | import com.eclipsesource.v8.V8Object; 14 | 15 | /** 16 | * Holds information about Compile Events. 17 | */ 18 | public class CompileEvent extends EventData { 19 | 20 | CompileEvent(final V8Object eventData) { 21 | super(eventData); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/debug/EventData.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8.debug; 12 | 13 | import com.eclipsesource.v8.Releasable; 14 | import com.eclipsesource.v8.V8Object; 15 | 16 | /** 17 | * Typed information about different debug events. 18 | */ 19 | public class EventData implements Releasable { 20 | 21 | protected V8Object v8Object; 22 | 23 | EventData(final V8Object eventData) { 24 | v8Object = eventData.twin(); 25 | } 26 | 27 | @Override 28 | public void close() { 29 | if (!v8Object.isReleased()) { 30 | v8Object.close(); 31 | } 32 | } 33 | 34 | @Override 35 | @Deprecated 36 | public void release() { 37 | close(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/debug/ExceptionEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8.debug; 12 | 13 | import com.eclipsesource.v8.V8Object; 14 | 15 | /** 16 | * Holds information about Exception Events. 17 | */ 18 | public class ExceptionEvent extends EventData { 19 | 20 | ExceptionEvent(final V8Object eventData) { 21 | super(eventData); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/debug/StepAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8.debug; 12 | 13 | /** 14 | * An enumeration of possible Step Actions. A step action indicates to the 15 | * debugger how to proceed with the next step. 16 | */ 17 | public enum StepAction { 18 | STEP_OUT(0), STEP_NEXT(1), STEP_IN(2), STEP_FRAME(3); 19 | int index; 20 | 21 | StepAction(final int index) { 22 | this.index = index; 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/debug/mirror/BooleanMirror.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8.debug.mirror; 12 | 13 | import com.eclipsesource.v8.V8Object; 14 | 15 | /** 16 | * Represents JavaScript 'Boolean' Mirrors 17 | */ 18 | public class BooleanMirror extends ValueMirror { 19 | 20 | BooleanMirror(final V8Object v8Object) { 21 | super(v8Object); 22 | } 23 | 24 | @Override 25 | public boolean isBoolean() { 26 | return true; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return v8Object.executeStringFunction("toText", null); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/debug/mirror/NullMirror.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8.debug.mirror; 12 | 13 | import com.eclipsesource.v8.V8Object; 14 | 15 | /** 16 | * Represents 'Null' Mirrors 17 | */ 18 | public class NullMirror extends ValueMirror { 19 | 20 | 21 | NullMirror(final V8Object v8Object) { 22 | super(v8Object); 23 | } 24 | 25 | @Override 26 | public boolean isNull() { 27 | return true; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return "null"; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/debug/mirror/NumberMirror.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8.debug.mirror; 12 | 13 | import com.eclipsesource.v8.V8Object; 14 | 15 | /** 16 | * Represents JavaScript 'Number' Mirrors 17 | */ 18 | public class NumberMirror extends ValueMirror { 19 | 20 | NumberMirror(final V8Object v8Object) { 21 | super(v8Object); 22 | } 23 | 24 | @Override 25 | public boolean isNumber() { 26 | return true; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return v8Object.executeStringFunction("toText", null); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/debug/mirror/StringMirror.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8.debug.mirror; 12 | 13 | import com.eclipsesource.v8.V8Object; 14 | 15 | /** 16 | * Represents JavaScript 'String' Mirrors 17 | */ 18 | public class StringMirror extends ValueMirror { 19 | 20 | StringMirror(final V8Object v8Object) { 21 | super(v8Object); 22 | } 23 | 24 | @Override 25 | public boolean isString() { 26 | return true; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return v8Object.executeStringFunction("toText", null); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/debug/mirror/UndefinedMirror.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8.debug.mirror; 12 | 13 | import com.eclipsesource.v8.V8Object; 14 | 15 | /** 16 | * Represents 'Undefined' Mirrors 17 | */ 18 | public class UndefinedMirror extends ValueMirror { 19 | 20 | 21 | UndefinedMirror(final V8Object v8Object) { 22 | super(v8Object); 23 | } 24 | 25 | @Override 26 | public boolean isUndefined() { 27 | return true; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return "undefined"; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/inspector/DebuggerConnectionListener.java: -------------------------------------------------------------------------------- 1 | package com.eclipsesource.v8.inspector; 2 | 3 | public interface DebuggerConnectionListener { 4 | public void onDebuggerConnected(); 5 | 6 | public void onDebuggerDisconnected(); 7 | } 8 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/inspector/V8InspectorDelegate.java: -------------------------------------------------------------------------------- 1 | package com.eclipsesource.v8.inspector; 2 | 3 | public interface V8InspectorDelegate { 4 | public void onResponse(String message); 5 | 6 | public void waitFrontendMessageOnPause(); 7 | } 8 | -------------------------------------------------------------------------------- /android/src/main/v8/com/eclipsesource/v8/utils/V8Runnable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2015 EclipseSource and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * EclipseSource - initial API and implementation 10 | ******************************************************************************/ 11 | package com.eclipsesource.v8.utils; 12 | 13 | import com.eclipsesource.v8.V8; 14 | 15 | /** 16 | * Classes can implement this interface to execute arbitrary code on 17 | * isolated V8 runtime on its own thread. Instances of classes that 18 | * implement this interface can be passed to V8Thread. 19 | */ 20 | public interface V8Runnable { 21 | 22 | /** 23 | * Execute the code on the provided runtime. 24 | * 25 | * @param runtime The V8 runtime assigned to this runnable. 26 | */ 27 | public void run(final V8 runtime); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /android/src/main/v8/com/mojitox/mxflutter/framework/js/JsEngineProvider.java: -------------------------------------------------------------------------------- 1 | package com.mojitox.mxflutter.framework.js; 2 | 3 | import androidx.annotation.NonNull; 4 | import com.eclipsesource.v8.V8ScriptException; 5 | import com.mojitox.mxflutter.framework.js.v8.V8JsEngine; 6 | import java.io.PrintWriter; 7 | import java.io.StringWriter; 8 | 9 | /** 10 | * create by ericpsun on 2020/11/20. 11 | */ 12 | public class JsEngineProvider { 13 | 14 | @NonNull 15 | public static BaseJsEngine createJsEngine() { 16 | return new V8JsEngine(); 17 | } 18 | 19 | public static String getErrorStack(@NonNull Throwable throwable) { 20 | if (throwable instanceof V8ScriptException) { 21 | return ((V8ScriptException) throwable).getJSStackTrace(); 22 | } 23 | StringWriter stringWriter = new StringWriter(); 24 | throwable.printStackTrace(new PrintWriter(stringWriter)); 25 | return stringWriter.toString(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /android/src/main/v8/com/mojitox/mxflutter/framework/js/v8/Console.java: -------------------------------------------------------------------------------- 1 | package com.mojitox.mxflutter.framework.js.v8; 2 | 3 | import android.webkit.JavascriptInterface; 4 | import com.mojitox.mxflutter.framework.utils.MxLog; 5 | 6 | public class Console { 7 | 8 | @JavascriptInterface 9 | public void log(Object... args) { 10 | MxLog.i("Console [INFO] ", (args == null ? "" : args[0].toString())); 11 | } 12 | 13 | @JavascriptInterface 14 | public void error(Object... args) { 15 | MxLog.e("Console [ERROR] ", (args == null ? "" : args[0].toString())); 16 | } 17 | 18 | @JavascriptInterface 19 | public void warn(Object... args) { 20 | MxLog.w("Console [WARN] ", (args == null ? "" : args[0].toString())); 21 | } 22 | } -------------------------------------------------------------------------------- /android/src/test/java/com/mojitox/mxflutter/framework/MockApplication.java: -------------------------------------------------------------------------------- 1 | package com.mojitox.mxflutter.framework; 2 | 3 | import android.app.Application; 4 | 5 | public class MockApplication extends Application { 6 | private static Application mApplication; 7 | @Override 8 | public void onCreate() { 9 | super.onCreate(); 10 | mApplication = this; 11 | } 12 | 13 | public static Application getInstance() { 14 | return mApplication; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /android/src/test/java/com/mojitox/mxflutter/framework/js/JsEngineProviderTest.java: -------------------------------------------------------------------------------- 1 | package com.mojitox.mxflutter.framework.js; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | /** 7 | * create by ericpsun on 2021/3/17. 8 | */ 9 | public class JsEngineProviderTest { 10 | 11 | @Test 12 | public void testGetErrorStack() { 13 | Exception exception = new RuntimeException("test"); 14 | String result = JsEngineProvider.getErrorStack(exception); 15 | Assert.assertTrue(result != null && result.length() > 0); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Exceptions to above rules. 37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 38 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: f139b11009aeb8ed2a3a3aa8b0066e482709dde3 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # mxflutter_example 2 | 3 | Demonstrates how to use the mxflutter plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | gradle/ 3 | local.properties 4 | .gradle 5 | GeneratedPluginRegistrant.java -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/mojitox/mxflutter/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.mojitox.mxflutter.example; 2 | 3 | import android.os.Bundle; 4 | import androidx.annotation.NonNull; 5 | import io.flutter.embedding.android.FlutterActivity; 6 | import io.flutter.embedding.engine.FlutterEngine; 7 | import io.flutter.plugins.GeneratedPluginRegistrant; 8 | 9 | public class MainActivity extends FlutterActivity { 10 | 11 | @Override 12 | public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { 13 | GeneratedPluginRegistrant.registerWith(flutterEngine); 14 | } 15 | 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.0' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/MXFlutterOCFrameworkTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/mxflutter-ts-proj/mxflutter-homepage/.gitignore: -------------------------------------------------------------------------------- 1 | # vscode 2 | .vscode 3 | 4 | # idea 5 | .idea 6 | 7 | # Typescript build info 8 | *.tsbuildinfo 9 | 10 | # Node modules 11 | node_modules/ 12 | 13 | # MacOS Desktop Services Store 14 | .DS_Store 15 | 16 | # Log files 17 | *.log 18 | 19 | # Coverage directory 20 | coverage/ 21 | 22 | package-lock.json 23 | 24 | dist 25 | 26 | release -------------------------------------------------------------------------------- /example/mxflutter-ts-proj/mxflutter-homepage/.prettierrc.yml: -------------------------------------------------------------------------------- 1 | tabWidth: 2 2 | printWidth: 120 3 | useTabs: false 4 | trailingComma: 'all' 5 | semi: true 6 | singleQuote: true 7 | quoteProps: 'consistent' 8 | bracketSpacing: true 9 | arrowParens: 'always' 10 | -------------------------------------------------------------------------------- /example/mxflutter-ts-proj/mxflutter-homepage/tsconfig.es5.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES5", 4 | "lib": ["ES5", "ES6", "ES2015", "ES2017", "ES2016", "ES2018", "ES2019", "ES2020", "ESNext", "DOM"], 5 | "module": "commonjs", 6 | "baseUrl": ".", 7 | "outDir": "lib", 8 | "rootDir": "src", 9 | "moduleResolution": "node", 10 | "sourceMap": true, 11 | "downlevelIteration": true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/mxflutter-ts-proj/mxflutter-homepage/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2015", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "allowSyntheticDefaultImports": true, 7 | "esModuleInterop": true, 8 | "preserveSymlinks": false 9 | } 10 | } -------------------------------------------------------------------------------- /example/mxflutter_js_bundle/bizBundle.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/mxflutter_js_bundle/bizBundle.zip -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:mxflutter_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => 22 | widget is Text && widget.data.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | example 18 | 19 | 20 | 21 | 24 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/MXFlutterOCFramework/Common/MXCommon.h: -------------------------------------------------------------------------------- 1 | // 2 | // MXCommon.h 3 | // mxflutter 4 | // 5 | // Created by soapyang(杨川川) on 2021/1/20. 6 | // 7 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 8 | // Use of this source code is governed by a BSD-style license that can be 9 | // found in the LICENSE file. 10 | 11 | #import 12 | 13 | /// MXCommonUtil工具类 14 | @interface MXCommonUtil : NSObject 15 | // 获取从app package里拷贝到的js bundle path,用于启动拷贝和下载 16 | + (NSString *)defaultJSAppUpdatePath; 17 | 18 | @end 19 | 20 | 21 | -------------------------------------------------------------------------------- /ios/Classes/MXFlutterOCFramework/Common/MXCommon.m: -------------------------------------------------------------------------------- 1 | // 2 | // MXCommon.m 3 | // mxflutter 4 | // 5 | // Created by soapyang(杨川川) on 2021/1/20. 6 | // 7 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 8 | // Use of this source code is governed by a BSD-style license that can be 9 | // found in the LICENSE file. 10 | 11 | #import "MXCommon.h" 12 | 13 | /// MXCommonUtil工具类实现 14 | @implementation MXCommonUtil 15 | 16 | + (NSString *)defaultJSAppUpdatePath{ 17 | static NSString *jsBundlePath = nil; 18 | 19 | if(jsBundlePath == nil){ 20 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 21 | NSString *path = paths.firstObject; 22 | jsBundlePath = [path stringByAppendingPathComponent:@"mxflutter_js_bundle"]; 23 | } 24 | 25 | return jsBundlePath; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /ios/Classes/MXFlutterOCFramework/Common/MXFDispose.h: -------------------------------------------------------------------------------- 1 | // 2 | // MXDispose.h 3 | // MXFlutter 4 | // 5 | // Created by soap on 2020/3/14. 6 | // Copyright © 2020 The Chromium Authors. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// MX释放协议 12 | @protocol MXFDispose 13 | 14 | /// 释放方法 15 | - (void)dispose; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ios/Classes/MXFlutterOCFramework/JSBridge/MXJSBridge.h: -------------------------------------------------------------------------------- 1 | // 2 | // MXJSBridge.h 3 | // MXFlutterOCFramework 4 | // 5 | // Created by soap on 2020/3/15. 6 | // Copyright 2019 The MXFlutter Authors. All rights reserved. 7 | // Some code/ideas Copyright (c) Facebook ReactNative, Inc. and its affiliates. 8 | // 9 | // Use of this source code is governed by a MIT-style license that can be 10 | // found in the LICENSE file. 11 | 12 | #import 13 | #import "MXBridgeModule.h" 14 | #import 15 | #import "MXJSFlutterDefines.h" 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | @class MXJSFlutterApp; 20 | 21 | /// JSFlutter桥接类 22 | @interface MXJSBridge : NSObject 23 | 24 | /// 单例 25 | + (instancetype)shareInstance; 26 | 27 | /// 注册flutterApp 28 | /// @param flutterApp app实例 29 | /// @param jsAPPValueBridge module 30 | - (void)registerModules:(MXJSFlutterApp *)flutterApp jsAPPValueBridge:(JSValue *)jsAPPValueBridge; 31 | 32 | /// 调用方法 33 | /// @param eventName 时间名称 34 | /// @param data 数据 35 | /// @param jsCallbackFun 回调 36 | - (void)sendEventWithName:(NSString *)eventName data:(id)data callback:(JSValue *_Nullable)jsCallbackFun; 37 | 38 | /// 获取module 39 | /// @param moduleClass module类型 40 | - (id)moduleForClass:(Class)moduleClass; 41 | 42 | @end 43 | 44 | NS_ASSUME_NONNULL_END 45 | -------------------------------------------------------------------------------- /ios/Classes/MXFlutterOCFramework/MXFFIImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // MXFFIImpl.h 3 | // MXFlutterOCFramework 4 | // 5 | // Created by lucaliu on 2020/10/12. 6 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. 9 | 10 | #import 11 | #import 12 | 13 | /// MXFFI实现 14 | @interface MXFFIImpl : NSObject 15 | 16 | /// 单例 17 | + (instancetype)sharedInstance; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /ios/Classes/MXFlutterOCFramework/MXFFIImpl.m: -------------------------------------------------------------------------------- 1 | // 2 | // MXFFIImpl.m 3 | // MXFlutterOCFramework 4 | // 5 | // Created by lucaliu on 2020/10/12. 6 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. 9 | 10 | #import "MXFFIImpl.h" 11 | #import "MXFlutterPlugin.h" 12 | #import 13 | #import "MXJSEngine.h" 14 | 15 | /// MXFFI的实现 16 | @implementation MXFFIImpl 17 | 18 | + (instancetype)sharedInstance { 19 | static id sharedInstance = nil; 20 | static dispatch_once_t onceToken; 21 | dispatch_once(&onceToken, ^{ 22 | sharedInstance = [[self alloc] init]; 23 | }); 24 | return sharedInstance; 25 | } 26 | 27 | #pragma mark - MXFFIProtocol 28 | 29 | - (const char *)syncPropsCallbackImpl:(char *)args { 30 | JSValue *appObj = [MXFlutterPlugin shareInstance].mxEngine.currentApp.jsEngine.jsAppObj; 31 | NSDictionary *argument = @ { @"method" : @"syncPropsCallback", @"arguments" : [NSString stringWithUTF8String:args] }; 32 | JSValue *result = [appObj invokeMethod:@"nativeCall" withArguments:@[ argument ]]; 33 | return result.toString.UTF8String; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /ios/Classes/MXFlutterPlugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // MXFlutterPlugin.h 3 | // MXFlutterOCFramework 4 | // 5 | // Created by soapyang on 2018/12/22. 6 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. 9 | #import 10 | #import "MXJSFlutterEngine.h" 11 | 12 | /// MXFlutter插件 13 | @interface MXFlutterPlugin : NSObject 14 | 15 | /// MXFlutterJS引擎 16 | @property (nonatomic, strong) MXJSFlutterEngine *mxEngine; 17 | 18 | /// 保持Flutter插件注册器 19 | @property (nonatomic, strong) NSObject *flutterRegistrar; 20 | 21 | /// 从MXFlutterPlugin单例入口,访问MXFlutter相关API 22 | + (MXFlutterPlugin *)shareInstance; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /ios/Classes/MXFlutterPlugin.m: -------------------------------------------------------------------------------- 1 | // 2 | // MXFlutterPlugin.m 3 | // MXFlutterOCFramework 4 | // 5 | // Created by soapyang on 2018/12/22. 6 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. 9 | #import "MXFlutterPlugin.h" 10 | 11 | @interface MXFlutterPlugin () 12 | 13 | @end 14 | 15 | /// MXFlutter插件 16 | @implementation MXFlutterPlugin 17 | 18 | static MXFlutterPlugin *gMXFlutterPluginInstance = nil; 19 | 20 | + (MXFlutterPlugin *)shareInstance { 21 | return gMXFlutterPluginInstance; 22 | } 23 | 24 | /// 注册 25 | /// @param registrar 注册者 26 | + (void)registerWithRegistrar:(NSObject *)registrar { 27 | if (gMXFlutterPluginInstance != nil) { 28 | [gMXFlutterPluginInstance dispose]; 29 | } 30 | 31 | gMXFlutterPluginInstance = [[MXFlutterPlugin alloc] init]; 32 | gMXFlutterPluginInstance.flutterRegistrar = registrar; 33 | gMXFlutterPluginInstance.mxEngine = [[MXJSFlutterEngine alloc] initWithFlutterMessager:registrar.messenger]; 34 | } 35 | 36 | /// 释放MXEngine 37 | - (void)dispose { 38 | if (self.mxEngine != nil) { 39 | [self.mxEngine dispose]; 40 | self.mxEngine = nil; 41 | } 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /ios/MXFFI/MXFFI.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/MXFFI/MXFFI/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /ios/MXFFI/MXFFI/MXFFI.h: -------------------------------------------------------------------------------- 1 | // 2 | // MXFFI.h 3 | // MXFlutterOCFramework 4 | // 5 | // Created by lucaliu on 2020/10/12. 6 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. 9 | 10 | #import 11 | 12 | #if defined(__cplusplus) 13 | #define MX_FFI_EXTERN extern "C" __attribute__((visibility("default"))) __attribute__((used)) 14 | #else 15 | #define MX_FFI_EXTERN extern __attribute__((visibility("default"))) __attribute__((used)) 16 | #endif 17 | 18 | /// 使用dart:ffi,实现dart->js的同步调用 19 | 20 | /// 同步属性回调 21 | MX_FFI_EXTERN const char *syncPropsCallback(char *args); 22 | 23 | /// MXFFI协议 24 | @protocol MXFFIProtocol 25 | 26 | /// 同步属性回调实现 27 | /// @param args 参数 28 | - (const char *)syncPropsCallbackImpl:(char *)args; 29 | 30 | @end 31 | 32 | /// MXFFI 33 | @interface MXFFI : NSObject 34 | 35 | /// 委托 36 | @property (nonatomic, weak) id delegate; 37 | 38 | /// 单例 39 | + (instancetype)sharedInstance; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /ios/MXFFI/MXFFI/MXFFI.m: -------------------------------------------------------------------------------- 1 | // 2 | // MXFFI.m 3 | // MXFlutterOCFramework 4 | // 5 | // Created by lucaliu on 2020/10/12. 6 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. 9 | 10 | #import "MXFFI.h" 11 | 12 | /// 调用该方法前,需主动设置pSyncPropsCallbackImpl 13 | /// @param args 参数 14 | /// @return 返回值 15 | const char *syncPropsCallback(char *args) { 16 | if ([MXFFI sharedInstance].delegate && 17 | [[MXFFI sharedInstance].delegate respondsToSelector:@selector(syncPropsCallbackImpl:)]) { 18 | return [[MXFFI sharedInstance].delegate syncPropsCallbackImpl:args]; 19 | } 20 | return ""; 21 | } 22 | 23 | @implementation MXFFI 24 | 25 | + (instancetype)sharedInstance { 26 | static id sharedInstance = nil; 27 | static dispatch_once_t onceToken; 28 | dispatch_once(&onceToken, ^{ 29 | sharedInstance = [[self alloc] init]; 30 | }); 31 | return sharedInstance; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ios/MXFFI/MXFFITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ios/MXFFI/MXFFITests/MXFFITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MXFFITests.m 3 | // MXFlutterOCFramework 4 | // 5 | // Created by lucaliu on 2020/2/24. 6 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. 9 | 10 | #import 11 | 12 | /// MXFFI单侧 13 | @interface MXFFITests : XCTestCase 14 | 15 | @end 16 | 17 | /// MXFFI单侧 18 | @implementation MXFFITests 19 | 20 | /// 创建 21 | - (void)setUp { 22 | // Put setup code here. This method is called before the invocation of each test method in the class. 23 | } 24 | 25 | /// 销毁 26 | - (void)tearDown { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | } 29 | 30 | /// 测试用例 31 | - (void)testExample { 32 | // This is an example of a functional test case. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | /// 测试用例 37 | - (void)testPerformanceExample { 38 | // This is an example of a performance test case. 39 | [self measureBlock:^{ 40 | // Put the code you want to measure the time of here. 41 | }]; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /ios/MXFFI/Products/MXFFI.framework/Headers/MXFFI.h: -------------------------------------------------------------------------------- 1 | // 2 | // MXFFI.h 3 | // MXFlutterOCFramework 4 | // 5 | // Created by lucaliu on 2020/10/12. 6 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. 9 | 10 | #import 11 | 12 | #if defined(__cplusplus) 13 | #define MX_FFI_EXTERN extern "C" __attribute__((visibility("default"))) __attribute__((used)) 14 | #else 15 | #define MX_FFI_EXTERN extern __attribute__((visibility("default"))) __attribute__((used)) 16 | #endif 17 | 18 | /// 使用dart:ffi,实现dart->js的同步调用 19 | 20 | /// 同步属性回调 21 | MX_FFI_EXTERN const char *syncPropsCallback(char *args); 22 | 23 | /// MXFFI协议 24 | @protocol MXFFIProtocol 25 | 26 | /// 同步属性调用 27 | /// @param args 参数 28 | - (const char *)syncPropsCallbackImpl:(char *)args; 29 | 30 | @end 31 | 32 | @interface MXFFI : NSObject 33 | 34 | @property (nonatomic, weak) id delegate; 35 | 36 | + (instancetype)sharedInstance; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /ios/MXFFI/Products/MXFFI.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/ios/MXFFI/Products/MXFFI.framework/Info.plist -------------------------------------------------------------------------------- /ios/MXFFI/Products/MXFFI.framework/MXFFI: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/ios/MXFFI/Products/MXFFI.framework/MXFFI -------------------------------------------------------------------------------- /ios/MXFFI/Products/MXFFI.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module MXFFI { 2 | umbrella header "MXFFI.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /ios/MXFFI/readme.txt: -------------------------------------------------------------------------------- 1 | MXFFI.framework生成方法: 2 | 1、真机编译 3 | 2、模拟器编译 4 | 3、framework生成在Products文件夹中 -------------------------------------------------------------------------------- /ios/mxflutter.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint mxflutter.podspec' to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'mxflutter' 7 | s.version = '0.0.1' 8 | s.summary = 'JavaScript Flutter Framework' 9 | s.description = <<-DESC 10 | JavaScript Flutter Framework 11 | DESC 12 | s.homepage = 'http://example.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Your Company' => 'email@example.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.public_header_files = 'Classes/**/*.h' 18 | s.dependency 'Flutter' 19 | s.platform = :ios, '8.0' 20 | 21 | # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. 22 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } 23 | 24 | s.preserve_paths = 'MXFFI/Products/MXFFI.framework' 25 | s.vendored_frameworks = 'MXFFI/Products/MXFFI.framework' 26 | 27 | s.test_spec 'Tests' do |test_spec| 28 | test_spec.source_files = 'Tests/**/*' 29 | test_spec.dependency 'OCMock','3.5' 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /js_lib/main.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/js_lib/main.zip -------------------------------------------------------------------------------- /lib/mxflutter.dart: -------------------------------------------------------------------------------- 1 | // MXFlutterFramework 2 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. 5 | 6 | library mxflutter; 7 | 8 | ///*MXJSFluttr的对外接口类 9 | ///简单两步接入MXFlutter,打开JS编写的页面。 10 | ///1. 启动运行JS代码 'MXJSFlutter.runJSApp();' 11 | ///2. Push JS页面 12 | /// 13 | /// '''dart 14 | /// 15 | /// Navigator.push( 16 | /// context, 17 | /// MaterialPageRoute( 18 | /// builder: (context) => MXJSPageWidget( 19 | /// jsWidgetName: "MXJSWidgetHomePage"))); 20 | /// 21 | /// ''' 22 | /// 23 | /// 24 | export 'src/bundle_zip/mx_bundle_zip.dart'; 25 | export 'src/mirror/mx_mirror.dart'; 26 | export 'src/mx_common.dart'; 27 | export 'src/mx_flutter.dart'; 28 | export 'src/mx_host_widget.dart'; 29 | export 'src/mx_handler.dart'; 30 | export 'src/mx_widget.dart'; 31 | -------------------------------------------------------------------------------- /lib/mxflutter_test.dart: -------------------------------------------------------------------------------- 1 | // MXFlutterFramework 2 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. 5 | 6 | /// 单元测试和自动化测试 7 | export 'src/mx_build_owner.dart'; 8 | 9 | export 'src/mx_common.dart'; 10 | export 'src/mx_flutter_app.dart'; 11 | export 'src/mx_widget.dart'; 12 | -------------------------------------------------------------------------------- /lib/src/bundle_zip/mx_bundle_zip.dart: -------------------------------------------------------------------------------- 1 | library mx_bundle_zip; 2 | 3 | export 'src/bundle_zip_manager.dart'; 4 | export 'src/module_info.dart'; 5 | export 'src/utils.dart'; 6 | -------------------------------------------------------------------------------- /lib/src/bundle_zip/src/module_info.dart: -------------------------------------------------------------------------------- 1 | class MXModuleInitPermissioResult { 2 | /// 是否成功。 3 | final bool reslut; 4 | 5 | /// 错误信息。 6 | final String errorMessage; 7 | 8 | MXModuleInitPermissioResult(this.reslut, this.errorMessage); 9 | } 10 | 11 | class MXBundleZipCheckResult { 12 | /// 是否成功。 13 | final bool success; 14 | 15 | /// bundle包放置路径。 16 | final String bundlePath; 17 | 18 | /// 错误信息。 19 | final String errorMessage; 20 | 21 | MXBundleZipCheckResult(this.success, this.bundlePath, this.errorMessage); 22 | } 23 | 24 | class MXCopyBundleZipInfo { 25 | /// js资源下载路径 26 | final String jsBunldeDownloadPath; 27 | 28 | MXCopyBundleZipInfo({this.jsBunldeDownloadPath}); 29 | } 30 | -------------------------------------------------------------------------------- /lib/src/ffi/ffi.dart: -------------------------------------------------------------------------------- 1 | // MXFlutterFramework 2 | // Copyright 2020 The MXFlutter Authors. All rights reserved. 3 | // 4 | // Use of this source code is governed by a MIT-style license that can be 5 | // found in the LICENSE file. 6 | 7 | import 'dart:ffi'; 8 | import 'dart:io'; 9 | 10 | import 'package:ffi/ffi.dart'; 11 | 12 | final DynamicLibrary dl = Platform.isAndroid ? DynamicLibrary.open("libmxflutter.so") : DynamicLibrary.open("MXFFI.framework/MXFFI"); 13 | 14 | /// 同步获取属性回调。 15 | final Pointer Function(Pointer) syncPropsCallback = 16 | dl.lookup Function(Pointer)>>("syncPropsCallback").asFunction(); 17 | -------------------------------------------------------------------------------- /lib/src/mirror/mx_mirror.dart: -------------------------------------------------------------------------------- 1 | // MXFlutterFramework 2 | // Copyright 2020 The MXFlutter Authors. All rights reserved. 3 | // 4 | // Use of this source code is governed by a MIT-style license that can be 5 | // found in the LICENSE file. 6 | 7 | library mx_mirror; 8 | 9 | export 'src/mx_closure.dart'; 10 | export 'src/mx_common_function.dart'; 11 | export 'src/mx_function_invoke.dart'; 12 | export 'src/mx_mirror.dart'; 13 | -------------------------------------------------------------------------------- /lib/src/mirror/readme.md: -------------------------------------------------------------------------------- 1 | mirror 符号映射 2 | 3 | ## 4 | 5 | 构造函数用"."分割,成员函数使用"#"分割 6 | 例如: 7 | 构造函数 8 | AnimationController.unbounded 9 | 10 | 成员函数 11 | AnimationController#forward -------------------------------------------------------------------------------- /lib/src/mirror/src/mx_function_invoke.dart: -------------------------------------------------------------------------------- 1 | // MXFlutterFramework 2 | // Copyright 2020 The MXFlutter Authors. All rights reserved. 3 | // 4 | // Use of this source code is governed by a MIT-style license that can be 5 | // found in the LICENSE file. 6 | 7 | import 'package:flutter/widgets.dart'; 8 | 9 | import '../../mx_build_owner.dart'; 10 | 11 | /// Dart函数的映射定义。 12 | class MXFunctionInvoke { 13 | /// 方法名。 14 | final String funName; 15 | 16 | /// 方法体。 17 | final Function fun; 18 | 19 | /// 持有的buildOwner. 20 | MXBuildOwner buildOwner; 21 | 22 | /// context. 23 | BuildContext context; 24 | 25 | /// 属性名列表。 26 | final List propsName; 27 | 28 | /// 无需J2D转换的属性列表。 29 | final List noJ2DProps; 30 | 31 | MXFunctionInvoke(this.funName, this.fun, [this.propsName, this.noJ2DProps]); 32 | 33 | /// 调用方法。 34 | /// argument: 命名参数。 35 | dynamic apply(Map argument) { 36 | return Function.apply(fun, [], argument); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/src/mirror_reg_fun_map/mx_mirror_func_reg.dart: -------------------------------------------------------------------------------- 1 | // MXFlutterFramework 2 | // Copyright 2020 The MXFlutter Authors. All rights reserved. 3 | // 4 | // Use of this source code is governed by a MIT-style license that can be 5 | // found in the LICENSE file. 6 | 7 | import '../mx_widgets_binding_proxy.dart'; 8 | import 'mx_mirror_common_func.dart'; 9 | import 'mx_mirror_widget_func.dart'; 10 | 11 | /// 启动时调用,把需要注册的函数加到这里。 12 | void mxRegisterMirrorFunctions() { 13 | // 注册通用方法。 14 | mxRegisterMirrorCommonFunc(); 15 | 16 | // 注册WidgetsBinding方法。 17 | mxRegisterMXWidgetsBindingProxy(); 18 | 19 | // 注册自动生成的widget方法。 20 | mxRegisterBuilderWidgetFunc(); 21 | } 22 | -------------------------------------------------------------------------------- /lib/src/mx_handler.dart: -------------------------------------------------------------------------------- 1 | // MXFlutterFramework 2 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. 5 | 6 | import 'mx_flutter.dart'; 7 | 8 | class MXHandler { 9 | /// 定制loadingWidget 和 errorWidget。 10 | MXWidgetBuildHandler loadingHandler; 11 | MXWidgetBuildHandler errorHandler; 12 | 13 | /// 单例实例。 14 | static MXHandler _instance; 15 | 16 | /// 获取单例实例。 17 | static MXHandler getInstance() { 18 | if (_instance == null) { 19 | _instance = MXHandler(); 20 | } 21 | return _instance; 22 | } 23 | 24 | /// 设置一个处理器,当JS页面加载时,定制Loading widget。 25 | void setJSWidgetLoadingHandler(MXWidgetBuildHandler handler) { 26 | loadingHandler = handler; 27 | } 28 | 29 | /// 设置一个处理器,当JS页面加载时,定制Error widget。 30 | void setJSWidgetBuildErrorHandler(MXWidgetBuildHandler handler) { 31 | errorHandler = handler; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/src/widgets/mx_widgets.dart: -------------------------------------------------------------------------------- 1 | library mx_widgets; 2 | 3 | // export 'src/packages/collection/collection.dart'; 4 | 5 | export 'src/packages/flutter/animation.dart'; 6 | export 'src/packages/flutter/cupertino.dart'; 7 | export 'src/packages/flutter/foundation.dart'; 8 | export 'src/packages/flutter/gestures.dart'; 9 | export 'src/packages/flutter/material.dart'; 10 | export 'src/packages/flutter/painting.dart'; 11 | export 'src/packages/flutter/physics.dart'; 12 | export 'src/packages/flutter/rendering.dart'; 13 | export 'src/packages/flutter/scheduler.dart'; 14 | export 'src/packages/flutter/semantics.dart'; 15 | export 'src/packages/flutter/services.dart'; 16 | export 'src/packages/flutter/widgets.dart'; 17 | export 'src/packages/meta/meta.dart'; 18 | export 'src/packages/mx_dart_sdk.dart'; 19 | // export 'src/packages/typed_data/typed_buffers.dart'; 20 | // export 'src/packages/vector_math/hash.dart'; 21 | export 'src/packages/vector_math/vector_math_64.dart'; 22 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/animation.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import './src/animation/tween_sequence.dart'; 7 | import './src/animation/tween.dart'; 8 | import './src/animation/curves.dart'; 9 | import './src/animation/animations.dart'; 10 | import './src/animation/animation_controller.dart'; 11 | import './src/animation/animation.dart'; 12 | 13 | Map registerAnimationLibrarySeries() { 14 | Map m = {}; 15 | m.addAll(registerTweenSequenceSeries()); 16 | m.addAll(registerTweenSeries()); 17 | m.addAll(registerCurvesSeries()); 18 | m.addAll(registerAnimationsSeries()); 19 | m.addAll(registerAnimationControllerSeries()); 20 | m.addAll(registerAnimationSeries()); 21 | return m; 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/physics.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import './src/physics/tolerance.dart'; 7 | import './src/physics/spring_simulation.dart'; 8 | import './src/physics/simulation.dart'; 9 | import './src/physics/gravity_simulation.dart'; 10 | import './src/physics/friction_simulation.dart'; 11 | import './src/physics/clamped_simulation.dart'; 12 | 13 | Map registerPhysicsLibrarySeries() { 14 | Map m = {}; 15 | m.addAll(registerToleranceSeries()); 16 | m.addAll(registerSpringSimulationSeries()); 17 | m.addAll(registerSimulationSeries()); 18 | m.addAll(registerGravitySimulationSeries()); 19 | m.addAll(registerFrictionSimulationSeries()); 20 | m.addAll(registerClampedSimulationSeries()); 21 | return m; 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/scheduler.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import './src/scheduler/ticker.dart'; 7 | import './src/scheduler/priority.dart'; 8 | import './src/scheduler/binding.dart'; 9 | 10 | Map registerSchedulerLibrarySeries() { 11 | Map m = {}; 12 | m.addAll(registerTickerSeries()); 13 | m.addAll(registerPrioritySeries()); 14 | m.addAll(registerBindingSeries()); 15 | return m; 16 | } 17 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/semantics.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import './src/semantics/semantics_service.dart'; 7 | import './src/semantics/semantics.dart'; 8 | 9 | Map registerSemanticsLibrarySeries() { 10 | Map m = {}; 11 | m.addAll(registerSemanticsServiceSeries()); 12 | m.addAll(registerSemanticsSeries()); 13 | return m; 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/cupertino/icon_theme_data.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/cupertino/icon_theme_data.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/widgets.dart'; 9 | import 'package:flutter/src/cupertino/colors.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerIconThemeDataSeries() { 13 | var m = {}; 14 | m[_cupertinoIconThemeData.funName] = _cupertinoIconThemeData; 15 | return m; 16 | } 17 | var _cupertinoIconThemeData = MXFunctionInvoke( 18 | "CupertinoIconThemeData", 19 | ({ 20 | Color color, 21 | dynamic opacity, 22 | dynamic size, 23 | }) => CupertinoIconThemeData( 24 | color: color, 25 | opacity: opacity?.toDouble(), 26 | size: size?.toDouble(), 27 | ), 28 | [ 29 | "color", 30 | "opacity", 31 | "size", 32 | ], 33 | ); 34 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/cupertino/text_selection.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/cupertino/text_selection.dart'; 7 | import 'dart:collection'; 8 | import 'dart:math' as math; 9 | import 'dart:ui' as ui; 10 | import 'package:flutter/widgets.dart'; 11 | import 'package:flutter/rendering.dart'; 12 | import 'package:flutter/services.dart'; 13 | import 'package:flutter/src/cupertino/button.dart'; 14 | import 'package:flutter/src/cupertino/colors.dart'; 15 | import 'package:flutter/src/cupertino/localizations.dart'; 16 | import 'package:flutter/src/cupertino/theme.dart'; 17 | 18 | ///把自己能处理的类注册到分发器中 19 | Map registerTextSelectionSeries() { 20 | var m = {}; 21 | return m; 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/foundation/annotations.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/foundation/annotations.dart'; 7 | 8 | ///把自己能处理的类注册到分发器中 9 | Map registerAnnotationsSeries() { 10 | var m = {}; 11 | m[_category.funName] = _category; 12 | m[_documentationIcon.funName] = _documentationIcon; 13 | m[_summary.funName] = _summary; 14 | return m; 15 | } 16 | var _category = MXFunctionInvoke( 17 | "Category", 18 | ({ 19 | dynamic sections, 20 | }) => Category( 21 | toListT(sections), 22 | ), 23 | [ 24 | "sections", 25 | ], 26 | ); 27 | var _documentationIcon = MXFunctionInvoke( 28 | "DocumentationIcon", 29 | ({ 30 | String url, 31 | }) => DocumentationIcon( 32 | url, 33 | ), 34 | [ 35 | "url", 36 | ], 37 | ); 38 | var _summary = MXFunctionInvoke( 39 | "Summary", 40 | ({ 41 | String text, 42 | }) => Summary( 43 | text, 44 | ), 45 | [ 46 | "text", 47 | ], 48 | ); 49 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/foundation/basic_types.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/foundation/basic_types.dart'; 7 | import 'dart:async'; 8 | import 'dart:collection'; 9 | import 'dart:ui'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerBasicTypesSeries() { 13 | var m = {}; 14 | m[_factory.funName] = _factory; 15 | return m; 16 | } 17 | var _factory = MXFunctionInvoke( 18 | "Factory", 19 | ({ 20 | dynamic constructor, 21 | }) => Factory( 22 | null, 23 | ), 24 | [ 25 | "constructor", 26 | ], 27 | ); 28 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/foundation/binding.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/foundation/binding.dart'; 7 | import 'dart:async'; 8 | import 'dart:convert'; 9 | import 'dart:developer' as developer; 10 | import 'dart:io'; 11 | import 'dart:ui' as ui; 12 | import 'package:meta/meta.dart'; 13 | import 'package:flutter/src/foundation/assertions.dart'; 14 | import 'package:flutter/src/foundation/basic_types.dart'; 15 | import 'package:flutter/src/foundation/constants.dart'; 16 | import 'package:flutter/src/foundation/debug.dart'; 17 | import 'package:flutter/src/foundation/object.dart'; 18 | import 'package:flutter/src/foundation/platform.dart'; 19 | import 'package:flutter/src/foundation/print.dart'; 20 | 21 | ///把自己能处理的类注册到分发器中 22 | Map registerBindingSeries() { 23 | var m = {}; 24 | return m; 25 | } 26 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/foundation/bitfield.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/foundation/bitfield.dart'; 7 | 8 | ///把自己能处理的类注册到分发器中 9 | Map registerBitfieldSeries() { 10 | var m = {}; 11 | m[_bitField.funName] = _bitField; 12 | m[_bitField_filled.funName] = _bitField_filled; 13 | return m; 14 | } 15 | var _bitField = MXFunctionInvoke( 16 | "BitField", 17 | ({ 18 | int length, 19 | }) => BitField( 20 | length, 21 | ), 22 | [ 23 | "length", 24 | ], 25 | ); 26 | var _bitField_filled = MXFunctionInvoke( 27 | "BitField.filled", 28 | ({ 29 | int length, 30 | bool value, 31 | }) => BitField.filled( 32 | length, 33 | value, 34 | ), 35 | [ 36 | "length", 37 | "value", 38 | ], 39 | ); 40 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/foundation/change_notifier.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/foundation/change_notifier.dart'; 7 | import 'dart:collection'; 8 | import 'package:meta/meta.dart'; 9 | import 'package:flutter/src/foundation/assertions.dart'; 10 | import 'package:flutter/src/foundation/basic_types.dart'; 11 | import 'package:flutter/src/foundation/diagnostics.dart'; 12 | 13 | ///把自己能处理的类注册到分发器中 14 | Map registerChangeNotifierSeries() { 15 | var m = {}; 16 | m[_listenable_merge.funName] = _listenable_merge; 17 | m[_valueNotifier.funName] = _valueNotifier; 18 | return m; 19 | } 20 | var _listenable_merge = MXFunctionInvoke( 21 | "Listenable.merge", 22 | ({ 23 | dynamic listenables, 24 | }) => Listenable.merge( 25 | toListT(listenables), 26 | ), 27 | [ 28 | "listenables", 29 | ], 30 | ); 31 | var _valueNotifier = MXFunctionInvoke( 32 | "ValueNotifier", 33 | ({ 34 | dynamic value, 35 | }) => ValueNotifier( 36 | value, 37 | ), 38 | [ 39 | "value", 40 | ], 41 | ); 42 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/foundation/key.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/foundation/key.dart'; 7 | import 'dart:ui'; 8 | import 'package:meta/meta.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerKeySeries() { 12 | var m = {}; 13 | m[_key.funName] = _key; 14 | m[_valueKey.funName] = _valueKey; 15 | return m; 16 | } 17 | var _key = MXFunctionInvoke( 18 | "Key", 19 | ({ 20 | String value, 21 | }) => Key( 22 | value, 23 | ), 24 | [ 25 | "value", 26 | ], 27 | ); 28 | var _valueKey = MXFunctionInvoke( 29 | "ValueKey", 30 | ({ 31 | dynamic value, 32 | }) => ValueKey( 33 | value, 34 | ), 35 | [ 36 | "value", 37 | ], 38 | ); 39 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/foundation/node.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/foundation/node.dart'; 7 | import 'package:meta/meta.dart'; 8 | 9 | ///把自己能处理的类注册到分发器中 10 | Map registerNodeSeries() { 11 | var m = {}; 12 | return m; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/foundation/serialization.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/foundation/serialization.dart'; 7 | import 'dart:typed_data'; 8 | import 'package:typed_data/typed_buffers.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerSerializationSeries() { 12 | var m = {}; 13 | m[_readBuffer.funName] = _readBuffer; 14 | return m; 15 | } 16 | var _readBuffer = MXFunctionInvoke( 17 | "ReadBuffer", 18 | ({ 19 | ByteData data, 20 | }) => ReadBuffer( 21 | data, 22 | ), 23 | [ 24 | "data", 25 | ], 26 | ); 27 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/foundation/synchronous_future.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/foundation/synchronous_future.dart'; 7 | import 'dart:async'; 8 | 9 | ///把自己能处理的类注册到分发器中 10 | Map registerSynchronousFutureSeries() { 11 | var m = {}; 12 | m[_synchronousFuture.funName] = _synchronousFuture; 13 | return m; 14 | } 15 | var _synchronousFuture = MXFunctionInvoke( 16 | "SynchronousFuture", 17 | ({ 18 | dynamic value, 19 | }) => SynchronousFuture( 20 | value, 21 | ), 22 | [ 23 | "value", 24 | ], 25 | ); 26 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/gestures/arena.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/gestures/arena.dart'; 7 | import 'dart:async'; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/src/gestures/debug.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerArenaSeries() { 13 | var m = {}; 14 | m[_gestureDisposition.funName] = _gestureDisposition; 15 | return m; 16 | } 17 | var _gestureDisposition = MXFunctionInvoke( 18 | "GestureDisposition", 19 | ({String name, int index}) => MXGestureDisposition.parse(name, index), 20 | ["name", "index"] 21 | );class MXGestureDisposition { 22 | static GestureDisposition parse(String name, int index) { 23 | switch(name) { 24 | case 'GestureDisposition.accepted': 25 | return GestureDisposition.accepted; 26 | case 'GestureDisposition.rejected': 27 | return GestureDisposition.rejected; 28 | } 29 | return null; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/gestures/converter.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/gestures/converter.dart'; 7 | import 'dart:ui' as ui; 8 | import 'package:flutter/src/gestures/events.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerConverterSeries() { 12 | var m = {}; 13 | return m; 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/gestures/drag.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/gestures/drag.dart'; 7 | import 'package:flutter/src/gestures/drag_details.dart'; 8 | 9 | ///把自己能处理的类注册到分发器中 10 | Map registerDragSeries() { 11 | var m = {}; 12 | return m; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/gestures/eager.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/gestures/eager.dart'; 7 | import 'package:flutter/src/gestures/arena.dart'; 8 | import 'package:flutter/src/gestures/events.dart'; 9 | import 'package:flutter/src/gestures/recognizer.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerEagerSeries() { 13 | var m = {}; 14 | m[_eagerGestureRecognizer.funName] = _eagerGestureRecognizer; 15 | return m; 16 | } 17 | var _eagerGestureRecognizer = MXFunctionInvoke( 18 | "EagerGestureRecognizer", 19 | ({ 20 | PointerDeviceKind kind, 21 | }) => EagerGestureRecognizer( 22 | kind: kind, 23 | ), 24 | [ 25 | "kind", 26 | ], 27 | ); 28 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/gestures/hit_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/gestures/hit_test.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:vector_math/vector_math_64.dart'; 9 | import 'package:flutter/src/gestures/events.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerHitTestSeries() { 13 | var m = {}; 14 | m[_hitTestEntry.funName] = _hitTestEntry; 15 | m[_hitTestResult_wrap.funName] = _hitTestResult_wrap; 16 | return m; 17 | } 18 | var _hitTestEntry = MXFunctionInvoke( 19 | "HitTestEntry", 20 | ({ 21 | HitTestTarget target, 22 | }) => HitTestEntry( 23 | target, 24 | ), 25 | [ 26 | "target", 27 | ], 28 | ); 29 | var _hitTestResult_wrap = MXFunctionInvoke( 30 | "HitTestResult.wrap", 31 | ({ 32 | HitTestResult result, 33 | }) => HitTestResult.wrap( 34 | result, 35 | ), 36 | [ 37 | "result", 38 | ], 39 | ); 40 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/gestures/lsq_solver.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/gestures/lsq_solver.dart'; 7 | import 'dart:math' as math; 8 | import 'dart:typed_data'; 9 | import 'package:flutter/foundation.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerLsqSolverSeries() { 13 | var m = {}; 14 | m[_polynomialFit.funName] = _polynomialFit; 15 | m[_leastSquaresSolver.funName] = _leastSquaresSolver; 16 | return m; 17 | } 18 | var _polynomialFit = MXFunctionInvoke( 19 | "PolynomialFit", 20 | ({ 21 | int degree, 22 | }) => PolynomialFit( 23 | degree, 24 | ), 25 | [ 26 | "degree", 27 | ], 28 | ); 29 | var _leastSquaresSolver = MXFunctionInvoke( 30 | "LeastSquaresSolver", 31 | ({ 32 | dynamic x, 33 | dynamic y, 34 | dynamic w, 35 | }) => LeastSquaresSolver( 36 | toListT(x), 37 | toListT(y), 38 | toListT(w), 39 | ), 40 | [ 41 | "x", 42 | "y", 43 | "w", 44 | ], 45 | ); 46 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/gestures/pointer_router.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/gestures/pointer_router.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:vector_math/vector_math_64.dart'; 9 | import 'package:flutter/src/gestures/events.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerPointerRouterSeries() { 13 | var m = {}; 14 | return m; 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/gestures/pointer_signal_resolver.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/gestures/pointer_signal_resolver.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/src/gestures/events.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerPointerSignalResolverSeries() { 12 | var m = {}; 13 | return m; 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/gestures/resampler.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/gestures/resampler.dart'; 7 | import 'dart:collection'; 8 | import 'package:flutter/src/gestures/events.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerResamplerSeries() { 12 | var m = {}; 13 | return m; 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/gestures/team.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/gestures/team.dart'; 7 | import 'package:flutter/src/gestures/arena.dart'; 8 | import 'package:flutter/src/gestures/binding.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerTeamSeries() { 12 | var m = {}; 13 | return m; 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/bottom_app_bar_theme.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/bottom_app_bar_theme.dart'; 7 | import 'dart:ui'; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/widgets.dart'; 10 | import 'package:flutter/src/material/theme.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerBottomAppBarThemeSeries() { 14 | var m = {}; 15 | m[_bottomAppBarTheme.funName] = _bottomAppBarTheme; 16 | return m; 17 | } 18 | var _bottomAppBarTheme = MXFunctionInvoke( 19 | "BottomAppBarTheme", 20 | ({ 21 | Color color, 22 | dynamic elevation, 23 | NotchedShape shape, 24 | }) => BottomAppBarTheme( 25 | color: color, 26 | elevation: elevation?.toDouble(), 27 | shape: shape, 28 | ), 29 | [ 30 | "color", 31 | "elevation", 32 | "shape", 33 | ], 34 | ); 35 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/button_style_button.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/button_style_button.dart'; 7 | import 'dart:math' as math; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/gestures.dart'; 10 | import 'package:flutter/rendering.dart'; 11 | import 'package:flutter/widgets.dart'; 12 | import 'package:flutter/src/material/button_style.dart'; 13 | import 'package:flutter/src/material/colors.dart'; 14 | import 'package:flutter/src/material/constants.dart'; 15 | import 'package:flutter/src/material/ink_ripple.dart'; 16 | import 'package:flutter/src/material/ink_well.dart'; 17 | import 'package:flutter/src/material/material.dart'; 18 | import 'package:flutter/src/material/material_state.dart'; 19 | import 'package:flutter/src/material/theme_data.dart'; 20 | 21 | ///把自己能处理的类注册到分发器中 22 | Map registerButtonStyleButtonSeries() { 23 | var m = {}; 24 | return m; 25 | } 26 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/card_theme.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/card_theme.dart'; 7 | import 'dart:ui'; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/widgets.dart'; 10 | import 'package:flutter/src/material/theme.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerCardThemeSeries() { 14 | var m = {}; 15 | m[_cardTheme.funName] = _cardTheme; 16 | return m; 17 | } 18 | var _cardTheme = MXFunctionInvoke( 19 | "CardTheme", 20 | ({ 21 | Clip clipBehavior, 22 | Color color, 23 | Color shadowColor, 24 | dynamic elevation, 25 | EdgeInsetsGeometry margin, 26 | ShapeBorder shape, 27 | }) => CardTheme( 28 | clipBehavior: clipBehavior, 29 | color: color, 30 | shadowColor: shadowColor, 31 | elevation: elevation?.toDouble(), 32 | margin: margin, 33 | shape: shape, 34 | ), 35 | [ 36 | "clipBehavior", 37 | "color", 38 | "shadowColor", 39 | "elevation", 40 | "margin", 41 | "shape", 42 | ], 43 | ); 44 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/data_table_source.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/data_table_source.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/src/material/data_table.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerDataTableSourceSeries() { 12 | var m = {}; 13 | return m; 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/dialog_theme.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/dialog_theme.dart'; 7 | import 'dart:ui'; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/widgets.dart'; 10 | import 'package:flutter/src/material/theme.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerDialogThemeSeries() { 14 | var m = {}; 15 | m[_dialogTheme.funName] = _dialogTheme; 16 | return m; 17 | } 18 | var _dialogTheme = MXFunctionInvoke( 19 | "DialogTheme", 20 | ({ 21 | Color backgroundColor, 22 | dynamic elevation, 23 | ShapeBorder shape, 24 | TextStyle titleTextStyle, 25 | TextStyle contentTextStyle, 26 | }) => DialogTheme( 27 | backgroundColor: backgroundColor, 28 | elevation: elevation?.toDouble(), 29 | shape: shape, 30 | titleTextStyle: titleTextStyle, 31 | contentTextStyle: contentTextStyle, 32 | ), 33 | [ 34 | "backgroundColor", 35 | "elevation", 36 | "shape", 37 | "titleTextStyle", 38 | "contentTextStyle", 39 | ], 40 | ); 41 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/elevation_overlay.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/elevation_overlay.dart'; 7 | import 'dart:math' as math; 8 | import 'package:flutter/widgets.dart'; 9 | import 'package:flutter/src/material/theme.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerElevationOverlaySeries() { 13 | var m = {}; 14 | return m; 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/feedback.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/feedback.dart'; 7 | import 'dart:async'; 8 | import 'package:flutter/rendering.dart'; 9 | import 'package:flutter/semantics.dart'; 10 | import 'package:flutter/services.dart'; 11 | import 'package:flutter/widgets.dart'; 12 | import 'package:flutter/src/material/theme.dart'; 13 | 14 | ///把自己能处理的类注册到分发器中 15 | Map registerFeedbackSeries() { 16 | var m = {}; 17 | return m; 18 | } 19 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/flutter_logo.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/flutter_logo.dart'; 7 | import 'package:flutter/widgets.dart'; 8 | 9 | ///把自己能处理的类注册到分发器中 10 | Map registerFlutterLogoSeries() { 11 | var m = {}; 12 | m[_flutterLogo.funName] = _flutterLogo; 13 | return m; 14 | } 15 | var _flutterLogo = MXFunctionInvoke( 16 | "FlutterLogo", 17 | ({ 18 | Key key, 19 | dynamic size, 20 | Color textColor = const Color(0xFF757575), 21 | FlutterLogoStyle style = FlutterLogoStyle.markOnly, 22 | Duration duration = const Duration(milliseconds: 750), 23 | Curve curve = Curves.fastOutSlowIn, 24 | }) => FlutterLogo( 25 | key: key, 26 | size: size?.toDouble(), 27 | textColor: textColor, 28 | style: style, 29 | duration: duration, 30 | curve: curve, 31 | ), 32 | [ 33 | "key", 34 | "size", 35 | "textColor", 36 | "style", 37 | "duration", 38 | "curve", 39 | ], 40 | ); 41 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/grid_tile.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/grid_tile.dart'; 7 | import 'package:flutter/widgets.dart'; 8 | 9 | ///把自己能处理的类注册到分发器中 10 | Map registerGridTileSeries() { 11 | var m = {}; 12 | m[_gridTile.funName] = _gridTile; 13 | return m; 14 | } 15 | var _gridTile = MXFunctionInvoke( 16 | "GridTile", 17 | ({ 18 | Key key, 19 | Widget header, 20 | Widget footer, 21 | Widget child, 22 | }) => GridTile( 23 | key: key, 24 | header: header, 25 | footer: footer, 26 | child: child, 27 | ), 28 | [ 29 | "key", 30 | "header", 31 | "footer", 32 | "child", 33 | ], 34 | ); 35 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/grid_tile_bar.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/grid_tile_bar.dart'; 7 | import 'package:flutter/widgets.dart'; 8 | import 'package:flutter/src/material/colors.dart'; 9 | import 'package:flutter/src/material/theme.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerGridTileBarSeries() { 13 | var m = {}; 14 | m[_gridTileBar.funName] = _gridTileBar; 15 | return m; 16 | } 17 | var _gridTileBar = MXFunctionInvoke( 18 | "GridTileBar", 19 | ({ 20 | Key key, 21 | Color backgroundColor, 22 | Widget leading, 23 | Widget title, 24 | Widget subtitle, 25 | Widget trailing, 26 | }) => GridTileBar( 27 | key: key, 28 | backgroundColor: backgroundColor, 29 | leading: leading, 30 | title: title, 31 | subtitle: subtitle, 32 | trailing: trailing, 33 | ), 34 | [ 35 | "key", 36 | "backgroundColor", 37 | "leading", 38 | "title", 39 | "subtitle", 40 | "trailing", 41 | ], 42 | ); 43 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/material_localizations.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/material_localizations.dart'; 7 | import 'dart:async'; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/widgets.dart'; 10 | import 'package:flutter/src/material/reorderable_list.dart'; 11 | import 'package:flutter/src/material/text_theme.dart'; 12 | import 'package:flutter/src/material/time.dart'; 13 | import 'package:flutter/src/material/typography.dart'; 14 | 15 | ///把自己能处理的类注册到分发器中 16 | Map registerMaterialLocalizationsSeries() { 17 | var m = {}; 18 | m[_defaultMaterialLocalizations_delegate.funName] = _defaultMaterialLocalizations_delegate; 19 | return m; 20 | } 21 | var _defaultMaterialLocalizations_delegate = MXFunctionInvoke( 22 | "DefaultMaterialLocalizations.delegate", 23 | () => DefaultMaterialLocalizations.delegate 24 | ); 25 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/page_transitions_theme.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/page_transitions_theme.dart'; 7 | import 'package:flutter/cupertino.dart'; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/widgets.dart'; 10 | import 'package:flutter/src/material/colors.dart'; 11 | import 'package:flutter/src/material/theme.dart'; 12 | 13 | ///把自己能处理的类注册到分发器中 14 | Map registerPageTransitionsThemeSeries() { 15 | var m = {}; 16 | m[_pageTransitionsTheme.funName] = _pageTransitionsTheme; 17 | return m; 18 | } 19 | var _pageTransitionsTheme = MXFunctionInvoke( 20 | "PageTransitionsTheme", 21 | ({ 22 | dynamic builders, 23 | }) => PageTransitionsTheme( 24 | builders: toMapT(builders), 25 | ), 26 | [ 27 | "builders", 28 | ], 29 | ); 30 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/scrollbar.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/scrollbar.dart'; 7 | import 'dart:async'; 8 | import 'package:flutter/cupertino.dart'; 9 | import 'package:flutter/widgets.dart'; 10 | import 'package:flutter/src/material/theme.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerScrollbarSeries() { 14 | var m = {}; 15 | m[_scrollbar.funName] = _scrollbar; 16 | return m; 17 | } 18 | var _scrollbar = MXFunctionInvoke( 19 | "Scrollbar", 20 | ({ 21 | Key key, 22 | Widget child, 23 | ScrollController controller, 24 | bool isAlwaysShown = false, 25 | dynamic thickness, 26 | Radius radius, 27 | }) => Scrollbar( 28 | key: key, 29 | child: child, 30 | controller: controller, 31 | isAlwaysShown: isAlwaysShown, 32 | thickness: thickness?.toDouble(), 33 | radius: radius, 34 | ), 35 | [ 36 | "key", 37 | "child", 38 | "controller", 39 | "isAlwaysShown", 40 | "thickness", 41 | "radius", 42 | ], 43 | ); 44 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/search.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/search.dart'; 7 | import 'dart:async'; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/widgets.dart'; 10 | import 'package:flutter/src/material/app_bar.dart'; 11 | import 'package:flutter/src/material/colors.dart'; 12 | import 'package:flutter/src/material/debug.dart'; 13 | import 'package:flutter/src/material/input_border.dart'; 14 | import 'package:flutter/src/material/input_decorator.dart'; 15 | import 'package:flutter/src/material/material_localizations.dart'; 16 | import 'package:flutter/src/material/scaffold.dart'; 17 | import 'package:flutter/src/material/text_field.dart'; 18 | import 'package:flutter/src/material/theme.dart'; 19 | 20 | ///把自己能处理的类注册到分发器中 21 | Map registerSearchSeries() { 22 | var m = {}; 23 | return m; 24 | } 25 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/tab_indicator.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/tab_indicator.dart'; 7 | import 'package:flutter/widgets.dart'; 8 | import 'package:flutter/src/material/colors.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerTabIndicatorSeries() { 12 | var m = {}; 13 | m[_underlineTabIndicator.funName] = _underlineTabIndicator; 14 | return m; 15 | } 16 | var _underlineTabIndicator = MXFunctionInvoke( 17 | "UnderlineTabIndicator", 18 | ({ 19 | BorderSide borderSide = const BorderSide(width: 2.0, color: Colors.white), 20 | EdgeInsetsGeometry insets = EdgeInsets.zero, 21 | }) => UnderlineTabIndicator( 22 | borderSide: borderSide, 23 | insets: insets, 24 | ), 25 | [ 26 | "borderSide", 27 | "insets", 28 | ], 29 | ); 30 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/material/toggleable.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/material/toggleable.dart'; 7 | import 'package:flutter/animation.dart'; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/gestures.dart'; 10 | import 'package:flutter/rendering.dart'; 11 | import 'package:flutter/scheduler.dart'; 12 | import 'package:flutter/src/material/constants.dart'; 13 | 14 | ///把自己能处理的类注册到分发器中 15 | Map registerToggleableSeries() { 16 | var m = {}; 17 | return m; 18 | } 19 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/painting/beveled_rectangle_border.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/painting/beveled_rectangle_border.dart'; 7 | import 'dart:math' as math; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/src/painting/basic_types.dart'; 10 | import 'package:flutter/src/painting/border_radius.dart'; 11 | import 'package:flutter/src/painting/borders.dart'; 12 | import 'package:flutter/src/painting/edge_insets.dart'; 13 | 14 | ///把自己能处理的类注册到分发器中 15 | Map registerBeveledRectangleBorderSeries() { 16 | var m = {}; 17 | m[_beveledRectangleBorder.funName] = _beveledRectangleBorder; 18 | return m; 19 | } 20 | var _beveledRectangleBorder = MXFunctionInvoke( 21 | "BeveledRectangleBorder", 22 | ({ 23 | BorderSide side = BorderSide.none, 24 | BorderRadiusGeometry borderRadius = BorderRadius.zero, 25 | }) => BeveledRectangleBorder( 26 | side: side, 27 | borderRadius: borderRadius, 28 | ), 29 | [ 30 | "side", 31 | "borderRadius", 32 | ], 33 | ); 34 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/painting/box_shadow.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/painting/box_shadow.dart'; 7 | import 'dart:math' as math; 8 | import 'dart:ui' as ui; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/src/painting/basic_types.dart'; 11 | import 'package:flutter/src/painting/debug.dart'; 12 | 13 | ///把自己能处理的类注册到分发器中 14 | Map registerBoxShadowSeries() { 15 | var m = {}; 16 | m[_boxShadow.funName] = _boxShadow; 17 | return m; 18 | } 19 | var _boxShadow = MXFunctionInvoke( 20 | "BoxShadow", 21 | ({ 22 | ui.Color color = const ui.Color(0xFF000000), 23 | ui.Offset offset = Offset.zero, 24 | dynamic blurRadius = 0.0, 25 | dynamic spreadRadius = 0.0, 26 | }) => BoxShadow( 27 | color: color, 28 | offset: offset, 29 | blurRadius: blurRadius?.toDouble(), 30 | spreadRadius: spreadRadius?.toDouble(), 31 | ), 32 | [ 33 | "color", 34 | "offset", 35 | "blurRadius", 36 | "spreadRadius", 37 | ], 38 | ); 39 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/painting/circle_border.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/painting/circle_border.dart'; 7 | import 'dart:math' as math; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/src/painting/basic_types.dart'; 10 | import 'package:flutter/src/painting/borders.dart'; 11 | import 'package:flutter/src/painting/edge_insets.dart'; 12 | 13 | ///把自己能处理的类注册到分发器中 14 | Map registerCircleBorderSeries() { 15 | var m = {}; 16 | m[_circleBorder.funName] = _circleBorder; 17 | return m; 18 | } 19 | var _circleBorder = MXFunctionInvoke( 20 | "CircleBorder", 21 | ({ 22 | BorderSide side = BorderSide.none, 23 | }) => CircleBorder( 24 | side: side, 25 | ), 26 | [ 27 | "side", 28 | ], 29 | ); 30 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/painting/clip.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/painting/clip.dart'; 7 | import 'dart:ui'; 8 | 9 | ///把自己能处理的类注册到分发器中 10 | Map registerClipSeries() { 11 | var m = {}; 12 | return m; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/painting/continuous_rectangle_border.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/painting/continuous_rectangle_border.dart'; 7 | import 'dart:math' as math; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/src/painting/basic_types.dart'; 10 | import 'package:flutter/src/painting/border_radius.dart'; 11 | import 'package:flutter/src/painting/borders.dart'; 12 | import 'package:flutter/src/painting/edge_insets.dart'; 13 | 14 | ///把自己能处理的类注册到分发器中 15 | Map registerContinuousRectangleBorderSeries() { 16 | var m = {}; 17 | m[_continuousRectangleBorder.funName] = _continuousRectangleBorder; 18 | return m; 19 | } 20 | var _continuousRectangleBorder = MXFunctionInvoke( 21 | "ContinuousRectangleBorder", 22 | ({ 23 | BorderSide side = BorderSide.none, 24 | BorderRadiusGeometry borderRadius = BorderRadius.zero, 25 | }) => ContinuousRectangleBorder( 26 | side: side, 27 | borderRadius: borderRadius, 28 | ), 29 | [ 30 | "side", 31 | "borderRadius", 32 | ], 33 | ); 34 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/painting/debug.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/painting/debug.dart'; 7 | import 'dart:io'; 8 | import 'dart:ui'; 9 | import 'package:flutter/foundation.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerDebugSeries() { 13 | var m = {}; 14 | m[_imageSizeInfo.funName] = _imageSizeInfo; 15 | return m; 16 | } 17 | var _imageSizeInfo = MXFunctionInvoke( 18 | "ImageSizeInfo", 19 | ({ 20 | String source, 21 | Size displaySize, 22 | Size imageSize, 23 | }) => ImageSizeInfo( 24 | source: source, 25 | displaySize: displaySize, 26 | imageSize: imageSize, 27 | ), 28 | [ 29 | "source", 30 | "displaySize", 31 | "imageSize", 32 | ], 33 | ); 34 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/painting/decoration.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/painting/decoration.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/src/painting/basic_types.dart'; 9 | import 'package:flutter/src/painting/edge_insets.dart'; 10 | import 'package:flutter/src/painting/image_provider.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerDecorationSeries() { 14 | var m = {}; 15 | return m; 16 | } 17 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/painting/image_cache.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/painting/image_cache.dart'; 7 | import 'dart:developer'; 8 | import 'dart:ui'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/src/painting/image_stream.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerImageCacheSeries() { 14 | var m = {}; 15 | return m; 16 | } 17 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/painting/image_resolution.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/painting/image_resolution.dart'; 7 | import 'dart:async'; 8 | import 'dart:collection'; 9 | import 'dart:convert'; 10 | import 'dart:ui'; 11 | import 'package:flutter/foundation.dart'; 12 | import 'package:flutter/services.dart'; 13 | import 'package:flutter/src/painting/image_provider.dart'; 14 | 15 | ///把自己能处理的类注册到分发器中 16 | Map registerImageResolutionSeries() { 17 | var m = {}; 18 | m[_assetImage.funName] = _assetImage; 19 | return m; 20 | } 21 | var _assetImage = MXFunctionInvoke( 22 | "AssetImage", 23 | ({ 24 | String assetName, 25 | AssetBundle bundle, 26 | String package, 27 | }) => AssetImage( 28 | assetName, 29 | bundle: bundle, 30 | package: package, 31 | ), 32 | [ 33 | "assetName", 34 | "bundle", 35 | // MX Modified begin 36 | "__mx_package", 37 | // MX Modified end 38 | ], 39 | ); 40 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/painting/matrix_utils.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/painting/matrix_utils.dart'; 7 | import 'dart:typed_data'; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:vector_math/vector_math_64.dart'; 10 | import 'package:flutter/src/painting/basic_types.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerMatrixUtilsSeries() { 14 | var m = {}; 15 | return m; 16 | } 17 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/painting/placeholder_span.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/painting/placeholder_span.dart'; 7 | import 'dart:ui' as ui; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/src/painting/basic_types.dart'; 10 | import 'package:flutter/src/painting/inline_span.dart'; 11 | import 'package:flutter/src/painting/text_painter.dart'; 12 | import 'package:flutter/src/painting/text_span.dart'; 13 | import 'package:flutter/src/painting/text_style.dart'; 14 | 15 | ///把自己能处理的类注册到分发器中 16 | Map registerPlaceholderSpanSeries() { 17 | var m = {}; 18 | return m; 19 | } 20 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/painting/shader_warm_up.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/painting/shader_warm_up.dart'; 7 | import 'dart:async'; 8 | import 'dart:developer'; 9 | import 'dart:ui' as ui; 10 | import 'package:flutter/foundation.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerShaderWarmUpSeries() { 14 | var m = {}; 15 | m[_defaultShaderWarmUp.funName] = _defaultShaderWarmUp; 16 | return m; 17 | } 18 | var _defaultShaderWarmUp = MXFunctionInvoke( 19 | "DefaultShaderWarmUp", 20 | ({ 21 | dynamic drawCallSpacing = 0.0, 22 | ui.Size canvasSize = const ui.Size(100.0, 100.0), 23 | }) => DefaultShaderWarmUp( 24 | drawCallSpacing: drawCallSpacing?.toDouble(), 25 | canvasSize: canvasSize, 26 | ), 27 | [ 28 | "drawCallSpacing", 29 | "canvasSize", 30 | ], 31 | ); 32 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/painting/stadium_border.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/painting/stadium_border.dart'; 7 | import 'dart:ui' as ui; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/src/painting/basic_types.dart'; 10 | import 'package:flutter/src/painting/border_radius.dart'; 11 | import 'package:flutter/src/painting/borders.dart'; 12 | import 'package:flutter/src/painting/circle_border.dart'; 13 | import 'package:flutter/src/painting/edge_insets.dart'; 14 | import 'package:flutter/src/painting/rounded_rectangle_border.dart'; 15 | 16 | ///把自己能处理的类注册到分发器中 17 | Map registerStadiumBorderSeries() { 18 | var m = {}; 19 | m[_stadiumBorder.funName] = _stadiumBorder; 20 | return m; 21 | } 22 | var _stadiumBorder = MXFunctionInvoke( 23 | "StadiumBorder", 24 | ({ 25 | BorderSide side = BorderSide.none, 26 | }) => StadiumBorder( 27 | side: side, 28 | ), 29 | [ 30 | "side", 31 | ], 32 | ); 33 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/physics/clamped_simulation.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/physics/clamped_simulation.dart'; 7 | import 'package:flutter/src/physics/simulation.dart'; 8 | 9 | ///把自己能处理的类注册到分发器中 10 | Map registerClampedSimulationSeries() { 11 | var m = {}; 12 | m[_clampedSimulation.funName] = _clampedSimulation; 13 | return m; 14 | } 15 | var _clampedSimulation = MXFunctionInvoke( 16 | "ClampedSimulation", 17 | ({ 18 | Simulation simulation, 19 | dynamic xMin = double.negativeInfinity, 20 | dynamic xMax = double.infinity, 21 | dynamic dxMin = double.negativeInfinity, 22 | dynamic dxMax = double.infinity, 23 | }) => ClampedSimulation( 24 | simulation, 25 | xMin: xMin?.toDouble(), 26 | xMax: xMax?.toDouble(), 27 | dxMin: dxMin?.toDouble(), 28 | dxMax: dxMax?.toDouble(), 29 | ), 30 | [ 31 | "simulation", 32 | "xMin", 33 | "xMax", 34 | "dxMin", 35 | "dxMax", 36 | ], 37 | ); 38 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/physics/gravity_simulation.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/physics/gravity_simulation.dart'; 7 | import 'package:flutter/src/physics/simulation.dart'; 8 | 9 | ///把自己能处理的类注册到分发器中 10 | Map registerGravitySimulationSeries() { 11 | var m = {}; 12 | m[_gravitySimulation.funName] = _gravitySimulation; 13 | return m; 14 | } 15 | var _gravitySimulation = MXFunctionInvoke( 16 | "GravitySimulation", 17 | ({ 18 | dynamic acceleration, 19 | dynamic distance, 20 | dynamic endDistance, 21 | dynamic velocity, 22 | }) => GravitySimulation( 23 | acceleration?.toDouble(), 24 | distance?.toDouble(), 25 | endDistance?.toDouble(), 26 | velocity?.toDouble(), 27 | ), 28 | [ 29 | "acceleration", 30 | "distance", 31 | "endDistance", 32 | "velocity", 33 | ], 34 | ); 35 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/physics/simulation.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/physics/simulation.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/src/physics/tolerance.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerSimulationSeries() { 12 | var m = {}; 13 | return m; 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/physics/tolerance.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/physics/tolerance.dart'; 7 | 8 | ///把自己能处理的类注册到分发器中 9 | Map registerToleranceSeries() { 10 | var m = {}; 11 | m[_tolerance.funName] = _tolerance; 12 | m[_tolerance_defaultTolerance.funName] = _tolerance_defaultTolerance; 13 | return m; 14 | } 15 | var _tolerance = MXFunctionInvoke( 16 | "Tolerance", 17 | ({ 18 | dynamic distance = 0.001, 19 | dynamic time = 0.001, 20 | dynamic velocity = 0.001, 21 | }) => Tolerance( 22 | distance: distance?.toDouble(), 23 | time: time?.toDouble(), 24 | velocity: velocity?.toDouble(), 25 | ), 26 | [ 27 | "distance", 28 | "time", 29 | "velocity", 30 | ], 31 | ); 32 | var _tolerance_defaultTolerance = MXFunctionInvoke( 33 | "Tolerance.defaultTolerance", 34 | () => Tolerance.defaultTolerance 35 | ); 36 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/rendering/custom_layout.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/rendering/custom_layout.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/src/rendering/box.dart'; 9 | import 'package:flutter/src/rendering/object.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerCustomLayoutSeries() { 13 | var m = {}; 14 | m[_renderCustomMultiChildLayoutBox.funName] = _renderCustomMultiChildLayoutBox; 15 | return m; 16 | } 17 | var _renderCustomMultiChildLayoutBox = MXFunctionInvoke( 18 | "RenderCustomMultiChildLayoutBox", 19 | ({ 20 | dynamic children, 21 | MultiChildLayoutDelegate delegate, 22 | }) => RenderCustomMultiChildLayoutBox( 23 | children: toListT(children), 24 | delegate: delegate, 25 | ), 26 | [ 27 | "children", 28 | "delegate", 29 | ], 30 | ); 31 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/rendering/error.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/rendering/error.dart'; 7 | import 'dart:ui' as ui; 8 | import 'package:flutter/src/rendering/box.dart'; 9 | import 'package:flutter/src/rendering/object.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerErrorSeries() { 13 | var m = {}; 14 | m[_renderErrorBox.funName] = _renderErrorBox; 15 | return m; 16 | } 17 | var _renderErrorBox = MXFunctionInvoke( 18 | "RenderErrorBox", 19 | ({ 20 | String message, 21 | }) => RenderErrorBox( 22 | message, 23 | ), 24 | [ 25 | "message", 26 | ], 27 | ); 28 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/rendering/flow.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/rendering/flow.dart'; 7 | import 'dart:ui' as ui; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:vector_math/vector_math_64.dart'; 10 | import 'package:flutter/src/rendering/box.dart'; 11 | import 'package:flutter/src/rendering/object.dart'; 12 | 13 | ///把自己能处理的类注册到分发器中 14 | Map registerFlowSeries() { 15 | var m = {}; 16 | m[_renderFlow.funName] = _renderFlow; 17 | return m; 18 | } 19 | var _renderFlow = MXFunctionInvoke( 20 | "RenderFlow", 21 | ({ 22 | dynamic children, 23 | FlowDelegate delegate, 24 | }) => RenderFlow( 25 | children: toListT(children), 26 | delegate: delegate, 27 | ), 28 | [ 29 | "children", 30 | "delegate", 31 | ], 32 | ); 33 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/rendering/list_body.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/rendering/list_body.dart'; 7 | import 'dart:math' as math; 8 | import 'package:flutter/src/rendering/box.dart'; 9 | import 'package:flutter/src/rendering/object.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerListBodySeries() { 13 | var m = {}; 14 | m[_renderListBody.funName] = _renderListBody; 15 | return m; 16 | } 17 | var _renderListBody = MXFunctionInvoke( 18 | "RenderListBody", 19 | ({ 20 | dynamic children, 21 | AxisDirection axisDirection = AxisDirection.down, 22 | }) => RenderListBody( 23 | children: toListT(children), 24 | axisDirection: axisDirection, 25 | ), 26 | [ 27 | "children", 28 | "axisDirection", 29 | ], 30 | ); 31 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/rendering/rotated_box.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/rendering/rotated_box.dart'; 7 | import 'dart:math' as math; 8 | import 'package:flutter/gestures.dart'; 9 | import 'package:flutter/painting.dart'; 10 | import 'package:vector_math/vector_math_64.dart'; 11 | import 'package:flutter/src/rendering/box.dart'; 12 | import 'package:flutter/src/rendering/object.dart'; 13 | 14 | ///把自己能处理的类注册到分发器中 15 | Map registerRotatedBoxSeries() { 16 | var m = {}; 17 | m[_renderRotatedBox.funName] = _renderRotatedBox; 18 | return m; 19 | } 20 | var _renderRotatedBox = MXFunctionInvoke( 21 | "RenderRotatedBox", 22 | ({ 23 | int quarterTurns, 24 | RenderBox child, 25 | }) => RenderRotatedBox( 26 | quarterTurns: quarterTurns, 27 | child: child, 28 | ), 29 | [ 30 | "quarterTurns", 31 | "child", 32 | ], 33 | ); 34 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/rendering/sliver_fixed_extent_list.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/rendering/sliver_fixed_extent_list.dart'; 7 | import 'dart:math' as math; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/src/rendering/box.dart'; 10 | import 'package:flutter/src/rendering/sliver.dart'; 11 | import 'package:flutter/src/rendering/sliver_multi_box_adaptor.dart'; 12 | 13 | ///把自己能处理的类注册到分发器中 14 | Map registerSliverFixedExtentListSeries() { 15 | var m = {}; 16 | m[_renderSliverFixedExtentList.funName] = _renderSliverFixedExtentList; 17 | return m; 18 | } 19 | var _renderSliverFixedExtentList = MXFunctionInvoke( 20 | "RenderSliverFixedExtentList", 21 | ({ 22 | RenderSliverBoxChildManager childManager, 23 | dynamic itemExtent, 24 | }) => RenderSliverFixedExtentList( 25 | childManager: childManager, 26 | itemExtent: itemExtent?.toDouble(), 27 | ), 28 | [ 29 | "childManager", 30 | "itemExtent", 31 | ], 32 | ); 33 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/rendering/sliver_list.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/rendering/sliver_list.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/src/rendering/box.dart'; 9 | import 'package:flutter/src/rendering/sliver.dart'; 10 | import 'package:flutter/src/rendering/sliver_multi_box_adaptor.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerSliverListSeries() { 14 | var m = {}; 15 | m[_renderSliverList.funName] = _renderSliverList; 16 | return m; 17 | } 18 | var _renderSliverList = MXFunctionInvoke( 19 | "RenderSliverList", 20 | ({ 21 | RenderSliverBoxChildManager childManager, 22 | }) => RenderSliverList( 23 | childManager: childManager, 24 | ), 25 | [ 26 | "childManager", 27 | ], 28 | ); 29 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/rendering/sliver_multi_box_adaptor.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/rendering/sliver_multi_box_adaptor.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/gestures.dart'; 9 | import 'package:vector_math/vector_math_64.dart'; 10 | import 'package:flutter/src/rendering/box.dart'; 11 | import 'package:flutter/src/rendering/object.dart'; 12 | import 'package:flutter/src/rendering/sliver.dart'; 13 | 14 | ///把自己能处理的类注册到分发器中 15 | Map registerSliverMultiBoxAdaptorSeries() { 16 | var m = {}; 17 | return m; 18 | } 19 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/rendering/texture.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/rendering/texture.dart'; 7 | import 'package:flutter/src/rendering/box.dart'; 8 | import 'package:flutter/src/rendering/layer.dart'; 9 | import 'package:flutter/src/rendering/object.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerTextureSeries() { 13 | var m = {}; 14 | m[_textureBox.funName] = _textureBox; 15 | return m; 16 | } 17 | var _textureBox = MXFunctionInvoke( 18 | "TextureBox", 19 | ({ 20 | int textureId, 21 | FilterQuality filterQuality = FilterQuality.low, 22 | }) => TextureBox( 23 | textureId: textureId, 24 | filterQuality: filterQuality, 25 | ), 26 | [ 27 | "textureId", 28 | "filterQuality", 29 | ], 30 | ); 31 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/scheduler/priority.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/scheduler/priority.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | 9 | ///把自己能处理的类注册到分发器中 10 | Map registerPrioritySeries() { 11 | var m = {}; 12 | m[_priority_idle.funName] = _priority_idle; 13 | m[_priority_animation.funName] = _priority_animation; 14 | m[_priority_touch.funName] = _priority_touch; 15 | m[_priority_kMaxOffset.funName] = _priority_kMaxOffset; 16 | return m; 17 | } 18 | var _priority_idle = MXFunctionInvoke( 19 | "Priority.idle", 20 | () => Priority.idle 21 | ); 22 | var _priority_animation = MXFunctionInvoke( 23 | "Priority.animation", 24 | () => Priority.animation 25 | ); 26 | var _priority_touch = MXFunctionInvoke( 27 | "Priority.touch", 28 | () => Priority.touch 29 | ); 30 | var _priority_kMaxOffset = MXFunctionInvoke( 31 | "Priority.kMaxOffset", 32 | () => Priority.kMaxOffset 33 | ); 34 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/semantics/semantics_event.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/semantics/semantics_event.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/painting.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerSemanticsEventSeries() { 12 | var m = {}; 13 | m[_announceSemanticsEvent.funName] = _announceSemanticsEvent; 14 | m[_tooltipSemanticsEvent.funName] = _tooltipSemanticsEvent; 15 | return m; 16 | } 17 | var _announceSemanticsEvent = MXFunctionInvoke( 18 | "AnnounceSemanticsEvent", 19 | ({ 20 | String message, 21 | TextDirection textDirection, 22 | }) => AnnounceSemanticsEvent( 23 | message, 24 | textDirection, 25 | ), 26 | [ 27 | "message", 28 | "textDirection", 29 | ], 30 | ); 31 | var _tooltipSemanticsEvent = MXFunctionInvoke( 32 | "TooltipSemanticsEvent", 33 | ({ 34 | String message, 35 | }) => TooltipSemanticsEvent( 36 | message, 37 | ), 38 | [ 39 | "message", 40 | ], 41 | ); 42 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/semantics/semantics_service.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/semantics/semantics_service.dart'; 7 | import 'dart:async'; 8 | import 'dart:ui'; 9 | import 'package:flutter/services.dart'; 10 | import 'package:flutter/src/semantics/semantics_event.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerSemanticsServiceSeries() { 14 | var m = {}; 15 | return m; 16 | } 17 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/services/asset_bundle.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/services/asset_bundle.dart'; 7 | import 'dart:async'; 8 | import 'dart:convert'; 9 | import 'dart:io'; 10 | import 'dart:typed_data'; 11 | import 'package:flutter/foundation.dart'; 12 | import 'package:flutter/src/services/binary_messenger.dart'; 13 | 14 | ///把自己能处理的类注册到分发器中 15 | Map registerAssetBundleSeries() { 16 | var m = {}; 17 | m[_networkAssetBundle.funName] = _networkAssetBundle; 18 | return m; 19 | } 20 | var _networkAssetBundle = MXFunctionInvoke( 21 | "NetworkAssetBundle", 22 | ({ 23 | Uri baseUrl, 24 | }) => NetworkAssetBundle( 25 | baseUrl, 26 | ), 27 | [ 28 | "baseUrl", 29 | ], 30 | ); 31 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/services/binary_messenger.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/services/binary_messenger.dart'; 7 | import 'dart:async'; 8 | import 'dart:typed_data'; 9 | import 'dart:ui' as ui; 10 | import 'package:flutter/foundation.dart'; 11 | import 'package:flutter/src/services/binding.dart'; 12 | 13 | ///把自己能处理的类注册到分发器中 14 | Map registerBinaryMessengerSeries() { 15 | var m = {}; 16 | return m; 17 | } 18 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/services/clipboard.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/services/clipboard.dart'; 7 | import 'dart:async'; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/src/services/system_channels.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerClipboardSeries() { 13 | var m = {}; 14 | m[_clipboardData.funName] = _clipboardData; 15 | m[_clipboard_kTextPlain.funName] = _clipboard_kTextPlain; 16 | return m; 17 | } 18 | var _clipboardData = MXFunctionInvoke( 19 | "ClipboardData", 20 | ({ 21 | String text, 22 | }) => ClipboardData( 23 | text: text, 24 | ), 25 | [ 26 | "text", 27 | ], 28 | ); 29 | var _clipboard_kTextPlain = MXFunctionInvoke( 30 | "Clipboard.kTextPlain", 31 | () => Clipboard.kTextPlain 32 | ); 33 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/services/font_loader.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/services/font_loader.dart'; 7 | import 'dart:async'; 8 | import 'dart:typed_data'; 9 | import 'dart:ui'; 10 | import 'package:flutter/foundation.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerFontLoaderSeries() { 14 | var m = {}; 15 | m[_fontLoader.funName] = _fontLoader; 16 | return m; 17 | } 18 | var _fontLoader = MXFunctionInvoke( 19 | "FontLoader", 20 | ({ 21 | String family, 22 | }) => FontLoader( 23 | family, 24 | ), 25 | [ 26 | "family", 27 | ], 28 | ); 29 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/services/haptic_feedback.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/services/haptic_feedback.dart'; 7 | import 'dart:async'; 8 | import 'package:flutter/src/services/system_channels.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerHapticFeedbackSeries() { 12 | var m = {}; 13 | return m; 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/services/message_codecs.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/services/message_codecs.dart'; 7 | import 'dart:convert'; 8 | import 'dart:typed_data'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/src/services/message_codec.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerMessageCodecsSeries() { 14 | var m = {}; 15 | m[_standardMethodCodec.funName] = _standardMethodCodec; 16 | return m; 17 | } 18 | var _standardMethodCodec = MXFunctionInvoke( 19 | "StandardMethodCodec", 20 | ({ 21 | StandardMessageCodec messageCodec, 22 | }) => StandardMethodCodec( 23 | messageCodec, 24 | ), 25 | [ 26 | "messageCodec", 27 | ], 28 | ); 29 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/services/system_sound.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/services/system_sound.dart'; 7 | import 'dart:async'; 8 | import 'package:flutter/src/services/system_channels.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerSystemSoundSeries() { 12 | var m = {}; 13 | m[_systemSoundType.funName] = _systemSoundType; 14 | return m; 15 | } 16 | var _systemSoundType = MXFunctionInvoke( 17 | "SystemSoundType", 18 | ({String name, int index}) => MXSystemSoundType.parse(name, index), 19 | ["name", "index"] 20 | );class MXSystemSoundType { 21 | static SystemSoundType parse(String name, int index) { 22 | switch(name) { 23 | case 'SystemSoundType.click': 24 | return SystemSoundType.click; 25 | case 'SystemSoundType.alert': 26 | return SystemSoundType.alert; 27 | } 28 | return null; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/annotated_region.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/annotated_region.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/rendering.dart'; 9 | import 'package:flutter/src/widgets/framework.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerAnnotatedRegionSeries() { 13 | var m = {}; 14 | m[_annotatedRegion.funName] = _annotatedRegion; 15 | return m; 16 | } 17 | var _annotatedRegion = MXFunctionInvoke( 18 | "AnnotatedRegion", 19 | ({ 20 | Key key, 21 | Widget child, 22 | dynamic value, 23 | bool sized = true, 24 | }) => AnnotatedRegion( 25 | key: key, 26 | child: child, 27 | value: value, 28 | sized: sized, 29 | ), 30 | [ 31 | "key", 32 | "child", 33 | "value", 34 | "sized", 35 | ], 36 | ); 37 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/bottom_navigation_bar_item.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/bottom_navigation_bar_item.dart'; 7 | import 'dart:ui'; 8 | import 'package:flutter/src/widgets/framework.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerBottomNavigationBarItemSeries() { 12 | var m = {}; 13 | m[_bottomNavigationBarItem.funName] = _bottomNavigationBarItem; 14 | return m; 15 | } 16 | var _bottomNavigationBarItem = MXFunctionInvoke( 17 | "BottomNavigationBarItem", 18 | ({ 19 | Widget icon, 20 | Widget title, 21 | String label, 22 | Widget activeIcon, 23 | Color backgroundColor, 24 | }) => BottomNavigationBarItem( 25 | icon: icon, 26 | title: title, 27 | label: label, 28 | activeIcon: activeIcon, 29 | backgroundColor: backgroundColor, 30 | ), 31 | [ 32 | "icon", 33 | "title", 34 | "label", 35 | "activeIcon", 36 | "backgroundColor", 37 | ], 38 | ); 39 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/color_filter.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/color_filter.dart'; 7 | import 'dart:ui'; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/rendering.dart'; 10 | import 'package:flutter/src/widgets/framework.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerColorFilterSeries() { 14 | var m = {}; 15 | m[_colorFiltered.funName] = _colorFiltered; 16 | return m; 17 | } 18 | var _colorFiltered = MXFunctionInvoke( 19 | "ColorFiltered", 20 | ({ 21 | ColorFilter colorFilter, 22 | Widget child, 23 | Key key, 24 | }) => ColorFiltered( 25 | colorFilter: colorFilter, 26 | child: child, 27 | key: key, 28 | ), 29 | [ 30 | "colorFilter", 31 | "child", 32 | "key", 33 | ], 34 | ); 35 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/disposable_build_context.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/disposable_build_context.dart'; 7 | import 'package:flutter/src/widgets/framework.dart'; 8 | 9 | ///把自己能处理的类注册到分发器中 10 | Map registerDisposableBuildContextSeries() { 11 | var m = {}; 12 | m[_disposableBuildContext.funName] = _disposableBuildContext; 13 | return m; 14 | } 15 | var _disposableBuildContext = MXFunctionInvoke( 16 | "DisposableBuildContext", 17 | ({ 18 | State state, 19 | }) => DisposableBuildContext( 20 | state, 21 | ), 22 | [ 23 | "state", 24 | ], 25 | ); 26 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/dual_transition_builder.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/dual_transition_builder.dart'; 7 | import 'package:flutter/src/widgets/basic.dart'; 8 | import 'package:flutter/src/widgets/framework.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerDualTransitionBuilderSeries() { 12 | var m = {}; 13 | m[_dualTransitionBuilder.funName] = _dualTransitionBuilder; 14 | return m; 15 | } 16 | var _dualTransitionBuilder = MXFunctionInvoke( 17 | "DualTransitionBuilder", 18 | ({ 19 | Key key, 20 | Animation animation, 21 | dynamic forwardBuilder, 22 | dynamic reverseBuilder, 23 | Widget child, 24 | }) => DualTransitionBuilder( 25 | key: key, 26 | animation: animation, 27 | forwardBuilder: null, 28 | reverseBuilder: null, 29 | child: child, 30 | ), 31 | [ 32 | "key", 33 | "animation", 34 | "forwardBuilder", 35 | "reverseBuilder", 36 | "child", 37 | ], 38 | ); 39 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/grid_paper.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/grid_paper.dart'; 7 | import 'package:flutter/rendering.dart'; 8 | import 'package:flutter/src/widgets/basic.dart'; 9 | import 'package:flutter/src/widgets/framework.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerGridPaperSeries() { 13 | var m = {}; 14 | m[_gridPaper.funName] = _gridPaper; 15 | return m; 16 | } 17 | var _gridPaper = MXFunctionInvoke( 18 | "GridPaper", 19 | ({ 20 | Key key, 21 | Color color = const Color(0x7FC3E8F3), 22 | dynamic interval = 100.0, 23 | int divisions = 2, 24 | int subdivisions = 5, 25 | Widget child, 26 | }) => GridPaper( 27 | key: key, 28 | color: color, 29 | interval: interval?.toDouble(), 30 | divisions: divisions, 31 | subdivisions: subdivisions, 32 | child: child, 33 | ), 34 | [ 35 | "key", 36 | "color", 37 | "interval", 38 | "divisions", 39 | "subdivisions", 40 | "child", 41 | ], 42 | ); 43 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/icon_data.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/icon_data.dart'; 7 | import 'dart:ui'; 8 | import 'package:flutter/foundation.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerIconDataSeries() { 12 | var m = {}; 13 | m[_iconData.funName] = _iconData; 14 | return m; 15 | } 16 | var _iconData = MXFunctionInvoke( 17 | "IconData", 18 | ({ 19 | int codePoint, 20 | String fontFamily, 21 | String fontPackage, 22 | bool matchTextDirection = false, 23 | }) => IconData( 24 | codePoint, 25 | fontFamily: fontFamily, 26 | fontPackage: fontPackage, 27 | matchTextDirection: matchTextDirection, 28 | ), 29 | [ 30 | "codePoint", 31 | "fontFamily", 32 | "fontPackage", 33 | "matchTextDirection", 34 | ], 35 | ); 36 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/icon_theme.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/icon_theme.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/src/widgets/basic.dart'; 9 | import 'package:flutter/src/widgets/framework.dart'; 10 | import 'package:flutter/src/widgets/icon_theme_data.dart'; 11 | import 'package:flutter/src/widgets/inherited_theme.dart'; 12 | 13 | ///把自己能处理的类注册到分发器中 14 | Map registerIconThemeSeries() { 15 | var m = {}; 16 | m[_iconTheme.funName] = _iconTheme; 17 | return m; 18 | } 19 | var _iconTheme = MXFunctionInvoke( 20 | "IconTheme", 21 | ({ 22 | Key key, 23 | IconThemeData data, 24 | Widget child, 25 | }) => IconTheme( 26 | key: key, 27 | data: data, 28 | child: child, 29 | ), 30 | [ 31 | "key", 32 | "data", 33 | "child", 34 | ], 35 | ); 36 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/image_filter.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/image_filter.dart'; 7 | import 'dart:ui'; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/rendering.dart'; 10 | import 'package:flutter/src/widgets/framework.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerImageFilterSeries() { 14 | var m = {}; 15 | m[_imageFiltered.funName] = _imageFiltered; 16 | return m; 17 | } 18 | var _imageFiltered = MXFunctionInvoke( 19 | "ImageFiltered", 20 | ({ 21 | Key key, 22 | ImageFilter imageFilter, 23 | Widget child, 24 | }) => ImageFiltered( 25 | key: key, 26 | imageFilter: imageFilter, 27 | child: child, 28 | ), 29 | [ 30 | "key", 31 | "imageFilter", 32 | "child", 33 | ], 34 | ); 35 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/inherited_model.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/inherited_model.dart'; 7 | import 'dart:collection'; 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/src/widgets/framework.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerInheritedModelSeries() { 13 | var m = {}; 14 | m[_inheritedModelElement.funName] = _inheritedModelElement; 15 | return m; 16 | } 17 | var _inheritedModelElement = MXFunctionInvoke( 18 | "InheritedModelElement", 19 | ({ 20 | InheritedModel widget, 21 | }) => InheritedModelElement( 22 | widget, 23 | ), 24 | [ 25 | "widget", 26 | ], 27 | ); 28 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/inherited_notifier.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/inherited_notifier.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/src/widgets/framework.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerInheritedNotifierSeries() { 12 | var m = {}; 13 | return m; 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/inherited_theme.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/inherited_theme.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/src/widgets/framework.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerInheritedThemeSeries() { 12 | var m = {}; 13 | return m; 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/layout_builder.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/layout_builder.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/rendering.dart'; 9 | import 'package:flutter/src/widgets/debug.dart'; 10 | import 'package:flutter/src/widgets/framework.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerLayoutBuilderSeries() { 14 | var m = {}; 15 | m[_layoutBuilder.funName] = _layoutBuilder; 16 | return m; 17 | } 18 | var _layoutBuilder = MXFunctionInvoke( 19 | "LayoutBuilder", 20 | ({ 21 | Key key, 22 | dynamic builder, 23 | }) => LayoutBuilder( 24 | key: key, 25 | builder: null, 26 | ), 27 | [ 28 | "key", 29 | "builder", 30 | ], 31 | ); 32 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/notification_listener.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/notification_listener.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/src/widgets/framework.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerNotificationListenerSeries() { 12 | var m = {}; 13 | m[_notificationListener.funName] = _notificationListener; 14 | return m; 15 | } 16 | var _notificationListener = MXFunctionInvoke( 17 | "NotificationListener", 18 | ({ 19 | Key key, 20 | Widget child, 21 | dynamic onNotification, 22 | }) => NotificationListener( 23 | key: key, 24 | child: child, 25 | onNotification: null, 26 | ), 27 | [ 28 | "key", 29 | "child", 30 | "onNotification", 31 | ], 32 | ); 33 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/orientation_builder.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/orientation_builder.dart'; 7 | import 'package:flutter/src/widgets/basic.dart'; 8 | import 'package:flutter/src/widgets/framework.dart'; 9 | import 'package:flutter/src/widgets/layout_builder.dart'; 10 | import 'package:flutter/src/widgets/media_query.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerOrientationBuilderSeries() { 14 | var m = {}; 15 | m[_orientationBuilder.funName] = _orientationBuilder; 16 | return m; 17 | } 18 | var _orientationBuilder = MXFunctionInvoke( 19 | "OrientationBuilder", 20 | ({ 21 | Key key, 22 | dynamic builder, 23 | }) => OrientationBuilder( 24 | key: key, 25 | builder: null, 26 | ), 27 | [ 28 | "key", 29 | "builder", 30 | ], 31 | ); 32 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/page_storage.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/page_storage.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/src/widgets/framework.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerPageStorageSeries() { 12 | var m = {}; 13 | m[_pageStorageKey.funName] = _pageStorageKey; 14 | m[_pageStorage.funName] = _pageStorage; 15 | return m; 16 | } 17 | var _pageStorageKey = MXFunctionInvoke( 18 | "PageStorageKey", 19 | ({ 20 | dynamic value, 21 | }) => PageStorageKey( 22 | value, 23 | ), 24 | [ 25 | "value", 26 | ], 27 | ); 28 | var _pageStorage = MXFunctionInvoke( 29 | "PageStorage", 30 | ({ 31 | Key key, 32 | PageStorageBucket bucket, 33 | Widget child, 34 | }) => PageStorage( 35 | key: key, 36 | bucket: bucket, 37 | child: child, 38 | ), 39 | [ 40 | "key", 41 | "bucket", 42 | "child", 43 | ], 44 | ); 45 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/placeholder.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/placeholder.dart'; 7 | import 'package:flutter/rendering.dart'; 8 | import 'package:flutter/src/widgets/basic.dart'; 9 | import 'package:flutter/src/widgets/framework.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerPlaceholderSeries() { 13 | var m = {}; 14 | m[_placeholder.funName] = _placeholder; 15 | return m; 16 | } 17 | var _placeholder = MXFunctionInvoke( 18 | "Placeholder", 19 | ({ 20 | Key key, 21 | Color color = const Color(0xFF455A64), 22 | dynamic strokeWidth = 2.0, 23 | dynamic fallbackWidth = 400.0, 24 | dynamic fallbackHeight = 400.0, 25 | }) => Placeholder( 26 | key: key, 27 | color: color, 28 | strokeWidth: strokeWidth?.toDouble(), 29 | fallbackWidth: fallbackWidth?.toDouble(), 30 | fallbackHeight: fallbackHeight?.toDouble(), 31 | ), 32 | [ 33 | "key", 34 | "color", 35 | "strokeWidth", 36 | "fallbackWidth", 37 | "fallbackHeight", 38 | ], 39 | ); 40 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/preferred_size.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/preferred_size.dart'; 7 | import 'package:flutter/rendering.dart'; 8 | import 'package:flutter/src/widgets/basic.dart'; 9 | import 'package:flutter/src/widgets/framework.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerPreferredSizeSeries() { 13 | var m = {}; 14 | m[_preferredSize.funName] = _preferredSize; 15 | return m; 16 | } 17 | var _preferredSize = MXFunctionInvoke( 18 | "PreferredSize", 19 | ({ 20 | Key key, 21 | Widget child, 22 | Size preferredSize, 23 | }) => PreferredSize( 24 | key: key, 25 | child: child, 26 | preferredSize: preferredSize, 27 | ), 28 | [ 29 | "key", 30 | "child", 31 | "preferredSize", 32 | ], 33 | ); 34 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/scroll_aware_image_provider.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/scroll_aware_image_provider.dart'; 7 | import 'dart:async'; 8 | import 'package:flutter/painting.dart'; 9 | import 'package:flutter/scheduler.dart'; 10 | import 'package:flutter/src/widgets/disposable_build_context.dart'; 11 | import 'package:flutter/src/widgets/framework.dart'; 12 | import 'package:flutter/src/widgets/scrollable.dart'; 13 | 14 | ///把自己能处理的类注册到分发器中 15 | Map registerScrollAwareImageProviderSeries() { 16 | var m = {}; 17 | m[_scrollAwareImageProvider.funName] = _scrollAwareImageProvider; 18 | return m; 19 | } 20 | var _scrollAwareImageProvider = MXFunctionInvoke( 21 | "ScrollAwareImageProvider", 22 | ({ 23 | DisposableBuildContext> context, 24 | ImageProvider imageProvider, 25 | }) => ScrollAwareImageProvider( 26 | context: context, 27 | imageProvider: imageProvider, 28 | ), 29 | [ 30 | "context", 31 | "imageProvider", 32 | ], 33 | ); 34 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/scroll_configuration.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/scroll_configuration.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/gestures.dart'; 9 | import 'package:flutter/rendering.dart'; 10 | import 'package:flutter/src/widgets/framework.dart'; 11 | import 'package:flutter/src/widgets/overscroll_indicator.dart'; 12 | import 'package:flutter/src/widgets/scroll_physics.dart'; 13 | 14 | ///把自己能处理的类注册到分发器中 15 | Map registerScrollConfigurationSeries() { 16 | var m = {}; 17 | m[_scrollConfiguration.funName] = _scrollConfiguration; 18 | return m; 19 | } 20 | var _scrollConfiguration = MXFunctionInvoke( 21 | "ScrollConfiguration", 22 | ({ 23 | Key key, 24 | ScrollBehavior behavior, 25 | Widget child, 26 | }) => ScrollConfiguration( 27 | key: key, 28 | behavior: behavior, 29 | child: child, 30 | ), 31 | [ 32 | "key", 33 | "behavior", 34 | "child", 35 | ], 36 | ); 37 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/scroll_context.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/scroll_context.dart'; 7 | import 'package:flutter/scheduler.dart'; 8 | import 'package:flutter/rendering.dart'; 9 | import 'package:flutter/src/widgets/framework.dart'; 10 | import 'package:flutter/src/widgets/ticker_provider.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerScrollContextSeries() { 14 | var m = {}; 15 | return m; 16 | } 17 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/size_changed_layout_notifier.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/size_changed_layout_notifier.dart'; 7 | import 'package:flutter/rendering.dart'; 8 | import 'package:flutter/src/widgets/framework.dart'; 9 | import 'package:flutter/src/widgets/notification_listener.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerSizeChangedLayoutNotifierSeries() { 13 | var m = {}; 14 | m[_sizeChangedLayoutNotifier.funName] = _sizeChangedLayoutNotifier; 15 | return m; 16 | } 17 | var _sizeChangedLayoutNotifier = MXFunctionInvoke( 18 | "SizeChangedLayoutNotifier", 19 | ({ 20 | Key key, 21 | Widget child, 22 | }) => SizeChangedLayoutNotifier( 23 | key: key, 24 | child: child, 25 | ), 26 | [ 27 | "key", 28 | "child", 29 | ], 30 | ); 31 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/sliver_layout_builder.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/sliver_layout_builder.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/rendering.dart'; 9 | import 'package:flutter/src/widgets/framework.dart'; 10 | import 'package:flutter/src/widgets/layout_builder.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerSliverLayoutBuilderSeries() { 14 | var m = {}; 15 | m[_sliverLayoutBuilder.funName] = _sliverLayoutBuilder; 16 | return m; 17 | } 18 | var _sliverLayoutBuilder = MXFunctionInvoke( 19 | "SliverLayoutBuilder", 20 | ({ 21 | Key key, 22 | dynamic builder, 23 | }) => SliverLayoutBuilder( 24 | key: key, 25 | builder: null, 26 | ), 27 | [ 28 | "key", 29 | "builder", 30 | ], 31 | ); 32 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/sliver_persistent_header.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/sliver_persistent_header.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/rendering.dart'; 9 | import 'package:flutter/scheduler.dart'; 10 | import 'package:flutter/src/widgets/framework.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerSliverPersistentHeaderSeries() { 14 | var m = {}; 15 | m[_sliverPersistentHeader.funName] = _sliverPersistentHeader; 16 | return m; 17 | } 18 | var _sliverPersistentHeader = MXFunctionInvoke( 19 | "SliverPersistentHeader", 20 | ({ 21 | Key key, 22 | SliverPersistentHeaderDelegate delegate, 23 | bool pinned = false, 24 | bool floating = false, 25 | }) => SliverPersistentHeader( 26 | key: key, 27 | delegate: delegate, 28 | pinned: pinned, 29 | floating: floating, 30 | ), 31 | [ 32 | "key", 33 | "delegate", 34 | "pinned", 35 | "floating", 36 | ], 37 | ); 38 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/sliver_prototype_extent_list.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/sliver_prototype_extent_list.dart'; 7 | import 'package:flutter/rendering.dart'; 8 | import 'package:flutter/src/widgets/basic.dart'; 9 | import 'package:flutter/src/widgets/framework.dart'; 10 | import 'package:flutter/src/widgets/sliver.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerSliverPrototypeExtentListSeries() { 14 | var m = {}; 15 | m[_sliverPrototypeExtentList.funName] = _sliverPrototypeExtentList; 16 | return m; 17 | } 18 | var _sliverPrototypeExtentList = MXFunctionInvoke( 19 | "SliverPrototypeExtentList", 20 | ({ 21 | Key key, 22 | SliverChildDelegate delegate, 23 | Widget prototypeItem, 24 | }) => SliverPrototypeExtentList( 25 | key: key, 26 | delegate: delegate, 27 | prototypeItem: prototypeItem, 28 | ), 29 | [ 30 | "key", 31 | "delegate", 32 | "prototypeItem", 33 | ], 34 | ); 35 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/spacer.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/spacer.dart'; 7 | import 'package:flutter/rendering.dart'; 8 | import 'package:flutter/src/widgets/basic.dart'; 9 | import 'package:flutter/src/widgets/framework.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerSpacerSeries() { 13 | var m = {}; 14 | m[_spacer.funName] = _spacer; 15 | return m; 16 | } 17 | var _spacer = MXFunctionInvoke( 18 | "Spacer", 19 | ({ 20 | Key key, 21 | int flex = 1, 22 | }) => Spacer( 23 | key: key, 24 | flex: flex, 25 | ), 26 | [ 27 | "key", 28 | "flex", 29 | ], 30 | ); 31 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/status_transitions.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/status_transitions.dart'; 7 | import 'package:flutter/src/widgets/basic.dart'; 8 | import 'package:flutter/src/widgets/framework.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerStatusTransitionsSeries() { 12 | var m = {}; 13 | return m; 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/texture.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/texture.dart'; 7 | import 'package:flutter/rendering.dart'; 8 | import 'package:flutter/src/widgets/framework.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerTextureSeries() { 12 | var m = {}; 13 | m[_texture.funName] = _texture; 14 | return m; 15 | } 16 | var _texture = MXFunctionInvoke( 17 | "Texture", 18 | ({ 19 | Key key, 20 | int textureId, 21 | FilterQuality filterQuality = FilterQuality.low, 22 | }) => Texture( 23 | key: key, 24 | textureId: textureId, 25 | filterQuality: filterQuality, 26 | ), 27 | [ 28 | "key", 29 | "textureId", 30 | "filterQuality", 31 | ], 32 | ); 33 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/ticker_provider.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/ticker_provider.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/scheduler.dart'; 9 | import 'package:flutter/src/widgets/framework.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerTickerProviderSeries() { 13 | var m = {}; 14 | m[_tickerMode.funName] = _tickerMode; 15 | return m; 16 | } 17 | 18 | var _tickerMode = MXFunctionInvoke( 19 | "TickerMode", 20 | ({ 21 | Key key, 22 | bool enabled, 23 | Widget child, 24 | }) => 25 | TickerMode( 26 | key: key, 27 | enabled: enabled, 28 | child: child, 29 | ), 30 | [ 31 | "key", 32 | "enabled", 33 | "child", 34 | ], 35 | ); 36 | 37 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/title.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/title.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/services.dart'; 9 | import 'package:flutter/src/widgets/basic.dart'; 10 | import 'package:flutter/src/widgets/framework.dart'; 11 | 12 | ///把自己能处理的类注册到分发器中 13 | Map registerTitleSeries() { 14 | var m = {}; 15 | m[_title.funName] = _title; 16 | return m; 17 | } 18 | var _title = MXFunctionInvoke( 19 | "Title", 20 | ({ 21 | Key key, 22 | String title = '', 23 | Color color, 24 | Widget child, 25 | }) => Title( 26 | key: key, 27 | title: title, 28 | color: color, 29 | child: child, 30 | ), 31 | [ 32 | "key", 33 | "title", 34 | "color", 35 | "child", 36 | ], 37 | ); 38 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/unique_widget.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/unique_widget.dart'; 7 | import 'package:flutter/src/widgets/framework.dart'; 8 | 9 | ///把自己能处理的类注册到分发器中 10 | Map registerUniqueWidgetSeries() { 11 | var m = {}; 12 | return m; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/value_listenable_builder.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/value_listenable_builder.dart'; 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/src/widgets/framework.dart'; 9 | 10 | ///把自己能处理的类注册到分发器中 11 | Map registerValueListenableBuilderSeries() { 12 | var m = {}; 13 | m[_valueListenableBuilder.funName] = _valueListenableBuilder; 14 | return m; 15 | } 16 | var _valueListenableBuilder = MXFunctionInvoke( 17 | "ValueListenableBuilder", 18 | ({ 19 | Key key, 20 | ValueListenable valueListenable, 21 | dynamic builder, 22 | Widget child, 23 | }) => ValueListenableBuilder( 24 | key: key, 25 | valueListenable: valueListenable, 26 | builder: null, 27 | child: child, 28 | ), 29 | [ 30 | "key", 31 | "valueListenable", 32 | "builder", 33 | "child", 34 | ], 35 | ); 36 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/widget_span.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/widget_span.dart'; 7 | import 'dart:ui' as ui; 8 | import 'package:flutter/painting.dart'; 9 | import 'package:flutter/src/widgets/framework.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerWidgetSpanSeries() { 13 | var m = {}; 14 | m[_widgetSpan.funName] = _widgetSpan; 15 | return m; 16 | } 17 | var _widgetSpan = MXFunctionInvoke( 18 | "WidgetSpan", 19 | ({ 20 | Widget child, 21 | ui.PlaceholderAlignment alignment = ui.PlaceholderAlignment.bottom, 22 | ui.TextBaseline baseline, 23 | TextStyle style, 24 | }) => WidgetSpan( 25 | child: child, 26 | alignment: alignment, 27 | baseline: baseline, 28 | style: style, 29 | ), 30 | [ 31 | "child", 32 | "alignment", 33 | "baseline", 34 | "style", 35 | ], 36 | ); 37 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/flutter/src/widgets/will_pop_scope.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:flutter/src/widgets/will_pop_scope.dart'; 7 | import 'package:flutter/src/widgets/framework.dart'; 8 | import 'package:flutter/src/widgets/navigator.dart'; 9 | import 'package:flutter/src/widgets/routes.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerWillPopScopeSeries() { 13 | var m = {}; 14 | m[_willPopScope.funName] = _willPopScope; 15 | return m; 16 | } 17 | var _willPopScope = MXFunctionInvoke( 18 | "WillPopScope", 19 | ({ 20 | Key key, 21 | Widget child, 22 | dynamic onWillPop, 23 | }) => WillPopScope( 24 | key: key, 25 | child: child, 26 | onWillPop: null, 27 | ), 28 | [ 29 | "key", 30 | "child", 31 | "onWillPop", 32 | ], 33 | ); 34 | -------------------------------------------------------------------------------- /lib/src/widgets/src/packages/meta/meta.dart: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:meta/meta.dart'; 7 | import 'package:meta/meta_meta.dart'; 8 | 9 | ///把自己能处理的类注册到分发器中 10 | Map registerMetaSeries() { 11 | var m = {}; 12 | m[_immutable.funName] = _immutable; 13 | m[_required.funName] = _required; 14 | return m; 15 | } 16 | var _immutable = MXFunctionInvoke( 17 | "Immutable", 18 | ({ 19 | String reason, 20 | }) => Immutable( 21 | reason, 22 | ), 23 | [ 24 | "reason", 25 | ], 26 | ); 27 | var _required = MXFunctionInvoke( 28 | "Required", 29 | ({ 30 | String reason, 31 | }) => Required( 32 | reason, 33 | ), 34 | [ 35 | "reason", 36 | ], 37 | ); 38 | -------------------------------------------------------------------------------- /lib/src/widgets_patch/material_patches.dart: -------------------------------------------------------------------------------- 1 | // MXFlutterFramework 2 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. 5 | 6 | import 'dart:convert'; 7 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 8 | import 'package:flutter/material.dart'; 9 | import '../mx_common.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerMaterialPatches() { 13 | var m = {}; 14 | m[_themeOf.funName] = _themeOf; 15 | return m; 16 | } 17 | 18 | var _themeOf = MXFunctionInvoke( 19 | "Theme#of", 20 | ({BuildContext context, bool shadowThemeOnly = false}) { 21 | var themeData = Theme.of(context, shadowThemeOnly: shadowThemeOnly); 22 | return jsonEncode(MXUtil.cThemeDataToJson(themeData)); 23 | }, 24 | ["context", "shadowThemeOnly"], 25 | ); 26 | -------------------------------------------------------------------------------- /lib/src/widgets_patch/patches.dart: -------------------------------------------------------------------------------- 1 | // MXFlutterFramework 2 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. 5 | 6 | import '../mirror/mx_mirror.dart'; 7 | import 'material_patches.dart'; 8 | import 'widgets_patches.dart'; 9 | 10 | Map registerWidgetsPatch() { 11 | Map m = {}; 12 | m.addAll(registerMaterialPatches()); 13 | m.addAll(registerWidgetsPatches()); 14 | return m; 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/widgets_patch/widgets_patches.dart: -------------------------------------------------------------------------------- 1 | // MXFlutterFramework 2 | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. 5 | 6 | import 'dart:convert'; 7 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 8 | import 'package:flutter/material.dart'; 9 | import '../mx_common.dart'; 10 | 11 | ///把自己能处理的类注册到分发器中 12 | Map registerWidgetsPatches() { 13 | var m = {}; 14 | m[_mediaQueryOf.funName] = _mediaQueryOf; 15 | m[_iconThemeOf.funName] = _iconThemeOf; 16 | return m; 17 | } 18 | 19 | var _mediaQueryOf = MXFunctionInvoke( 20 | "MediaQuery#of", 21 | ({BuildContext context, bool nullOk = false}) { 22 | var data = MediaQuery.of(context, nullOk: nullOk); 23 | return jsonEncode(MXUtil.cMediaQueryDataToJson(data)); 24 | }, 25 | ["context", "nullOk"], 26 | ); 27 | 28 | var _iconThemeOf = MXFunctionInvoke( 29 | "IconTheme#of", 30 | ({BuildContext context}) { 31 | var data = IconTheme.of(context); 32 | return jsonEncode(MXUtil.cIconThemeDataToJson(data)); 33 | }, 34 | ["context"], 35 | ); 36 | -------------------------------------------------------------------------------- /mxflutterlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/mxflutterlogo.png -------------------------------------------------------------------------------- /test/flutter/flutter_test_alternative.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // @dart = 2.8 6 | 7 | // Defines a 'package:test' shim. 8 | // TODO(ianh): Remove this file once https://github.com/dart-lang/matcher/issues/98 is fixed 9 | 10 | import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf; // ignore: deprecated_member_use 11 | import 'package:test_api/test_api.dart' as test_package show TypeMatcher; // ignore: deprecated_member_use 12 | 13 | export 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf; // ignore: deprecated_member_use 14 | export 'package:test_api/fake.dart'; // ignore: deprecated_member_use 15 | 16 | /// A matcher that compares the type of the actual value to the type argument T. 17 | test_package.TypeMatcher isInstanceOf() => isA(); 18 | 19 | /// Whether we are running in a web browser. 20 | const bool isBrowser = identical(0, 0.0); 21 | -------------------------------------------------------------------------------- /test/flutter/physics/tolerance_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:mxflutter/mxflutter.dart'; 6 | import 'package:mxflutter/mxflutter_test.dart'; 7 | import 'package:mxflutter/src/mirror_reg_fun_map/mx_mirror_func_reg.dart'; 8 | import 'package:flutter/physics.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | 12 | void main() { 13 | setUp(() { 14 | mxRegisterMirrorFunctions(); 15 | }); 16 | dynamic widgetFromJson(Map widgetJson) { 17 | // 这里先统一使用root 后续要考虑怎么生成一个合适的owner 18 | MXBuildOwner owner = MXBuildOwner.rootBuildOwner(); 19 | dynamic widget = 20 | MXMirror.getInstance().jsonToDartObj(widgetJson, buildOwner: owner); 21 | return widget; 22 | } 23 | 24 | test('Tolerance control test', () { 25 | expect(widgetFromJson({ 26 | 'className': 'Tolerance', 27 | 'constructorName': 'defaultTolerance', 28 | }), hasOneLineDescription); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /test/flutter/widget/container.clipBehaviour.with.shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/test/flutter/widget/container.clipBehaviour.with.shadow.png -------------------------------------------------------------------------------- /test/flutter/widget/container_test.getClipPath.BoxDecoration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/test/flutter/widget/container_test.getClipPath.BoxDecoration.png -------------------------------------------------------------------------------- /test/flutter/widget/container_test.getClipPath.FlutterLogoDecoration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/test/flutter/widget/container_test.getClipPath.FlutterLogoDecoration.png -------------------------------------------------------------------------------- /test/flutter/widget/container_test.getClipPath.ShapeDecoration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/test/flutter/widget/container_test.getClipPath.ShapeDecoration.png -------------------------------------------------------------------------------- /test/flutter/widget/container_test.getClipPath.UnderlineTabIndicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/mxflutter/4ef8373a19ad1b4113af42d6eebd34d092026c68/test/flutter/widget/container_test.getClipPath.UnderlineTabIndicator.png -------------------------------------------------------------------------------- /test/mirror_test/mx_lifecycle_obj.dart: -------------------------------------------------------------------------------- 1 | 2 | class BizServiceApi { 3 | 4 | String name; 5 | BizServiceApi(this.name); 6 | 7 | String requestBizData(String args) { 8 | return "Some sync + args: $args"; 9 | } 10 | 11 | Future requestBizDataAsync(String args) async { 12 | return Future.delayed(Duration(seconds: 1), () { 13 | return "Some async Data + args: $args"; 14 | }); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /test/mirror_test/mx_mirror_lifecycle_obj_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:mxflutter/mxflutter.dart'; 4 | import 'package:mxflutter/mxflutter_test.dart'; 5 | import 'package:mxflutter/src/mirror/mx_mirror.dart'; 6 | import 'package:mxflutter/src/mirror_reg_fun_map/mx_mirror_func_reg.dart'; 7 | import 'package:mockito/mockito.dart'; 8 | 9 | void main() { 10 | setUp(() { 11 | mxRegisterMirrorFunctions(); 12 | }); 13 | 14 | const _objMap = { 15 | "className": "PageController", 16 | "mirrorID": "10001", 17 | "initialPage": 1 18 | }; 19 | 20 | group('Mirror Lifecycle obj PageController', () { 21 | 22 | test('Mirror 第二次用同一个MirrorID 创建,是不是同一个实例 ', () { 23 | var mxMirror = MXMirror.getInstance(); 24 | var mirrorObj = mxMirror.jsonToDartObj(_objMap); 25 | expect(mirrorObj.runtimeType.toString(), "PageController" ); 26 | 27 | var mirrorObj2 = mxMirror.jsonToDartObj(_objMap); 28 | expect(mirrorObj, mirrorObj2 ); 29 | }); 30 | 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /test/util/mx_mock_build_context.dart: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------