Creating Flutter Custom Package and Publish in pub.dev

Create a new Flutter package project in Android Studio

Flutter Package Project

After creating project structure will somewhat look like this unlike normal flutter project.

By Default the file name will be created based on the package name you given when creating the flutter package project

Created a CustomText stateless widget

Try running flutter packages pub publish — dry-run in your terminal

Remove the author key from pubspec.yaml

Now try running flutter packages pub publish — dry-run in your terminal

Run flutter packages pub publish in your terminal

You will get a succesfull upload message

Note: Your package wont visible immediately in your my-package in pub.dev account it will take some time

--

--

I’m an IOS, Flutter Developer and now a Blogger

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store