7

Let's say we have created a plugin with flutter. Named flutter_local_plugin. How can we put it inside a flutter project flutter_some_application and access it? There is a question here (how to use local flutter package in another flutter application?), but the accepted answer has 0 explanations regarding the actual file migrations.

  • we only need the plugin to be placed inside the flutter_some_application, without any example from the package project.
  • Where do you place the .kt & .dart files, and how do you link all of this together?

There seems to be no guide on how to achieve this.

Denis Rudenko
  • 667
  • 7
  • 14

1 Answers1

0

I created a flutter plugin by Android Studio 4.0 which name is printer. We can get a tip at the pubspec.yaml:

  printer:
    # When depending on this package from a real application you should use:
    #   printer: ^x.y.z
    # See https://dart.dev/tools/pub/dependencies#version-constraints
    # The example app is bundled with the plugin so we use a path dependency on
    # the parent directory to use the current plugin's version. 
    path: ../

Then I use printer locally in another flutter project:

  printer:
    path: ../printer/

After pub get I found printer added in .flutter-plugins & .flutter-plugins-dependencies automatically.

fat eagle
  • 21
  • 4
  • this answer doesn't really make sense without an explanation. I made a plugin but the ../ path doesn't work. – Alberto M Apr 21 '21 at 10:41