Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

377
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda