In Flutter, install a package using the following instructions:

Add the package name and version to the pubspec.yaml dependencies section.
The example below shows how to add the google_sign_in Dart package to the
pubspec.yaml file. Check your spaces when working in the YAML file because
white space matters!

dependencies

flutter

sdk

flutter

google_sign_in

^3.0.3

Install the package from the command line by using flutter pub get.
If using an IDE, it often runs flutter pub get for you, or it might
prompt you to do so.

Import the package into your app code as shown below:

For more information, see Using Packages and
Developing Packages & Plugins.

You can find many packages shared by Flutter developers in the
Flutter packages section of pub.dev.

Flutter widgets