let’s start first we have to create a flutter package using an android studio but if you want to create it using the command line use this command.
flutter create — template=package package_name
Create a git repository and upload your package into git.
git add — all
git commit -m “initial commit”
git remote add origin
https://github.com/your git link
git push -u origin master
Your file structure is something looks like this.
In lib -> you have to write your package code.
In test -> you can write the test cases.
CHANGELOG.md -> you can write the changes with date and description.
LICENSE -> you write your license.
pubspec.yaml -> you can write your project description and import assets, etc.
## [version] - Date* explanations about changes.
I am choosing an open-source MIT LICENSE.
A short and simple permissive license with conditions only requiring preservation of copyright and license notices…
Copyright (c) [Osama Asif]
write your name in the license.
Now come to the code section.
As I told you I am using a sample code to show you how to create a flutter package. You can write your code as per your requirement.
Before publishing the package push your code to the git repository.
for a dry run, your package uses the below command.
flutter pub publish --dry-run
use the below command to publish the package into pub.dev
Pub is the package manager for the Dart programming language, containing reusable libraries & packages for Flutter…
The next step is publishing to pub.dev, but be sure that you are ready because publishing is forever:
flutter packages pub publish
now we know how to create and publish a flutter package.
find out more articles.
Flutter Google Sign in with Firebase Auth.
In this article, we are trying to achieve google sign in with firebase auth in a few steps.
Flutter Circle Avatar and ListView.builder()
how to create a list of circle avatar with a border?
Material Page Route and Named Route in Flutter.
So let’s start with the basic code of splash screen where I am only using Image and circular progress indicator.