Vai al contenuto principale
ProdottiStrumenti desktopTASTECADVisualizzazione disegniTASTEFILESGestione fileTASTEFTPTrasferimento fileTASTESSHSpazio di lavoro remotoTASTEZIPCompressione ed estrazioneTASTEWINMGestione fileStrumenti per sviluppatoriTASTECODEAmbiente di sviluppo integrato per RustTASTESTUDIOAmbiente integrato di sviluppo e testTASTEETLIntegrazione dati (ETL)ServerTASTEREMOTEServer di desktop remotoTASTEGEOServer geospazialeTASTEMAILSpazio di lavoro emailInvestimentiTASTESTOCKApp desktop di trading automatico azionarioIniziaDownloadDocumentazioneAcquistaTutti i prodotti
Marketplace
Notizie
TecnologiaNotizieNotizie di sviluppo di oggiDocumentazioneLinguaggi di programmazioneRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartFramework frontend webNext.jsReactVue.js · NuxtSvelteKitAngularFramework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressFramework per app e desktopTauriFlutterReact NativeElectronAlgoritmiBasi degli algoritmiAlgoritmi fondamentaliAlgoritmi avanzatiAlgoritmi pratici
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrinaGuida alla community
CollaboraTrasferimento tecnicoRealizzazione del sito webRealizzazione di app desktopPipeline di rilascio e pagamentoPartner commercialeContatti
ServiziDesktop remotoPacchetti di installazione su misura
TASTEDEV
Prodotti

Strumenti desktop

TASTECADApri con leggerezza anche i disegni più complessiTASTEFILESSolo i file che servono, alla massima velocitàTASTEFTPLa via più ordinata per i tuoi fileTASTESSHUn legame più solido tra te e i tuoi serverTASTEZIPComprimi più veloce, estrai più sicuroTASTEWINMUn file manager a due pannelli pensato per la tastiera

Strumenti per sviluppatori

TASTECODEModifica, compila, esegui il debug e testa app Rust in un'unica finestraTASTESTUDIODalla modifica ai test remoti e alle correzioni IA approvateTASTEETLSposta i dati guardando i valori

Server

TASTEREMOTEUn desktop remoto che gira sul tuo serverTASTEGEOUn server geospaziale compatibile con GeoServer, ricostruito in RustTASTEMAILRiprendi il controllo della tua posta

Investimenti

TASTESTOCKTrading automatico azionario secondo le regole che decidi tu: quando e che cosa

Inizia

DownloadUltime versioni di ogni prodottoDocsCome usare ogni prodottoAcquistaAbbonamenti e licenze perpetueTutti i prodottiTutti i prodotti a colpo d’occhio
Tutti i prodotti
MarketplaceNotizie
Tecnologia

Notizie

Notizie di sviluppo di oggiAnnunci ufficiali su linguaggi, framework, GitHub e IADocumentazioneGuide a linguaggi, framework e algoritmi

Linguaggi di programmazione

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Framework

Framework frontend webNext.jsReactVue.js · NuxtSvelteKitAngular
Framework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
Framework per app e desktopTauriFlutterReact NativeElectron

Algoritmi

Basi degli algoritmiAnalisi della complessità · Ordinamento · Ricerca · Strutture dati di base · Alberi e heapAlgoritmi fondamentaliVisita dei grafi · Cammini minimi e alberi ricoprenti · Programmazione dinamica · Algoritmi greedy · Divide et impera · BacktrackingAlgoritmi avanzatiAlgoritmi sulle stringhe · Matematica e teoria dei numeri · Manipolazione dei bit · Alberi di segmenti · Union-FindAlgoritmi praticiStrategia per colloqui di programmazione · Cache LRU · Rate limiting · Hashing consistente
Tutta la documentazione di sviluppo
Community
ProgettiScopri sviluppatori e lavoriLog di sviluppoDecisioni e lezioni appresePromptIstruzioni riutilizzabiliProblemi degli strumenti di IAProblemi e alternative di Claude, Codex, GeminiVetrinaRisultati completatiGuida alla communityCome sviluppiamo in modo aperto
Collabora
Trasferimento tecnicoApp native in Rust ed eguiRealizzazione del sito web10 lingue, account, documentazione e downloadRealizzazione di app desktopRust ed egui, senza WebViewPipeline di rilascio e pagamentoFirma, MSI, deb, rpm, AppImage, hashPartner commercialeConsigliaci e ricevi il 30%ContattiSviluppo, partnership e investimenti
Servizi
Desktop remotoRaggiungi il tuo computer dal browserPacchetti di installazione su misuraSolo il necessario, impostazioni precaricate
Acquista
IT
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Accedi
Accedi
TASTEDEV

Dai piccoli strumenti a uno sviluppo migliore.

support@tastedev.netSostieni TASTEDEV
ProdottiGamma di prodottiAcquistaDocsDownloadMarketplaceAssistenza
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrina
NormeChi siamoInformativa sulla privacyTermini di servizioCondizioni di abbonamentoRimborsiLinee guida della community
AccountAccediRegistrati
Visitatori
Oggi
Ieri
Visualizzazioni totali
Società
GXSOFT
Rappresentante
CHOI YOUNG GU
Numero di registrazione
853-44-00368
Indirizzo
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Telefono
+82-10-4404-1523
E-mail
whitecalvin@tastedev.net
Responsabile privacy
CHOI YOUNG GU

© 2026 TASTEDEVLe informazioni sui prodotti si basano su fonti di sviluppo verificate.Rilasciato · in miglioramento

Documentazione di Dart
Dart
Getting Started with DartSyntax BasicsTypes and DataLibraries and PackagesErrors and TestingKey Concepts
Discussioni

Guida a Dart · 6/6

Key Concepts

Per ora questo capitolo è disponibile solo in inglese.

This chapter covers the ideas that make Dart feel like Dart: asynchronous code with Future, async/await and Stream; isolates; mixins and extension methods; and how they show up in Flutter.

The event loop and Future

Dart code runs in a single-threaded event loop inside an isolate. Slow operations such as file or network access do not block; they return a Future, a promise of a later value. Inside an async function, await lets you write code in order while the event loop handles other work.

Future<String> fetchUser(int id) async {
  await Future.delayed(const Duration(milliseconds: 300)); // simulated network
  return 'user$id';
}

Future<void> main() async {
  print('start');
  final user = await fetchUser(1);
  print(user);

  // Start several operations at once and wait for all of them
  final users = await Future.wait([fetchUser(2), fetchUser(3)]);
  print(users); // [user2, user3]

  // Apply a time limit
  try {
    await fetchUser(4).timeout(const Duration(milliseconds: 100));
  } catch (e) {
    print('timed out: $e');
  }
}

An async function always returns a Future (Future<void> if there is no value). A dropped Future can swallow errors; when you deliberately skip await, mark it with unawaited() from dart:async.

Stream: many values over time

A Stream is a sequence of values arriving over time, such as file chunks, WebSocket messages or input events. An async* function emits values with yield; consume them with await for or listen.

Stream<int> countdown(int from) async* {
  for (var i = from; i > 0; i--) {
    await Future.delayed(const Duration(milliseconds: 200));
    yield i;
  }
}

Future<void> main() async {
  await for (final n in countdown(3)) {
    print(n); // 3, 2, 1
  }

  final evensSquared = countdown(6)
      .where((n) => n.isEven)
      .map((n) => n * n);
  final subscription = evensSquared.listen(
    (value) => print('value: $value'),
    onError: (Object e) => print('error: $e'),
    onDone: () => print('done'),
  );
  await subscription.asFuture<void>();
}

There are single-subscription streams, which can be listened to only once, and broadcast streams, which many listeners can share. When you need to push events yourself, use a StreamController.

Isolates: concurrency without shared memory

async/await does not move CPU-heavy work to another core. Run expensive computations, such as parsing a huge JSON document, in an isolate. An isolate has its own memory and event loop and communicates only through messages, so there are no data races and no locks.

Domande su questo capitolo?
Capitolo precedenteErrors and Testing
import 'dart:isolate';

int fib(int n) => n < 2 ? n : fib(n - 1) + fib(n - 2);

Future<void> main() async {
  // Compute in a new isolate and receive the result
  final result = await Isolate.run(() => fib(38));
  print(result);
}

Isolate.run runs a function in a new isolate and returns its result as a Future. For a long-lived worker, use Isolate.spawn with a ReceivePort and SendPort; Flutter also offers compute. Dart compiled for the web does not support isolates this way; use web workers there.

Mixins and extension methods

Dart uses single inheritance, but mixins let you plug the same behavior into several classes. Declare one with mixin and apply it with with. Adding on restricts a mixin to subclasses of a particular type.

Extension methods add methods or getters to existing types whose source you cannot change, such as String or List. Extensions are resolved statically, so they do not apply when a variable's static type is dynamic.

abstract class Animal {
  String get name;
}

mixin Swimmer on Animal {
  void swim() => print('$name is swimming');
}

mixin Flyer {
  void fly() => print('taking off');
}

class Duck extends Animal with Swimmer, Flyer {
  @override
  final String name = 'Duck';
}

extension StringChecks on String {
  bool get isBlank => trim().isEmpty;
  String truncate(int max) => length <= max ? this : '${substring(0, max)}…';
}

void main() {
  Duck()
    ..swim()
    ..fly();
  print('   '.isBlank);                  // true
  print('Dart language guide'.truncate(4)); // Dart…
}

Since Dart 3.3 you can also use extension types, which wrap an existing type in a distinct static type with no run-time cost. They are mostly used for JavaScript interop and for giving values such as IDs their own type.

Dart and Flutter

Every Flutter screen is Dart code. Widgets are Dart classes; named parameters keep widget trees readable, and const widgets are not rebuilt, which helps performance.

Dart featureWhat Flutter gets
JIT compilation during developmentStateful hot reload while you edit code
AOT native compilation for releaseFast startup and smooth rendering
JavaScript and WebAssembly compilationWeb apps from the same code base
Sound null safetyFewer null errors at run time
async/await and isolatesNetworking and computation without freezing the UI

Even without Flutter, Dart suits command-line tools, servers built with packages such as shelf, and web apps.

Summary

Dart handles asynchronous work with Future, async/await and Stream on top of a single-threaded event loop, and moves heavy computation to isolates that share no memory. Mixins and extension methods reuse behavior without inheritance, and together with JIT and AOT compilation these features make Flutter's hot reload and fast execution possible.

Further reading

  • A tour of the Dart language
  • Asynchronous programming: async and await
  • Concurrency and isolates in Dart
  • Effective Dart
  • Dart tools overview
  • Core library API reference
  • pub.dev package repository

0 commenti

Commenti principaliPrima i più recenti

Accedi · Accedi per lasciare un commento.