View on GitHub

reads

https://yazansneneh.github.io/reads/

Xylophone - Using Flutter and Dart Packages to Speed Up Development

Guide to Using Flutter Packages

What is the difference between a package and a plugin?
Packages

Using packages

some things to be done in order to use flutter package.

Searching for packages

Adding a package dependency to an app

how To add the package, to an app?

  1. Depend on it:
    • inside the pubspec.yaml file located inside the app folder, and add package under dependencies.
  2. Install it:
    • From the terminal Run:
      flutter pub get
      
    • From Android Studio/IntelliJ: Click Packages get in the action ribbon at the top of pubspec.yaml.
    • From VS Code: Click Get Packages located in right side of the action ribbon at the top of pubspec.yaml.
  3. Import it
    • Add a corresponding import statement in the Dart code.
  4. Stop and restart the app, if necessary
    • If the package brings platform-specific code (Kotlin/Java for Android, Swift/Objective-C for iOS), code must be built into app.
    • Hot reload and hot restart only update the Dart code.
    • full restart of the app might be required to avoid errors like MissingPluginException when using the package.

Conflict resolution