1

I want to build a package for Flutter and Dart, but I don't have any previous experience with package development. I am not sure how to create the package. Should I use

flutter create --template=package

or

dart create -t package

I want support for both Flutter and Dart.

I looked at the Flutter documentation on creating packages, but I couldn't understand if it would create a package with Flutter only support, or both Flutter and Dart support.

1
  • Flutter is built on Dart. A Flutter app can use any Dart package as long as that package doesn't use dart:mirrors or platform-specific libraries (such as dart:html). Commented Jan 25, 2023 at 23:34

1 Answer 1

1

First, use the following command to check if your package meets all the requirements to publish the package.

dart pub publish --dry-run

Once you are sure that your package is ready to deploy on pub dev run this command:

dart pub publish
Sign up to request clarification or add additional context in comments.

2 Comments

Will the package be published with support for both flutter and dart using this?
yes if you code your package with an only dart. you can also view your package availability on pub dev in a few minutes after publishing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.