EchoEllet / flutter_keyboard_visibility_temp_fork

Get notified on keyboard visibility changes in your Flutter app
MIT License
2 stars 7 forks source link

refactor package name #3

Closed GustavoFigueira closed 3 weeks ago

GustavoFigueira commented 1 month ago

Hello,

I had to make some changes to the package name because I wasn't directly using either the main flutter_keyboard_visibility package or the flutter_keyboard_visibility_web package, but some third-party package in my project was using it as a transitive dependency.

In such cases, to make it work more easily, you just need to go to the root project and add this to dependency_overrides:

dependency_overrides:
  web: ^1.1.0

  # Temporary override for WASM suport
  flutter_keyboard_visibility_web:
    git:
      url: https://github.com/GustavoFigueira/flutter_keyboard_visibility_temp_fork.git
      ref: master
      path: flutter_keyboard_visibility_web

Or, if my PR gets accepted, you can use the final corrected version of this repository:

dependency_overrides:
  web: ^1.1.0

  # Temporary override for WASM suport
  flutter_keyboard_visibility_web:
    git:
      url: https://github.com/EchoEllet/flutter_keyboard_visibility_temp_fork.git
      ref: master
      path: flutter_keyboard_visibility_web

Best regards.

EchoEllet commented 3 weeks ago

Thank you for your contribution.

For some reason, I didn't get any notification regarding the PRs.

I'm thinking about extracting the web implementation into a separate package that uses the flutter_keyboard_visibility_platform_interface (fallback) instead of changing the package name since that would be a breaking change for existing users, also we might introduce more changes into to the Android or IOS to fix some issues.

EchoEllet commented 3 weeks ago

To make it compatible with existing dependencies that use flutter_keyboard_visibility as a transitive dependency, we need to extract the web implementation to a separate package with the same name, and we can't publish flutter_keyboard_visibility_web since it's already published.

We can't rename the existing published package either, it looks like this PR renames it to flutter_keyboard_visibility_web while it still has the iOS and Android implementation without extracting it.

I have forked flutter_keyboard_visibility_web and kept it with the same name, unpublished and not used by flutter_keyboard_visibility_temp_fork and only available to allow users to override the upstream flutter_keyboard_visibility_web:

dependency_overrides:
  # The flutter_keyboard_visibility_web uses dart:html which is incompatible with WASM, override it with a modified version that uses the web package instead.
  flutter_keyboard_visibility_web:
    git:
      url: https://github.com/EchoEllet/flutter_keyboard_visibility_temp_fork.git
      ref: master
      path: flutter_keyboard_visibility_web