Nitneuq
Nitneuq

Reputation: 5022

How to manually migrate a package (no mine) to null safety

I search a solution to upgrade my flutter app, but I have some package no longer maintained. I'm lock. So how can I merge last version packages to migrate null safety by myself ?

Possible ?

Upvotes: 0

Views: 32

Answers (1)

enzo
enzo

Reputation: 11496

  1. Go to https://pub.dev/packages/PACKAGE_NAME.

  2. In the tabs on the right, look for the Metadata section. Click the "Repository (Github)" link.

  3. Fork the repository, clone the repo to your local machine and migrate the package to null-safety.

  4. When done, push the local repository to Github.

  5. In your pubspec.yaml, remove the reference to the old package and replace it with the migrated version:

PACKAGE_NAME:
    git:
      url: git://github.com/YOUR_USERNAME/PACKAGE_NAME.git
      ref: main

Upvotes: 2

Related Questions