Make and Publish Flutter Plugin on pub dev!!

Sanchit Saran
2 min readJul 11, 2021

--

Flutter is Google’s free and open-source UI application development toolkit. it’s wont to build high-quality native interfaces on Android and iOS employing a single codebase. One interesting thing about Flutter is that it works with existing code and is employed by developers and organizations worldwide. during this post, we’ll find out how to develop a custom plugin using Flutter.

GETTING STARTED-

What is the Flutter plugin?

Flutter plugin is that the wrapper of the native code like android( KOTLIN or java) and iOS(swift or objective c).
For the plugin we’d like to write down android and IOS specific code, we will either user KOTLIN or Java for Android and swift or objective-c for iOS.

Why Plugin is Required?
Flutter doesn’t support many things like geolocation, payment SDK, video calling SDK etc. and if we would like to implement these features in our flutter project then we will write our own plugin within the native code Android and iOS and achieve these custom features.

How to create a plugin:
These are the steps to make a plugin: WATCH N

Publishing the Custom Plugin

Let’s quickly look at a few instructions that you need to keep in mind after developing the custom plugin:

  • After developing the custom plugin, you can publish the custom plugin at pub.dev so that other developers can easily use it. However, before publishing, review the pubspec.yaml, README.md, CHANGELOG.md, and LICENSE files to ensure that the content is complete and correct.
  • Next, run the publish command in the dry-run mode to see if everything passes the analysis:

$ flutter pub publish — dry-run

  • The next step is publishing to pub.dev, but ensure that you are ready because publishing is a final step that cannot be reverted:

$ flutter pub publish

For more details on publishing, check out the publishing docs on dart.dev.

References:

THANK YOU

#flutter​ #flutterplugin#flutter tutorials

For more interesting videos and pics.

SUBSCRIBE on YOUTUBE

https://youtube.com/channel/UCyRt3BNQhVnYmfwVeMQAOxw

CONNECT on LINKEDIN

https://www.linkedin.com/in/sanchitsaran​

FOLLOW on GITHUB

https://github.com/SanchitSaran

--

--