Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

379
Visualizações
How do I create a pub package that works with Flutter?

pub is Dart's package manager. Flutter is a mobile app SDK that uses Dart. How can I create a package that depends on, or targets, Flutter?

about 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

To declare a dependency on Flutter, from a pub package, add this to your pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter

You must use flutter packages get instead of pub get, because Flutter needs to set the appropriate environment variables to map the sdk: flutter to a location.

To easily and quickly create a new pub package, use the stagehand tool. After you install stagehand, follow these instructions:

$ mkdir fancy_project
$ cd fancy_project
$ stagehand package-simple

After you create your new package, edit the pubspec.yaml and add the sdk:flutter as shown above.

about 4 years ago · Santiago Trujillo Relatório

0

A trick I also use is to just flutter create foo (which creates a full-fledged Flutter app, more than you need) and then rm -rf foo/ios foo/android and edit/remove foo/lib/main.dart, etc.

The stagehand solution from @sethladd is more elegant, but requires having installed stagehand.

about 4 years ago · Santiago Trujillo Relatório

0

flutter create now supports templates. The package template creates exactly that:

flutter create -t package

or to create a plugin that depends on platform-specific code:

flutter create -t plugin
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda