Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

[infra_ui][keyboard] Impl keyboard_web for flutter federated platform interface

Jaylen Biancb3ed0a30862
diff --git a/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/.gitignore b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/.gitignore
new file mode 100644
index 0000000000..a247422ef7
--- /dev/null
+++ b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/.gitignore
@@ -0,0 +1,75 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.buildlog/
+.history
+.svn/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
+
+# Flutter/Dart/Pub related
+**/doc/api/
+.dart_tool/
+.flutter-plugins
+.flutter-plugins-dependencies
+.packages
+.pub-cache/
+.pub/
+build/
+
+# Android related
+**/android/**/gradle-wrapper.jar
+**/android/.gradle
+**/android/captures/
+**/android/gradlew
+**/android/gradlew.bat
+**/android/local.properties
+**/android/**/GeneratedPluginRegistrant.java
+
+# iOS/XCode related
+**/ios/**/*.mode1v3
+**/ios/**/*.mode2v3
+**/ios/**/*.moved-aside
+**/ios/**/*.pbxuser
+**/ios/**/*.perspectivev3
+**/ios/**/*sync/
+**/ios/**/.sconsign.dblite
+**/ios/**/.tags*
+**/ios/**/.vagrant/
+**/ios/**/DerivedData/
+**/ios/**/Icon?
+**/ios/**/Pods/
+**/ios/**/.symlinks/
+**/ios/**/profile
+**/ios/**/xcuserdata
+**/ios/.generated/
+**/ios/Flutter/App.framework
+**/ios/Flutter/Flutter.framework
+**/ios/Flutter/Flutter.podspec
+**/ios/Flutter/Generated.xcconfig
+**/ios/Flutter/ephemeral
+**/ios/Flutter/app.flx
+**/ios/Flutter/app.zip
+**/ios/Flutter/flutter_assets/
+**/ios/Flutter/flutter_export_environment.sh
+**/ios/ServiceDefinitions.json
+**/ios/Runner/GeneratedPluginRegistrant.*
+
+# Exceptions to above rules.
+!**/ios/**/default.mode1v3
+!**/ios/**/default.mode2v3
+!**/ios/**/default.pbxuser
+!**/ios/**/default.perspectivev3
diff --git a/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/.metadata b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/.metadata
new file mode 100644
index 0000000000..f46c92994f
--- /dev/null
+++ b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/.metadata
@@ -0,0 +1,10 @@
+# This file tracks properties of this Flutter project.
+# Used by Flutter tool to assess capabilities and perform upgrades etc.
+#
+# This file should be version controlled and should not be manually edited.
+
+version:
+ revision: fa5883b78e566877613ad1ccb48dd92075cb5c23
+ channel: dev
+
+project_type: package
diff --git a/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/CHANGELOG.md b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/CHANGELOG.md
new file mode 100644
index 0000000000..41cc7d8192
--- /dev/null
+++ b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/CHANGELOG.md
@@ -0,0 +1,3 @@
+## 0.0.1
+
+* TODO: Describe initial release.
diff --git a/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/LICENSE b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/LICENSE
new file mode 100644
index 0000000000..ba75c69f7f
--- /dev/null
+++ b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/LICENSE
@@ -0,0 +1 @@
+TODO: Add your license here.
diff --git a/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/README.md b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/README.md
new file mode 100644
index 0000000000..94b4102a22
--- /dev/null
+++ b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/README.md
@@ -0,0 +1,14 @@
+# keyboard_web
+
+A new Flutter package project.
+
+## Getting Started
+
+This project is a starting point for a Dart
+[package](https://flutter.dev/developing-packages/),
+a library module containing code that can be shared easily across
+multiple Flutter or Dart projects.
+
+For help getting started with Flutter, view our
+[online documentation](https://flutter.dev/docs), which offers tutorials,
+samples, guidance on mobile development, and a full API reference.
diff --git a/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/analysis_options.yaml b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/analysis_options.yaml
new file mode 100644
index 0000000000..a5744c1cfb
--- /dev/null
+++ b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/analysis_options.yaml
@@ -0,0 +1,4 @@
+include: package:flutter_lints/flutter.yaml
+
+# Additional information about this file can be found at
+# https://dart.dev/guides/language/analysis-options
diff --git a/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/lib/keyboard_web.dart b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/lib/keyboard_web.dart
new file mode 100644
index 0000000000..ca61d9ed4a
--- /dev/null
+++ b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/lib/keyboard_web.dart
@@ -0,0 +1,7 @@
+library keyboard_web;
+
+/// A Calculator.
+class Calculator {
+ /// Returns [value] plus 1.
+ int addOne(int value) => value + 1;
+}
diff --git a/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/pubspec.lock b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/pubspec.lock
new file mode 100644
index 0000000000..4508a8bebb
--- /dev/null
+++ b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/pubspec.lock
@@ -0,0 +1,187 @@
+# Generated by pub
+# See https://dart.dev/tools/pub/glossary#lockfile
+packages:
+ async:
+ dependency: transitive
+ description:
+ name: async
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.6.1"
+ boolean_selector:
+ dependency: transitive
+ description:
+ name: boolean_selector
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.0"
+ characters:
+ dependency: transitive
+ description:
+ name: characters
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0"
+ charcode:
+ dependency: transitive
+ description:
+ name: charcode
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.2.0"
+ clock:
+ dependency: transitive
+ description:
+ name: clock
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0"
+ collection:
+ dependency: transitive
+ description:
+ name: collection
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.15.0"
+ fake_async:
+ dependency: transitive
+ description:
+ name: fake_async
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.2.0"
+ flutter:
+ dependency: transitive
+ description: flutter
+ source: sdk
+ version: "0.0.0"
+ flutter_lints:
+ dependency: "direct dev"
+ description:
+ name: flutter_lints
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.4"
+ flutter_test:
+ dependency: "direct dev"
+ description: flutter
+ source: sdk
+ version: "0.0.0"
+ flutter_web_plugins:
+ dependency: "direct main"
+ description: flutter
+ source: sdk
+ version: "0.0.0"
+ js:
+ dependency: transitive
+ description:
+ name: js
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.6.3"
+ keyboard_platform_interface:
+ dependency: "direct main"
+ description:
+ path: "../keyboard_platform_interface"
+ relative: true
+ source: path
+ version: "0.0.1"
+ lints:
+ dependency: transitive
+ description:
+ name: lints
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.1"
+ matcher:
+ dependency: transitive
+ description:
+ name: matcher
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.12.10"
+ meta:
+ dependency: transitive
+ description:
+ name: meta
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.3.0"
+ path:
+ dependency: transitive
+ description:
+ name: path
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.8.0"
+ plugin_platform_interface:
+ dependency: transitive
+ description:
+ name: plugin_platform_interface
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.1"
+ sky_engine:
+ dependency: transitive
+ description: flutter
+ source: sdk
+ version: "0.0.99"
+ source_span:
+ dependency: transitive
+ description:
+ name: source_span
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.8.1"
+ stack_trace:
+ dependency: transitive
+ description:
+ name: stack_trace
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.10.0"
+ stream_channel:
+ dependency: transitive
+ description:
+ name: stream_channel
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.0"
+ string_scanner:
+ dependency: transitive
+ description:
+ name: string_scanner
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0"
+ term_glyph:
+ dependency: transitive
+ description:
+ name: term_glyph
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.2.0"
+ test_api:
+ dependency: transitive
+ description:
+ name: test_api
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.3.0"
+ typed_data:
+ dependency: transitive
+ description:
+ name: typed_data
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.3.0"
+ vector_math:
+ dependency: transitive
+ description:
+ name: vector_math
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.0"
+sdks:
+ dart: ">=2.12.0 <3.0.0"
+ flutter: ">=1.17.0"
diff --git a/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/pubspec.yaml b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/pubspec.yaml
new file mode 100644
index 0000000000..8e1fa906cb
--- /dev/null
+++ b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/pubspec.yaml
@@ -0,0 +1,27 @@
+name: keyboard_web
+description: A new Flutter package project.
+version: 0.0.1
+homepage:
+
+environment:
+ sdk: ">=2.12.0 <3.0.0"
+ flutter: ">=1.17.0"
+
+dependencies:
+ flutter_web_plugins:
+ sdk: flutter
+
+ keyboard_platform_interface:
+ path: ../keyboard_platform_interface
+
+dev_dependencies:
+ flutter_test:
+ sdk: flutter
+ flutter_lints: ^1.0.0
+
+flutter:
+ plugin:
+ platforms:
+ web:
+ pluginClass: KeyboardPlugin
+ fileName: keyboard_web
\ No newline at end of file
diff --git a/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/test/keyboard_web_test.dart b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/test/keyboard_web_test.dart
new file mode 100644
index 0000000000..095c2544ca
--- /dev/null
+++ b/app_flowy/packages/flowy_infra_ui/platform_interface/keyboard_web/test/keyboard_web_test.dart
@@ -0,0 +1,12 @@
+import 'package:flutter_test/flutter_test.dart';
+
+import 'package:keyboard_web/keyboard_web.dart';
+
+void main() {
+ test('adds one to input values', () {
+ final calculator = Calculator();
+ expect(calculator.addOne(2), 3);
+ expect(calculator.addOne(-7), -6);
+ expect(calculator.addOne(0), 1);
+ });
+}