Dart

1 program Added 2025-10-22T09:34:58Z Model: openai/gpt-4o-miniTemp: 0.4 Evidence Report issue View issues
Aliases: Dartlang
Provenance: commit 55253b65f5 · authored 2025-10-22T11:34:58+02:00 · model openai/gpt-4o-mini

Sources mentioning this language

8 sources · pl_id: pl/dart
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q406009

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsmulti-paradigm: functional · imperative · object-oriented · reflective
Typing1.x: optional 2.x: inferred (static, strong)
Designed byGoogle · Lars Bak · Kasper Lund
First appeared2011
Influenced byC · C++ · C# · Erlang · Java · JavaScript · Ruby · Swift · Smalltalk · Strongtalk · TypeScript
LicenseBSD
Homepagehttp://dart.dev

Extensions claimed by this language

3 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.dartlinguistprimary34.8M files
.dartpygmentsprimary34.8M files
.dartwikidataprimary34.8M files

Related languages

Dark (0.41)Darklang (0.33)D (0.31)Fetlang (0.31)Xtlang (0.31)

LLM-contributed programs

Flutter Counter App

Provenance: commit 55253b65f5 · authored 2025-10-22T11:34:58+02:00 · model openai/gpt-4o-mini · Temp 0.4
code.dart · license: BSD or MIT · added: 2025-10-22T09:34:58Z
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Counter App'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ),
    );
  }
}

Real programs from Software Heritage

1 sample mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
http_filesystem.dart · 1945 B · ext .dart · seen 2159× in SWH
via unique-primary
swh:1:cnt:bae57bf01f932bf799e8d9860d5c30b8bc85ade3;origin=https://github.com/TunSawThant/SDK;anchor=swh:1:rev:44c6312df8c4ea6abf185be76c6f9e2097c3f336;path=/pkg/vm/lib/http_filesystem.dart
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
import 'dart:async';
import 'dart:io' as io;

import 'package:front_end/src/api_unstable/vm.dart';

class HttpAwareFileSystem implements FileSystem {
  FileSystem original;

  HttpAwareFileSystem(this.original);

  @override
  FileSystemEntity entityForUri(Uri uri) {
    if (uri.scheme == 'http' || uri.scheme == 'https') {
      return new HttpFileSystemEntity(this, uri);
    } else {
      return original.entityForUri(uri);
    }
  }
}

class HttpFileSystemEntity implements FileSystemEntity {
  HttpAwareFileSystem fileSystem;
  Uri uri;

  HttpFileSystemEntity(this.fileSystem, this.uri);

  @override
  Future<bool> exists() async {
    return connectAndRun((io.HttpClient httpClient) async {
      io.HttpClientRequest request = await httpClient.headUrl(uri);
      io.HttpClientResponse response = await request.close();
      return response.statusCode == io.HttpStatus.ok;
    });
  }

  @override
  Future<List<int>> readAsBytes() async {
    return connectAndRun((io.HttpClient httpClient) async {
      io.HttpClientRequest request = await httpClient.getUrl(uri);
      io.HttpClientResponse response = await request.close();
      if (response.statusCode != io.HttpStatus.ok) {
        throw new FileSystemException(uri, response.toString());
      }
      List<List<int>> list = await response.toList();
      return list.expand((list) => list).toList();
    });
  }

  @override
  Future<String> readAsString() async {
    return String.fromCharCodes(await readAsBytes());
  }

  T connectAndRun<T>(T body(io.HttpClient httpClient)) {
    io.HttpClient httpClient;
    try {
      httpClient = new io.HttpClient();
      // Set timeout to be shorter than anticipated OS default
      httpClient.connectionTimeout = const Duration(seconds: 5);
      return body(httpClient);
    } on Exception catch (e) {
      throw new FileSystemException(uri, e.toString());
    } finally {
      httpClient?.close(force: true);
    }
  }
}

Contribute — propose a file extension

Tell us where to find evidence about Dart (mapped to pl/dart). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Dart/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← DARSIMCO dart-pm →