Zum Hauptinhalt springen
ProdukteDesktop-WerkzeugeTASTECADZeichnungsprüfungTASTEFILESDateiverwaltungTASTEFTPDateiübertragungTASTESSHRemote-ArbeitsbereichTASTEZIPKomprimieren und EntpackenTASTEWINMDateiverwaltungEntwicklerwerkzeugeTASTECODEIntegrierte Entwicklungsumgebung für RustTASTESTUDIOIntegrierte Entwicklungs- und TestumgebungTASTEETLDatenintegration (ETL)ServerTASTEREMOTERemote-Desktop-ServerTASTEGEOGeodatenserverTASTEMAILE-Mail-ArbeitsbereichInvestierenTASTESTOCKDesktop-App für automatischen AktienhandelErste SchritteDownloadsDokumentationKaufenAlle Produkte
Marktplatz
Neuigkeiten
TechnikNeuigkeitenEntwickler-News von heuteEntwicklerdokuProgrammiersprachenRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWeb-Frontend-FrameworksNext.jsReactVue.js · NuxtSvelteKitAngularServer-FrameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressApp- & Desktop-FrameworksTauriFlutterReact NativeElectronAlgorithmenAlgorithmus-GrundlagenKernalgorithmenFortgeschrittene AlgorithmenAlgorithmen für die Praxis
CommunityProjekteEntwicklungslogsPromptsProbleme mit KI-ToolsShowcaseCommunity-Leitfaden
ZusammenarbeitWissenstransferWebsite-AufbauDesktop-App-AufbauRelease- und ZahlungspipelineVertriebspartnerKontakt
DiensteRemote-DesktopIndividuelle Installationspakete
TASTEDEV
Produkte

Desktop-Werkzeuge

TASTECADKomplexe Zeichnungen, mühelos geöffnetTASTEFILESNur die Dateien, die zählen – in BestzeitTASTEFTPDer aufgeräumteste Weg für Ihre DateienTASTESSHDie stärkere Verbindung zu Ihren ServernTASTEZIPSchneller packen, sicherer entpackenTASTEWINMEin tastaturorientierter Dateimanager mit zwei Fenstern

Entwicklerwerkzeuge

TASTECODERust-Apps bearbeiten, bauen, debuggen und testen – alles in einem FensterTASTESTUDIOVom Bearbeiten bis zu Remote-Tests und freigegebenen KI-KorrekturenTASTEETLDaten bewegen, die Werte im Blick

Server

TASTEREMOTEEin Remote-Desktop auf Ihrem eigenen ServerTASTEGEOEin GeoServer-kompatibler Geodatenserver, neu aufgebaut in RustTASTEMAILIhre E-Mail wieder in Ihrer Hand

Investieren

TASTESTOCKAutomatischer Aktienhandel nach Ihren Regeln: wann und was

Erste Schritte

DownloadsNeueste Versionen aller ProdukteDokuSo nutzen Sie jedes ProduktKaufenAbos und DauerlizenzenAlle ProdukteAlle Produkte im Überblick
Alle Produkte
MarktplatzNeuigkeiten
Technik

Neuigkeiten

Entwickler-News von heuteOffizielle Meldungen zu Sprachen, Frameworks, GitHub und KIEntwicklerdokuAnleitungen zu Sprachen, Frameworks und Algorithmen

Programmiersprachen

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Web-Frontend-FrameworksNext.jsReactVue.js · NuxtSvelteKitAngular
Server-FrameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
App- & Desktop-FrameworksTauriFlutterReact NativeElectron

Algorithmen

Algorithmus-GrundlagenKomplexitätsanalyse · Sortieren · Suchen · Grundlegende Datenstrukturen · Bäume und HeapsKernalgorithmenGraphtraversierung · Kürzeste Wege und minimale Spannbäume · Dynamische Programmierung · Greedy-Algorithmen · Teile und herrsche · BacktrackingFortgeschrittene AlgorithmenZeichenkettenalgorithmen · Mathematik und Zahlentheorie · Bitmanipulation · Segmentbäume · Union-FindAlgorithmen für die PraxisStrategie für Coding-Interviews · LRU-Cache · Rate Limiting · Konsistentes Hashing
Alle Entwicklungsdokumente
Community
ProjekteEntwickler und Projekte entdeckenEntwicklungslogsEntscheidungen und ErkenntnissePromptsWiederverwendbare AnweisungenProbleme mit KI-ToolsProbleme und Workarounds für Claude, Codex, GeminiShowcaseFertige ErgebnisseCommunity-LeitfadenWie wir offen entwickeln
Zusammenarbeit
WissenstransferNative Apps mit Rust und eguiWebsite-Aufbau10 Sprachen, Konten, Dokumentation und DownloadsDesktop-App-AufbauRust und egui, ohne WebViewRelease- und ZahlungspipelineSignatur, MSI, deb, rpm, AppImage, PrüfsummenVertriebspartnerEmpfehlen und 30 % erhaltenKontaktEntwicklung, Partnerschaft, Investition
Dienste
Remote-DesktopIhren Computer im Browser erreichenIndividuelle InstallationspaketeNur nötige Funktionen, Einstellungen vorab
Kaufen
DE
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Anmelden
Anmelden
TASTEDEV

Von kleinen Werkzeugen zu besserer Entwicklung.

support@tastedev.netTASTEDEV unterstützen
ProdukteProduktübersichtKaufenDokuDownloadsMarktplatzSupport
CommunityProjekteEntwicklungslogsPromptsProbleme mit KI-ToolsShowcase
RichtlinienÜber unsDatenschutzerklärungNutzungsbedingungenAbo-BedingungenRückerstattungCommunity-Richtlinien
KontoAnmeldenRegistrieren
Besucher
Heute
Gestern
Aufrufe gesamt
Firma
GXSOFT
Vertretungsberechtigt
CHOI YOUNG GU
Handelsregisternummer
853-44-00368
Anschrift
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Telefon
+82-10-4404-1523
E-Mail
whitecalvin@tastedev.net
Datenschutzbeauftragter
CHOI YOUNG GU

© 2026 TASTEDEVProduktinformationen basieren auf verifizierten Entwicklungsquellen.Veröffentlicht · wird verbessert

Dart-Dokumentation
Dart
Getting Started with DartSyntax BasicsTypes and DataLibraries and PackagesErrors and TestingKey Concepts
Diskussionen

Dart-Anleitung · 4/6

Libraries and Packages

Dieses Kapitel ist vorerst nur auf Englisch verfügbar.

Dart code is organized into two units: libraries and packages. A library groups code and defines what is visible, while a package distributes libraries together with configuration and dependencies. This chapter covers import and export, the pub package manager and pubspec.yaml, the standard package layout, and publishing to pub.dev.

Libraries and imports

In Dart, every file is a library. Top-level declarations and members whose names start with an underscore (_) are visible only inside that library, so there is no private keyword. To use another library, bring it in with import.

FormExampleMeaning
dart:import 'dart:math';A core library that ships with the SDK
package:import 'package:http/http.dart';A dependency, or your own package's lib
Relative pathimport 'src/parser.dart';Another file in the same package
import 'dart:math';
import 'dart:convert' show jsonDecode, jsonEncode; // only these names
import 'package:path/path.dart' as p;              // a prefix avoids name clashes
import 'src/internal.dart' hide debugHelper;       // everything except one name

void main() {
  print(sqrt(16));                                  // dart:math
  print(jsonEncode({'ok': true}));                  // dart:convert
  print(p.join('assets', 'images', 'logo.png'));    // package:path
}

show imports only the listed names and hide everything except them. An as prefix prevents name clashes. On the web, deferred as loads a library lazily.

Collecting the public API with export

A package usually keeps its implementation under lib/src and exports only the public parts from a main file directly under lib. Users then need to import just that one file.

// lib/shapes.dart: the package's main library
library;

export 'src/circle.dart';
export 'src/square.dart' show Square;
// src/geometry_utils.dart is not exported, so it stays an implementation detail

By convention, files in lib/src are private implementation. Other packages can technically import package:shapes/src/..., but it is discouraged and the analyzer warns about it.

pub and pubspec.yaml

pub is Dart's package manager, and is the public package repository. A package's name, version, supported SDK range and dependencies live in at the project root.

Fragen zu diesem Kapitel?
Vorheriges KapitelTypes and DataNächstes KapitelErrors and Testing
pub.dev
pubspec.yaml
name: weather_cli
description: An example tool that shows the weather on the command line.
version: 1.0.0
publish_to: none   # prevents accidental publishing to pub.dev

environment:
  sdk: ^3.5.0      # dart create fills this in for your current SDK

dependencies:
  http: ^1.2.0
  path: ^1.9.0

dev_dependencies:
  lints: ^5.0.0
  test: ^1.25.0

A caret (^) allows newer versions up to the next major one: ^1.2.0 means at least 1.2.0 and below 2.0.0. dependencies are needed at run time; dev_dependencies only during development. The versions above are examples; the commands below fill in the latest compatible ones.

dart pub commands

dart pub add http             # add to dependencies
dart pub add --dev test       # add to dev_dependencies
dart pub remove http          # remove a dependency
dart pub get                  # fetch what pubspec.yaml asks for
dart pub upgrade              # upgrade to the newest allowed versions
dart pub outdated             # list dependencies with newer versions
dart pub deps                 # print the dependency tree

dart pub get records the chosen versions in pubspec.lock. Commit it for apps and executables so everyone and CI use the same versions; for libraries, consumers resolve versions again, so it matters less. Packages are stored in a shared pub cache.

You can also depend on packages from a Git repository or a local path.

dependencies:
  my_utils:
    path: ../my_utils
  shared_models:
    git:
      url: https://github.com/example/shared_models.git
      ref: main

Package layout

The pub tool and pub.dev expect a conventional directory layout.

PathContents
lib/Library code exposed to other packages
lib/src/Implementation details (private by convention)
bin/Entry points run with dart run
test/Tests (file names end in _test.dart)
example/Usage examples (shown on the pub.dev Example tab)
tool/Development scripts such as build or release helpers
README.md, CHANGELOG.md, LICENSEIntroduction, change history, license

Files outside lib (in bin, test and so on) import their own package's libraries with the package: form, for example import 'package:weather_cli/weather_cli.dart';.

Publishing to pub.dev

For a public package, remove publish_to: none and provide a description, a repository or homepage, a LICENSE, a README.md and a CHANGELOG.md. Always run a dry run before publishing.

dart pub publish --dry-run    # check for problems without uploading
dart pub publish              # authenticate with a Google account and publish

Published versions cannot be deleted, and the same version number cannot be uploaded twice. A mistaken version can be retracted for a short period after publishing, but the usual fix is to publish a corrected new version. Follow semantic versioning and bump the major version for breaking changes. pub.dev scores packages on documentation, static analysis and platform support, so checking with dart analyze and dart doc beforehand pays off.

Summary

In Dart, each file is a library and names starting with _ stay hidden outside it. Control what you import with show, hide and as, and gather the public API in a main file with export. Declare dependencies in pubspec.yaml, manage them with dart pub add, get and upgrade, follow the standard layout, and publish to pub.dev with dart pub publish.

0 Kommentare

Top-KommentareNeueste zuerst

Anmelden · Melde dich an, um einen Kommentar zu schreiben.