本文へスキップ
製品デスクトップツールTASTECAD図面の確認TASTEFILESファイル管理TASTEFTPファイル転送TASTESSHリモートワークスペースTASTEZIP圧縮と展開TASTEWINMファイル管理開発ツールTASTECODERust 統合開発環境TASTESTUDIO統合開発・テスト環境TASTEETLデータ統合(ETL)サーバーTASTEREMOTEリモートデスクトップサーバーTASTEGEO空間情報サーバーTASTEMAILメールワークスペース投資TASTESTOCK株式自動売買デスクトップアプリはじめるダウンロードドキュメント購入すべての製品
マーケットプレイス
ニュース
技術ニュース今日の開発ニュース開発ドキュメントプログラミング言語RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWebフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngularサーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Expressアプリ・デスクトップ フレームワークTauriFlutterReact NativeElectronアルゴリズムアルゴリズムの基礎主要アルゴリズム発展アルゴリズム実務のアルゴリズム
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケースコミュニティガイド
協業技術移転ウェブサイト構築デスクトップアプリ構築リリース・決済パイプライン販売パートナーお問い合わせ
サービスリモートデスクトップインストールパッケージのカスタマイズ
TASTEDEV
製品

デスクトップツール

TASTECAD複雑な図面を、軽やかにひらくTASTEFILES必要なファイルだけを、最速でTASTEFTPファイルが行き交う、いちばん端正な道TASTESSHサーバーとあなたを、より確かにつなぐTASTEZIPより速くまとめ、より安全にひらくTASTEWINM2つの画面で整理する、キーボード中心のファイルマネージャー

開発ツール

TASTECODERust アプリの編集・ビルド・デバッグ・テストまでひとつのウィンドウでTASTESTUDIO編集からリモートテスト、承認した AI 修正までTASTEETL値を見ながら、データを運ぶ

サーバー

TASTEREMOTE自社サーバーで運用するリモートデスクトップTASTEGEOGeoServer 互換の空間情報サーバーを Rust で作り直しますTASTEMAILメールの主導権を、もう一度自分の手に

投資

TASTESTOCKいつ・何を。自分で決めたルールどおりに動く株式自動売買

はじめる

ダウンロード全製品の最新版ドキュメント各製品の使い方購入サブスクリプション・永久ライセンスすべての製品全製品を一覧で
すべての製品
マーケットプレイスニュース
技術

ニュース

今日の開発ニュース言語・フレームワーク・GitHub・AI の公式発表開発ドキュメント言語・フレームワーク・アルゴリズムのガイド

プログラミング言語

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

フレームワーク

Webフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngular
サーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
アプリ・デスクトップ フレームワークTauriFlutterReact NativeElectron

アルゴリズム

アルゴリズムの基礎計算量解析 · ソート · 探索 · 基本データ構造 · 木構造とヒープ主要アルゴリズムグラフ探索 · 最短経路と最小全域木 · 動的計画法 · 貪欲法 · 分割統治法 · バックトラッキング発展アルゴリズム文字列アルゴリズム · 数学と整数論 · ビット演算 · セグメント木 · Union-Find実務のアルゴリズムコーディング面接対策 · LRUキャッシュ · レート制限 · コンシステントハッシュ法
開発ドキュメントをすべて見る
コミュニティ
プロジェクトビルダーと作品を探す開発ログ決定と試行錯誤プロンプト再利用できる指示AIツールの問題Claude・Codex・Gemini の問題と回避策ショーケース完成した成果コミュニティガイドオープンにつくる方法
協業
技術移転Rust・egui でネイティブアプリを作るウェブサイト構築10言語、アカウント、ドキュメントとダウンロードデスクトップアプリ構築Rust・egui、WebView なしリリース・決済パイプライン署名・MSI・deb・rpm・AppImage・ハッシュ販売パートナー紹介して決済額の30%お問い合わせ構築・提携・投資のご相談
サービス
リモートデスクトップブラウザから自分のパソコンへインストールパッケージのカスタマイズ必要な機能だけ、設定は事前に
購入
JA
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
ログイン
ログイン
TASTEDEV

小さなツールから、より良い開発へ。

support@tastedev.netTASTEDEVを支援
製品製品ラインナップ購入ドキュメントダウンロードマーケットプレイスサポート
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケース
ポリシー会社概要プライバシーポリシー利用規約サブスクリプション規約返金ポリシーコミュニティガイドライン
アカウントログイン新規登録
訪問者
今日
昨日
累計閲覧
商号
GXSOFT
代表者
CHOI YOUNG GU
事業者登録番号
853-44-00368
所在地
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
電話
+82-10-4404-1523
メール
whitecalvin@tastedev.net
個人情報保護責任者
CHOI YOUNG GU

© 2026 TASTEDEV製品情報は検証済みの開発ソースに基づいています。リリース・改善中

Dart ドキュメント
Dart
Getting Started with DartSyntax BasicsTypes and DataLibraries and PackagesErrors and TestingKey Concepts
ディスカッション

Dart ガイド · 6/6

Key Concepts

この章は現在、英語でのみ提供しています。

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.

この章について質問がありますか?
前の章Errors 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件

人気のコメント順新しい順

ログイン · ログインするとコメントできます。