From 84931e7cc63447a0523f0f85ff4a38271576ecca Mon Sep 17 00:00:00 2001 From: Jaylen Bian Date: Sun, 18 Jul 2021 17:01:15 +0800 Subject: [PATCH] [infra_ui][keyboard] Update example proj --- .../example/lib/keyboard/keyboard_screen.dart | 3 +- .../flowy_infra_ui/example/lib/main.dart | 6 +- .../flowy_infra_ui/example/macos/Podfile.lock | 22 +++++++ .../macos/Runner.xcodeproj/project.pbxproj | 62 ++++++++++++++++++- .../contents.xcworkspacedata | 3 + .../flowy_infra_ui/example/pubspec.lock | 8 +-- .../flowy_infra_ui/example/pubspec.yaml | 8 --- .../keyboard_visibility_detector.dart | 5 -- .../packages/flowy_infra_ui/pubspec.lock | 8 +-- 9 files changed, 97 insertions(+), 28 deletions(-) create mode 100644 app_flowy/packages/flowy_infra_ui/example/macos/Podfile.lock diff --git a/app_flowy/packages/flowy_infra_ui/example/lib/keyboard/keyboard_screen.dart b/app_flowy/packages/flowy_infra_ui/example/lib/keyboard/keyboard_screen.dart index 780e89befc..28aa027b49 100644 --- a/app_flowy/packages/flowy_infra_ui/example/lib/keyboard/keyboard_screen.dart +++ b/app_flowy/packages/flowy_infra_ui/example/lib/keyboard/keyboard_screen.dart @@ -27,6 +27,7 @@ class KeyboardScreen extends StatefulWidget { class _KeyboardScreenState extends State { bool _isKeyboardVisible = false; + final TextEditingController _controller = TextEditingController(text: 'Hello Flowy'); @override Widget build(BuildContext context) { @@ -56,7 +57,7 @@ class _KeyboardScreenState extends State { ), TextField( style: const TextStyle(fontSize: 20), - controller: TextEditingController(text: 'Test'), + controller: _controller, ), ], ), diff --git a/app_flowy/packages/flowy_infra_ui/example/lib/main.dart b/app_flowy/packages/flowy_infra_ui/example/lib/main.dart index 35d08970a2..1c3b2a41f4 100644 --- a/app_flowy/packages/flowy_infra_ui/example/lib/main.dart +++ b/app_flowy/packages/flowy_infra_ui/example/lib/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import '../home/home_screen.dart'; +import 'home/home_screen.dart'; void main() { runApp(const ExampleApp()); @@ -10,13 +10,9 @@ class ExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { -<<<<<<< HEAD - return const MaterialApp(); -======= return const MaterialApp( title: "Flowy Infra Title", home: HomeScreen(), ); ->>>>>>> [infra_ui][keyboard] (WIP) Add demo proj for infra ui } } diff --git a/app_flowy/packages/flowy_infra_ui/example/macos/Podfile.lock b/app_flowy/packages/flowy_infra_ui/example/macos/Podfile.lock new file mode 100644 index 0000000000..b0a2e1ef3a --- /dev/null +++ b/app_flowy/packages/flowy_infra_ui/example/macos/Podfile.lock @@ -0,0 +1,22 @@ +PODS: + - flowy_infra_ui (0.0.1): + - FlutterMacOS + - FlutterMacOS (1.0.0) + +DEPENDENCIES: + - flowy_infra_ui (from `Flutter/ephemeral/.symlinks/plugins/flowy_infra_ui/macos`) + - FlutterMacOS (from `Flutter/ephemeral`) + +EXTERNAL SOURCES: + flowy_infra_ui: + :path: Flutter/ephemeral/.symlinks/plugins/flowy_infra_ui/macos + FlutterMacOS: + :path: Flutter/ephemeral + +SPEC CHECKSUMS: + flowy_infra_ui: 9d5021b1610fe0476eb1191bf7cd41c4a4138d8f + FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 + +PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c + +COCOAPODS: 1.9.3 diff --git a/app_flowy/packages/flowy_infra_ui/example/macos/Runner.xcodeproj/project.pbxproj b/app_flowy/packages/flowy_infra_ui/example/macos/Runner.xcodeproj/project.pbxproj index 547137744c..57fa2942d0 100644 --- a/app_flowy/packages/flowy_infra_ui/example/macos/Runner.xcodeproj/project.pbxproj +++ b/app_flowy/packages/flowy_infra_ui/example/macos/Runner.xcodeproj/project.pbxproj @@ -26,6 +26,7 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 7912A075158F80106DD95645 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0464B205D770E7A68F28B6D /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -52,9 +53,10 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 2D5900421C18B1A15A65A9EC /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* flowy_infra_ui_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "flowy_infra_ui_example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* flowy_infra_ui_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = flowy_infra_ui_example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -68,6 +70,9 @@ 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + 97A4E031C17F0C7BEEE33734 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + AB3F9417FEFE6929B49F80FE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + C0464B205D770E7A68F28B6D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -75,6 +80,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 7912A075158F80106DD95645 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -99,6 +105,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, + A750A856115646FFDA1D1478 /* Pods */, ); sourceTree = ""; }; @@ -145,9 +152,21 @@ path = Runner; sourceTree = ""; }; + A750A856115646FFDA1D1478 /* Pods */ = { + isa = PBXGroup; + children = ( + 97A4E031C17F0C7BEEE33734 /* Pods-Runner.debug.xcconfig */, + 2D5900421C18B1A15A65A9EC /* Pods-Runner.release.xcconfig */, + AB3F9417FEFE6929B49F80FE /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( + C0464B205D770E7A68F28B6D /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -159,11 +178,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 2FBE5781370B1EF78F66CD14 /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, + 196EE237C3BE7811FE50A841 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -233,6 +254,45 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 196EE237C3BE7811FE50A841 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 2FBE5781370B1EF78F66CD14 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/app_flowy/packages/flowy_infra_ui/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/app_flowy/packages/flowy_infra_ui/example/macos/Runner.xcworkspace/contents.xcworkspacedata index 1d526a16ed..21a3cc14c7 100644 --- a/app_flowy/packages/flowy_infra_ui/example/macos/Runner.xcworkspace/contents.xcworkspacedata +++ b/app_flowy/packages/flowy_infra_ui/example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/app_flowy/packages/flowy_infra_ui/example/pubspec.lock b/app_flowy/packages/flowy_infra_ui/example/pubspec.lock index 48fb2300d9..c2685ea99f 100644 --- a/app_flowy/packages/flowy_infra_ui/example/pubspec.lock +++ b/app_flowy/packages/flowy_infra_ui/example/pubspec.lock @@ -14,7 +14,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.7.0" + version: "2.6.1" boolean_selector: dependency: transitive description: @@ -35,7 +35,7 @@ packages: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.2.0" clock: dependency: transitive description: @@ -176,7 +176,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.3.0" nested: dependency: transitive description: @@ -258,7 +258,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "0.3.0" textstyle_extensions: dependency: transitive description: diff --git a/app_flowy/packages/flowy_infra_ui/example/pubspec.yaml b/app_flowy/packages/flowy_infra_ui/example/pubspec.yaml index 4b3c5ac678..901200091e 100644 --- a/app_flowy/packages/flowy_infra_ui/example/pubspec.yaml +++ b/app_flowy/packages/flowy_infra_ui/example/pubspec.yaml @@ -10,14 +10,6 @@ dependencies: flutter: sdk: flutter -<<<<<<< HEAD -======= - cupertino_icons: ^1.0.2 -<<<<<<< HEAD - provider: ^5.0.0 ->>>>>>> [infra_ui][keyboard] (WIP) Add demo proj for infra ui -======= ->>>>>>> [infra_ui] Integrate keyboard detector to example proj flowy_infra_ui: path: ../ diff --git a/app_flowy/packages/flowy_infra_ui/lib/src/keyboard/keyboard_visibility_detector.dart b/app_flowy/packages/flowy_infra_ui/lib/src/keyboard/keyboard_visibility_detector.dart index 7521435310..b4d084acc0 100644 --- a/app_flowy/packages/flowy_infra_ui/lib/src/keyboard/keyboard_visibility_detector.dart +++ b/app_flowy/packages/flowy_infra_ui/lib/src/keyboard/keyboard_visibility_detector.dart @@ -2,7 +2,6 @@ import 'dart:async'; import 'package:flowy_infra_ui_platform_interface/flowy_infra_ui_platform_interface.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class KeyboardVisibilityDetector extends StatefulWidget { const KeyboardVisibilityDetector({ @@ -14,10 +13,6 @@ class KeyboardVisibilityDetector extends StatefulWidget { final Widget child; final void Function(bool)? onKeyboardVisibilityChange; - static bool isKeyboardVisible(BuildContext context) { - return context.read<_KeyboardVisibilityDetectorInheritedWidget>().isKeyboardVisible; - } - @override _KeyboardVisibilityDetectorState createState() => _KeyboardVisibilityDetectorState(); } diff --git a/app_flowy/packages/flowy_infra_ui/pubspec.lock b/app_flowy/packages/flowy_infra_ui/pubspec.lock index 9b2f5e6a79..98f80cfe2a 100644 --- a/app_flowy/packages/flowy_infra_ui/pubspec.lock +++ b/app_flowy/packages/flowy_infra_ui/pubspec.lock @@ -14,7 +14,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.7.0" + version: "2.6.1" boolean_selector: dependency: transitive description: @@ -35,7 +35,7 @@ packages: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.2.0" clock: dependency: transitive description: @@ -162,7 +162,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.3.0" nested: dependency: transitive description: @@ -244,7 +244,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "0.3.0" textstyle_extensions: dependency: "direct main" description: