text stringlengths 6 13.6M | id stringlengths 13 176 | metadata dict | __index_level_0__ int64 0 1.69k |
|---|---|---|---|
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
impor... | plugins/packages/path_provider/path_provider_foundation/test/path_provider_foundation_test.dart/0 | {
"file_path": "plugins/packages/path_provider/path_provider_foundation/test/path_provider_foundation_test.dart",
"repo_id": "plugins",
"token_count": 1482
} | 1,112 |
org.gradle.jvmargs=-Xmx4G
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
| plugins/packages/quick_actions/quick_actions_android/example/android/gradle.properties/0 | {
"file_path": "plugins/packages/quick_actions/quick_actions_android/example/android/gradle.properties",
"repo_id": "plugins",
"token_count": 38
} | 1,113 |
name: quick_actions_ios
description: An implementation for the iOS platform of the Flutter `quick_actions` plugin.
repository: https://github.com/flutter/plugins/tree/main/packages/quick_actions/quick_actions_ios
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purc... | plugins/packages/quick_actions/quick_actions_ios/pubspec.yaml/0 | {
"file_path": "plugins/packages/quick_actions/quick_actions_ios/pubspec.yaml",
"repo_id": "plugins",
"token_count": 310
} | 1,114 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v5.0.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_co... | plugins/packages/shared_preferences/shared_preferences_foundation/lib/messages.g.dart/0 | {
"file_path": "plugins/packages/shared_preferences/shared_preferences_foundation/lib/messages.g.dart",
"repo_id": "plugins",
"token_count": 2223
} | 1,115 |
name: shared_preferences_linux
description: Linux implementation of the shared_preferences plugin
repository: https://github.com/flutter/plugins/tree/main/packages/shared_preferences/shared_preferences_linux
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferenc... | plugins/packages/shared_preferences/shared_preferences_linux/pubspec.yaml/0 | {
"file_path": "plugins/packages/shared_preferences/shared_preferences_linux/pubspec.yaml",
"repo_id": "plugins",
"token_count": 318
} | 1,116 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert' show json;
import 'dart:html' as html;
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration... | plugins/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart/0 | {
"file_path": "plugins/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart",
"repo_id": "plugins",
"token_count": 1343
} | 1,117 |
group 'io.flutter.plugins.urllauncher'
version '1.0-SNAPSHOT'
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
}
}
rootProject.allprojects {
repositories {
google()
mavenCentral()
}
}... | plugins/packages/url_launcher/url_launcher_android/android/build.gradle/0 | {
"file_path": "plugins/packages/url_launcher/url_launcher_android/android/build.gradle",
"repo_id": "plugins",
"token_count": 566
} | 1,118 |
## 6.1.0
* Updates minimum Flutter version to 3.3 and iOS 11.
## 6.0.18
* Updates code for stricter lint checks.
* Updates minimum Flutter version to 2.10.
## 6.0.17
* Suppresses warnings for pre-iOS-13 codepaths.
## 6.0.16
* Fixes library_private_types_in_public_api, sort_child_properties_last and use_key_in_wi... | plugins/packages/url_launcher/url_launcher_ios/CHANGELOG.md/0 | {
"file_path": "plugins/packages/url_launcher/url_launcher_ios/CHANGELOG.md",
"repo_id": "plugins",
"token_count": 201
} | 1,119 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:url_launcher_ios/url_launcher_ios.dart';
import 'p... | plugins/packages/url_launcher/url_launcher_ios/test/url_launcher_ios_test.dart/0 | {
"file_path": "plugins/packages/url_launcher/url_launcher_ios/test/url_launcher_ios_test.dart",
"repo_id": "plugins",
"token_count": 2885
} | 1,120 |
name: url_launcher_windows
description: Windows implementation of the url_launcher plugin.
repository: https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_windows
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
version: 3.0.3
e... | plugins/packages/url_launcher/url_launcher_windows/pubspec.yaml/0 | {
"file_path": "plugins/packages/url_launcher/url_launcher_windows/pubspec.yaml",
"repo_id": "plugins",
"token_count": 297
} | 1,121 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@import Flutter;
@import XCTest;
@import webview_flutter;
// OCMock library doesn't generate a valid modulemap.
#import <OCMock/OCMock.h>
static bool feq... | plugins/packages/webview_flutter/webview_flutter/example/ios/RunnerTests/FLTWebViewTests.m/0 | {
"file_path": "plugins/packages/webview_flutter/webview_flutter/example/ios/RunnerTests/FLTWebViewTests.m",
"repo_id": "plugins",
"token_count": 1616
} | 1,122 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library webview_flutter;
export 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart'
show
JavaScriptMessage,
... | plugins/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart/0 | {
"file_path": "plugins/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart",
"repo_id": "plugins",
"token_count": 366
} | 1,123 |
# webview\_flutter\_android
The Android implementation of [`webview_flutter`][1].
## Usage
This package is [endorsed][2], which means you can simply use `webview_flutter`
normally. This package will be automatically included in your app when you do.
## Display Mode
This plugin supports two different platform view ... | plugins/packages/webview_flutter/webview_flutter_android/README.md/0 | {
"file_path": "plugins/packages/webview_flutter/webview_flutter_android/README.md",
"repo_id": "plugins",
"token_count": 824
} | 1,124 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "FWFNavigationDelegateHostApi.h"
#import "FWFDataConverters.h"
#import "FWFWebViewConfigurationHostApi.h"
@interface FWFNavigationDelegateFlutterA... | plugins/packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFNavigationDelegateHostApi.m/0 | {
"file_path": "plugins/packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFNavigationDelegateHostApi.m",
"repo_id": "plugins",
"token_count": 6009
} | 1,125 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "FWFWebViewConfigurationHostApi.h"
#import "FWFDataConverters.h"
#import "FWFWebViewConfigurationHostApi.h"
@interface FWFWebViewConfigurationFlut... | plugins/packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFWebViewConfigurationHostApi.m/0 | {
"file_path": "plugins/packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFWebViewConfigurationHostApi.m",
"repo_id": "plugins",
"token_count": 2884
} | 1,126 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:math';
// TODO(a14n): remove this import once Flutter 3.1 or later reaches stable (including flutter/flutter#106316)
// ignore: unnecessary_im... | plugins/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.dart/0 | {
"file_path": "plugins/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.dart",
"repo_id": "plugins",
"token_count": 19984
} | 1,127 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/annotations.dart';
import 'package:webview... | plugins/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.dart/0 | {
"file_path": "plugins/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.dart",
"repo_id": "plugins",
"token_count": 1018
} | 1,128 |
# Removed
See https://github.com/flutter/packages/blob/main/script/tool/README.md for the
current location of this tooling.
## Temporary shim
This is a temporary, minimal version of the tools sufficient to keep the
following scripts running until the repository merge is complete and they are
updated to use flutter/p... | plugins/script/tool/README.md/0 | {
"file_path": "plugins/script/tool/README.md",
"repo_id": "plugins",
"token_count": 168
} | 1,129 |
// Copyright 2019 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package dev.flutter.example.androidView
import android.content.Intent
import android.os.Bundle
import android.os.Parcelable
import androidx.appcompat.app.App... | samples/add_to_app/android_view/android_view/app/src/main/java/dev/flutter/example/androidView/MainActivity.kt/0 | {
"file_path": "samples/add_to_app/android_view/android_view/app/src/main/java/dev/flutter/example/androidView/MainActivity.kt",
"repo_id": "samples",
"token_count": 1503
} | 1,130 |
// Copyright 2020 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package dev.flutter.example.books
import android.app.Application
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.embedding.engine.FlutterE... | samples/add_to_app/books/android_books/app/src/main/java/dev/flutter/example/books/BookApplication.kt/0 | {
"file_path": "samples/add_to_app/books/android_books/app/src/main/java/dev/flutter/example/books/BookApplication.kt",
"repo_id": "samples",
"token_count": 326
} | 1,131 |
// Autogenerated from Pigeon (v1.0.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name
// @dart = 2.12... | samples/add_to_app/books/flutter_module_books/lib/api.dart/0 | {
"file_path": "samples/add_to_app/books/flutter_module_books/lib/api.dart",
"repo_id": "samples",
"token_count": 2301
} | 1,132 |
// Copyright 2019 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package dev.flutter.example.androidfullscreen
import androidx.test.core.app.ActivityScenario
import androidx.test.espresso.Espresso.onView
import androidx.te... | samples/add_to_app/fullscreen/android_fullscreen/app/src/androidTest/java/dev/flutter/example/androidfullscreen/ExampleInstrumentedTest.kt/0 | {
"file_path": "samples/add_to_app/fullscreen/android_fullscreen/app/src/androidTest/java/dev/flutter/example/androidfullscreen/ExampleInstrumentedTest.kt",
"repo_id": "samples",
"token_count": 1158
} | 1,133 |
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
signingConfigs {
self {
}
}
compileSdkVersion 33
defaultConfig {
applicationId "dev.flutter.multipleflutters"
minSdkVersion 24
targetSdkVersion 33
versionCode 1
versio... | samples/add_to_app/multiple_flutters/multiple_flutters_android/app/build.gradle/0 | {
"file_path": "samples/add_to_app/multiple_flutters/multiple_flutters_android/app/build.gradle",
"repo_id": "samples",
"token_count": 598
} | 1,134 |
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import UIKit
/// A UIViewController that hosts two instances of SingleFlutterViewController, splitting the screen
/// between them.
class DoubleFlutterViewCo... | samples/add_to_app/multiple_flutters/multiple_flutters_ios/MultipleFluttersIos/DoubleFlutterViewController.swift/0 | {
"file_path": "samples/add_to_app/multiple_flutters/multiple_flutters_ios/MultipleFluttersIos/DoubleFlutterViewController.swift",
"repo_id": "samples",
"token_count": 394
} | 1,135 |
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 33
defaultConfig {
applicationId "dev.flutter.example.androidusingprebuiltmodule"
minSdkVersion 19
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrume... | samples/add_to_app/prebuilt_module/android_using_prebuilt_module/app/build.gradle/0 | {
"file_path": "samples/add_to_app/prebuilt_module/android_using_prebuilt_module/app/build.gradle",
"repo_id": "samples",
"token_count": 771
} | 1,136 |
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
| samples/android_splash_screen/android/gradle.properties/0 | {
"file_path": "samples/android_splash_screen/android/gradle.properties",
"repo_id": "samples",
"token_count": 31
} | 1,137 |
export 'animated_builder.dart';
export 'animated_container.dart';
export 'animation_controller.dart';
export 'custom_tween.dart';
export 'fade_transition.dart';
export 'page_route_builder.dart';
export 'tween_sequence.dart';
export 'tweens.dart';
| samples/animations/lib/src/basics/basics.dart/0 | {
"file_path": "samples/animations/lib/src/basics/basics.dart",
"repo_id": "samples",
"token_count": 89
} | 1,138 |
export 'animated_list.dart';
export 'animated_positioned.dart';
export 'animated_switcher.dart';
export 'card_swipe.dart';
export 'carousel.dart';
export 'curved_animation.dart';
export 'expand_card.dart';
export 'flutter_animate.dart';
export 'focus_image.dart';
export 'hero_animation.dart';
export 'physics_card_drag.... | samples/animations/lib/src/misc/misc.dart/0 | {
"file_path": "samples/animations/lib/src/misc/misc.dart",
"repo_id": "samples",
"token_count": 136
} | 1,139 |
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:animations/src/misc/focus_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
Widget create... | samples/animations/test/misc/focus_image_test.dart/0 | {
"file_path": "samples/animations/test/misc/focus_image_test.dart",
"repo_id": "samples",
"token_count": 664
} | 1,140 |
# Use latest stable channel SDK.
FROM dart:stable AS build
# Copy shared code.
WORKDIR /shared
COPY /shared/. .
# Copy server code.
WORKDIR /server
COPY /server/. .
# Resolve app dependencies.
RUN dart pub get
# AOT compile app.
RUN dart compile exe bin/server.dart -o bin/server
# Build minimal serving image from ... | samples/code_sharing/Dockerfile/0 | {
"file_path": "samples/code_sharing/Dockerfile",
"repo_id": "samples",
"token_count": 194
} | 1,141 |
#include "../../Flutter/Flutter-Release.xcconfig"
#include "Warnings.xcconfig"
| samples/code_sharing/client/macos/Runner/Configs/Release.xcconfig/0 | {
"file_path": "samples/code_sharing/client/macos/Runner/Configs/Release.xcconfig",
"repo_id": "samples",
"token_count": 32
} | 1,142 |
import 'package:freezed_annotation/freezed_annotation.dart';
part 'models.freezed.dart';
part 'models.g.dart';
@Freezed()
class Increment with _$Increment {
const factory Increment({required int by}) = _Increment;
factory Increment.fromJson(Map<String, dynamic> json) =>
_$IncrementFromJson(json);
}
@Freez... | samples/code_sharing/shared/lib/src/models.dart/0 | {
"file_path": "samples/code_sharing/shared/lib/src/models.dart",
"repo_id": "samples",
"token_count": 167
} | 1,143 |
/// Returns true if the given String is a valid email address.
bool isValidEmail(String text) {
return RegExp(
r'(?<name>[a-zA-Z0-9]+)'
r'@'
r'(?<domain>[a-zA-Z0-9]+)'
r'\.'
r'(?<topLevelDomain>[a-zA-Z0-9]+)',
).hasMatch(text);
}
| samples/context_menus/lib/is_valid_email.dart/0 | {
"file_path": "samples/context_menus/lib/is_valid_email.dart",
"repo_id": "samples",
"token_count": 127
} | 1,144 |
import 'package:context_menus/anywhere_page.dart';
import 'package:context_menus/main.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Right click works outside of text', (tester) async {
await teste... | samples/context_menus/test/anywhere_page_test.dart/0 | {
"file_path": "samples/context_menus/test/anywhere_page_test.dart",
"repo_id": "samples",
"token_count": 447
} | 1,145 |
// Copyright 2020 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "include/federated_plugin_windows/federated_plugin_windows_plugin.h"
// This must be included before many other Windows headers.
#include <windows.h... | samples/experimental/federated_plugin/federated_plugin_windows/windows/federated_plugin_windows_plugin.cpp/0 | {
"file_path": "samples/experimental/federated_plugin/federated_plugin_windows/windows/federated_plugin_windows_plugin.cpp",
"repo_id": "samples",
"token_count": 986
} | 1,146 |
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:linting_tool/layout/adaptive.dart';
import 'package:linting_tool/model/rules_store.dart';
import 'pack... | samples/experimental/linting_tool/lib/pages/default_lints_page.dart/0 | {
"file_path": "samples/experimental/linting_tool/lib/pages/default_lints_page.dart",
"repo_id": "samples",
"token_count": 1373
} | 1,147 |
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.jni_demo">
<application
android:label="jni_demo"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:... | samples/experimental/pedometer/example/android/app/src/main/AndroidManifest.xml/0 | {
"file_path": "samples/experimental/pedometer/example/android/app/src/main/AndroidManifest.xml",
"repo_id": "samples",
"token_count": 1030
} | 1,148 |
// Autogenerated by jnigen. DO NOT EDIT!
// ignore_for_file: annotate_overrides
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
// ignore_for_file: file_names
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: no_leading_under... | samples/experimental/pedometer/lib/health_connect.dart/0 | {
"file_path": "samples/experimental/pedometer/lib/health_connect.dart",
"repo_id": "samples",
"token_count": 228523
} | 1,149 |
# Run with tooling from https://github.com/flutter/codelabs/tree/main/tooling/codelab_rebuild
name: Animations rebuild script
steps:
- name: Remove runners
rmdirs:
- android
- ios
- linux
- macos
- windows
- name: Flutter recreate
flutter: create . --platforms android,ios,linu... | samples/experimental/varfont_shader_puzzle/codelab_rebuild.yaml/0 | {
"file_path": "samples/experimental/varfont_shader_puzzle/codelab_rebuild.yaml",
"repo_id": "samples",
"token_count": 170
} | 1,150 |
// Copyright 2023 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
class PuzzleModel {
final int dim; // num tiles in any one dir; dim x dim board
// 2d array like a board
// x is the tileID and its position in the arr... | samples/experimental/varfont_shader_puzzle/lib/model/puzzle_model.dart/0 | {
"file_path": "samples/experimental/varfont_shader_puzzle/lib/model/puzzle_model.dart",
"repo_id": "samples",
"token_count": 457
} | 1,151 |
include: package:analysis_defaults/flutter.yaml
| samples/experimental/web_dashboard/analysis_options.yaml/0 | {
"file_path": "samples/experimental/web_dashboard/analysis_options.yaml",
"repo_id": "samples",
"token_count": 15
} | 1,152 |
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
extension DayUtils on DateTime {
/// The UTC date portion of a datetime, without the minutes, seconds, ... | samples/experimental/web_dashboard/lib/src/utils/day_helpers.dart/0 | {
"file_path": "samples/experimental/web_dashboard/lib/src/utils/day_helpers.dart",
"repo_id": "samples",
"token_count": 173
} | 1,153 |
// Copyright 2019 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/materi... | samples/flutter_maps_firestore/lib/main.dart/0 | {
"file_path": "samples/flutter_maps_firestore/lib/main.dart",
"repo_id": "samples",
"token_count": 3190
} | 1,154 |
name: form_app
description: A sample demonstrating different types of forms and best practices
publish_to: "none"
version: 1.0.0+1
environment:
sdk: ^3.2.0
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
intl: ^0.19.0
http: ^1.0.0
json_annotation: any
english_words: ^4.0.0
window_size:... | samples/form_app/pubspec.yaml/0 | {
"file_path": "samples/form_app/pubspec.yaml",
"repo_id": "samples",
"token_count": 271
} | 1,155 |
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
| samples/game_template/android/gradle.properties/0 | {
"file_path": "samples/game_template/android/gradle.properties",
"repo_id": "samples",
"token_count": 31
} | 1,156 |
// Copyright 2022, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'persistence/player_progress_pers... | samples/game_template/lib/src/player_progress/player_progress.dart/0 | {
"file_path": "samples/game_template/lib/src/player_progress/player_progress.dart",
"repo_id": "samples",
"token_count": 550
} | 1,157 |
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
#include <audioplayers_linux/audioplayers_linux_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar =
fl_plugin_registry_get_registrar_fo... | samples/game_template/linux/flutter/generated_plugin_registrant.cc/0 | {
"file_path": "samples/game_template/linux/flutter/generated_plugin_registrant.cc",
"repo_id": "samples",
"token_count": 169
} | 1,158 |
# Google Maps Demo
This sample Flutter app showcases the [Google Maps for Flutter plugin](https://developers.google.com/maps/flutter-plugin/overview).
## Getting Started
1. See the overview at https://developers.google.com/maps/flutter-plugin/overview.
1. Follow the setup guide at https://developers.google.com/maps/... | samples/google_maps/README.md/0 | {
"file_path": "samples/google_maps/README.md",
"repo_id": "samples",
"token_count": 153
} | 1,159 |
name: ios_app_clip
description: An example Flutter project that can build as an App Clip.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ^3.2.0
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
device_info: ^2.0.3
dev_dependencies:
... | samples/ios_app_clip/pubspec.yaml/0 | {
"file_path": "samples/ios_app_clip/pubspec.yaml",
"repo_id": "samples",
"token_count": 166
} | 1,160 |
#import "GeneratedPluginRegistrant.h"
| samples/isolate_example/ios/Runner/Runner-Bridging-Header.h/0 | {
"file_path": "samples/isolate_example/ios/Runner/Runner-Bridging-Header.h",
"repo_id": "samples",
"token_count": 13
} | 1,161 |
## `jsonexample` sample retired
The `jsonexample` sample has reached the end of it's useful life. It was great code
when it has written, but the world has changed. Dart 3 introduced Patterns and
records. There is also various JSON parsing tools like `json_serializable`.
For further information, please see:
- The [D... | samples/jsonexample/README.md/0 | {
"file_path": "samples/jsonexample/README.md",
"repo_id": "samples",
"token_count": 179
} | 1,162 |
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ignore_for_file: avoid_types_on_closure_parameters
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package... | samples/material_3_demo/test/component_screen_test.dart/0 | {
"file_path": "samples/material_3_demo/test/component_screen_test.dart",
"repo_id": "samples",
"token_count": 5422
} | 1,163 |
org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true
android.enableJetifier=true
| samples/navigation_and_routing/android/gradle.properties/0 | {
"file_path": "samples/navigation_and_routing/android/gradle.properties",
"repo_id": "samples",
"token_count": 30
} | 1,164 |
// Copyright 2021, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'book.dart';
class Author {
final int id;
final String name;
final books = <Book>[];
Aut... | samples/navigation_and_routing/lib/src/data/author.dart/0 | {
"file_path": "samples/navigation_and_routing/lib/src/data/author.dart",
"repo_id": "samples",
"token_count": 101
} | 1,165 |
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_size/window_size_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
... | samples/navigation_and_routing/linux/flutter/generated_plugin_registrant.cc/0 | {
"file_path": "samples/navigation_and_routing/linux/flutter/generated_plugin_registrant.cc",
"repo_id": "samples",
"token_count": 256
} | 1,166 |
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
#include <url_launcher_windows/url_launcher_windows.h>
#include <window_size/window_size_plugin.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
UrlLauncherWindowsRegisterWithRegistrar(
registry->... | samples/navigation_and_routing/windows/flutter/generated_plugin_registrant.cc/0 | {
"file_path": "samples/navigation_and_routing/windows/flutter/generated_plugin_registrant.cc",
"repo_id": "samples",
"token_count": 159
} | 1,167 |
#include "Generated.xcconfig"
| samples/platform_channels/ios/Flutter/Debug.xcconfig/0 | {
"file_path": "samples/platform_channels/ios/Flutter/Debug.xcconfig",
"repo_id": "samples",
"token_count": 12
} | 1,168 |
// Copyright 2020 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';
import 'package:flutter/services.dart';
/// This class includes two methods [addPetDetails] and [removePet] which are used
/// to add... | samples/platform_channels/lib/src/pet_list_message_channel.dart/0 | {
"file_path": "samples/platform_channels/lib/src/pet_list_message_channel.dart",
"repo_id": "samples",
"token_count": 898
} | 1,169 |
// Copyright 2020 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:math';
import 'package:english_words/english_words.dart';
// ignore: implementation_imports
import 'package:flutter/material.dart';
// This fil... | samples/platform_design/lib/utils.dart/0 | {
"file_path": "samples/platform_design/lib/utils.dart",
"repo_id": "samples",
"token_count": 818
} | 1,170 |
package dev.flutter.provider_shopper
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
| samples/provider_shopper/android/app/src/main/kotlin/dev/flutter/provider_shopper/MainActivity.kt/0 | {
"file_path": "samples/provider_shopper/android/app/src/main/kotlin/dev/flutter/provider_shopper/MainActivity.kt",
"repo_id": "samples",
"token_count": 42
} | 1,171 |
// Copyright 2020 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
class MyLogin extends StatelessWidget {
const MyLogin({super.key});
@... | samples/provider_shopper/lib/screens/login.dart/0 | {
"file_path": "samples/provider_shopper/lib/screens/login.dart",
"repo_id": "samples",
"token_count": 809
} | 1,172 |
#include "../../Flutter/Flutter-Release.xcconfig"
#include "Warnings.xcconfig"
| samples/provider_shopper/macos/Runner/Configs/Release.xcconfig/0 | {
"file_path": "samples/provider_shopper/macos/Runner/Configs/Release.xcconfig",
"repo_id": "samples",
"token_count": 32
} | 1,173 |
#include "Generated.xcconfig"
| samples/simplistic_editor/ios/Flutter/Debug.xcconfig/0 | {
"file_path": "samples/simplistic_editor/ios/Flutter/Debug.xcconfig",
"repo_id": "samples",
"token_count": 12
} | 1,174 |
include: package:analysis_defaults/flutter.yaml
| samples/testing_app/analysis_options.yaml/0 | {
"file_path": "samples/testing_app/analysis_options.yaml",
"repo_id": "samples",
"token_count": 15
} | 1,175 |
// Copyright 2018 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart';
import 'package:veggieseasons/data/app_state.dart';
import 'package:veggiese... | samples/veggieseasons/lib/screens/favorites.dart/0 | {
"file_path": "samples/veggieseasons/lib/screens/favorites.dart",
"repo_id": "samples",
"token_count": 884
} | 1,176 |
//
// Generated file. Do not edit.
//
import FlutterMacOS
import Foundation
import shared_preferences_foundation
import window_size
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
WindowSizePlugin.r... | samples/veggieseasons/macos/Flutter/GeneratedPluginRegistrant.swift/0 | {
"file_path": "samples/veggieseasons/macos/Flutter/GeneratedPluginRegistrant.swift",
"repo_id": "samples",
"token_count": 112
} | 1,177 |
// Copyright 2020 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file
import 'dart:io';
import 'package:path/path.dart' as p;
import 'common.dart';
void main() async {
final packageDirs = listPackageDirs(Directory.current)
... | samples/web/_tool/verify_packages.dart/0 | {
"file_path": "samples/web/_tool/verify_packages.dart",
"repo_id": "samples",
"token_count": 609
} | 1,178 |
// Copyright 2020 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file
/// Defines the data types for this project.
library;
import 'package:json_annotation/json_annotation.dart';
import 'package:path/path.dart' as path;
import '... | samples/web/samples_index/lib/src/data.dart/0 | {
"file_path": "samples/web/samples_index/lib/src/data.dart",
"repo_id": "samples",
"token_count": 1490
} | 1,179 |
import 'dart:html';
import 'package:mdc_web/mdc_web.dart';
import 'package:samples_index/browser.dart';
/// The Material text input for searching
late final MDCTextField searchBar;
late final MDCChipSet chipSet;
/// The current set of query parameters that determine how the cards are
/// filtered. e.g. {'search': 'k... | samples/web/samples_index/web/main.dart/0 | {
"file_path": "samples/web/samples_index/web/main.dart",
"repo_id": "samples",
"token_count": 1468
} | 1,180 |
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* ht... | samples/web_embedding/ng-flutter/flutter/web/index.html/0 | {
"file_path": "samples/web_embedding/ng-flutter/flutter/web/index.html",
"repo_id": "samples",
"token_count": 748
} | 1,181 |
{
"projects": {
"default": "flutter-docs-prod",
"devtools-staging": "flutter-website-dt-staging",
"flutter-dev": "flutter-dev-230821",
"staging-1": "flutter-io-staging-1",
"staging-2": "flutter-io-staging-2",
"sz": "sz-flutter",
"sz2": "sz-flutter-2",
"ft": "flutter-web-staging",
"... | website/.firebaserc/0 | {
"file_path": "website/.firebaserc",
"repo_id": "website",
"token_count": 213
} | 1,182 |
#!/usr/bin/make -f
-include .env
all: build clean
.DEFAULT_GOAL := up
.PHONY: all
BUILD_COMMIT := $(shell git rev-parse --short HEAD)
BUILD_CONFIGS ?= _config.yml
BUILD_NAME = tmpbuild
BUILD_TAG = "fltbuild:${BUILD_COMMIT}"
# Build the production image and copy site build to local.
# This will reset and also clea... | website/Makefile/0 | {
"file_path": "website/Makefile",
"repo_id": "website",
"token_count": 298
} | 1,183 |
// ignore_for_file: unused_local_variable
// #docregion ShakeCurve
import 'dart:math';
// #enddocregion ShakeCurve
import 'package:flutter/material.dart';
void main() => runApp(const LogoApp());
// #docregion diff
class AnimatedLogo extends AnimatedWidget {
const AnimatedLogo({super.key, required Animation<double>... | website/examples/animation/animate5/lib/main.dart/0 | {
"file_path": "website/examples/animation/animate5/lib/main.dart",
"repo_id": "website",
"token_count": 1319
} | 1,184 |
name: implicit
description: A new Flutter project.
publish_to: none
version: 1.0.0+1
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
example_utils:
path: ../../example_utils
flutter:
uses-material-design: true
| website/examples/animation/implicit/pubspec.yaml/0 | {
"file_path": "website/examples/animation/implicit/pubspec.yaml",
"repo_id": "website",
"token_count": 104
} | 1,185 |
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
const appTitle = 'Orientation Demo';
return const MaterialApp(
title: appTitle,
home: OrientationL... | website/examples/cookbook/design/orientation/lib/main.dart/0 | {
"file_path": "website/examples/cookbook/design/orientation/lib/main.dart",
"repo_id": "website",
"token_count": 559
} | 1,186 |
import 'package:flutter/material.dart';
@immutable
class FilterSelector extends StatefulWidget {
const FilterSelector({
super.key,
required this.filters,
required this.onFilterChanged,
this.padding = const EdgeInsets.symmetric(vertical: 24),
});
final List<Color> filters;
final void Function(C... | website/examples/cookbook/effects/photo_filter_carousel/lib/excerpt2.dart/0 | {
"file_path": "website/examples/cookbook/effects/photo_filter_carousel/lib/excerpt2.dart",
"repo_id": "website",
"token_count": 909
} | 1,187 |
// ignore_for_file: unused_field
import 'package:flutter/material.dart';
class Menu extends StatefulWidget {
const Menu({super.key});
@override
State<Menu> createState() => _MenuState();
}
// #docregion delays
class _MenuState extends State<Menu> with SingleTickerProviderStateMixin {
static const _initialDe... | website/examples/cookbook/effects/staggered_menu_animation/lib/animation_delays.dart/0 | {
"file_path": "website/examples/cookbook/effects/staggered_menu_animation/lib/animation_delays.dart",
"repo_id": "website",
"token_count": 327
} | 1,188 |
import 'dart:async';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/foundation.dart';
import 'package:logging/logging.dart';
import '../game_internals/board_state.dart';
import '../game_internals/playing_area.dart';
import '../game_internals/playing_card.dart';
class FirestoreControll... | website/examples/cookbook/games/firestore_multiplayer/lib/multiplayer/firestore_controller.dart/0 | {
"file_path": "website/examples/cookbook/games/firestore_multiplayer/lib/multiplayer/firestore_controller.dart",
"repo_id": "website",
"token_count": 1621
} | 1,189 |
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
class SimpleImage extends StatelessWidget {
const SimpleImage({super.key});
@override
Widget build(BuildContext context) {
// #docregion SimpleCachedImage
return CachedNetworkImage(
imageUrl: '... | website/examples/cookbook/images/cached_images/lib/simple.dart/0 | {
"file_path": "website/examples/cookbook/images/cached_images/lib/simple.dart",
"repo_id": "website",
"token_count": 140
} | 1,190 |
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
const title = 'Floating App Bar';
return MaterialApp(
title: title,
home: Scaffold(
// No app... | website/examples/cookbook/lists/floating_app_bar/lib/step2.dart/0 | {
"file_path": "website/examples/cookbook/lists/floating_app_bar/lib/step2.dart",
"repo_id": "website",
"token_count": 494
} | 1,191 |
// ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables
import 'package:flutter/material.dart';
import 'main.dart';
void layoutBuilder() {
// #docregion builder
LayoutBuilder(builder: (context, constraints) {
return SingleChildScrollView(
child: Placeholder(),
);
... | website/examples/cookbook/lists/spaced_items/lib/spaced_list.dart/0 | {
"file_path": "website/examples/cookbook/lists/spaced_items/lib/spaced_list.dart",
"repo_id": "website",
"token_count": 758
} | 1,192 |
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
Future<Album> fetchAlbum() async {
// #docregion get
final response = await http.get(
Uri.parse('https://jsonplaceholder.typicode.com/albums/1'),
// Send authorization headers to the backend.
headers... | website/examples/cookbook/networking/authenticated_requests/lib/main.dart/0 | {
"file_path": "website/examples/cookbook/networking/authenticated_requests/lib/main.dart",
"repo_id": "website",
"token_count": 435
} | 1,193 |
// #docregion convert-import
import 'dart:convert';
// #enddocregion convert-import
import 'package:http/http.dart' as http;
// #docregion CreateAlbum
Future<http.Response> createAlbum(String title) {
return http.post(
Uri.parse('https://jsonplaceholder.typicode.com/albums'),
headers: <String, String>{
... | website/examples/cookbook/networking/send_data/lib/create_album.dart/0 | {
"file_path": "website/examples/cookbook/networking/send_data/lib/create_album.dart",
"repo_id": "website",
"token_count": 183
} | 1,194 |
import 'dart:async';
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
Future<void> main() async {
// Ensure that plugin services are initialized so that `availableCameras()`
// can be called before `runApp()`
WidgetsFlutterBinding.ensureInitialized();
// Obtain a list of the avail... | website/examples/cookbook/plugins/picture_using_camera/lib/main_step3.dart/0 | {
"file_path": "website/examples/cookbook/plugins/picture_using_camera/lib/main_step3.dart",
"repo_id": "website",
"token_count": 608
} | 1,195 |
name: scrolling
description: A new Flutter project.
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
path_provider: ^2.1.2
path: ^1.9.0
flutter_test:
sdk: flutter
dev_dependencies:
example_utils:
path: ../../../../example_utils
integration_test:
sdk: flutter
flutter_driver... | website/examples/cookbook/testing/integration/profiling/pubspec.yaml/0 | {
"file_path": "website/examples/cookbook/testing/integration/profiling/pubspec.yaml",
"repo_id": "website",
"token_count": 158
} | 1,196 |
name: obfuscate
description: A new Flutter project.
publish_to: none
version: 1.0.0+1
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.6
flutter_test:
sdk: flutter
dev_dependencies:
example_utils:
path: ../../example_utils
integration_test:
sdk: flutter
... | website/examples/deployment/obfuscate/pubspec.yaml/0 | {
"file_path": "website/examples/deployment/obfuscate/pubspec.yaml",
"repo_id": "website",
"token_count": 150
} | 1,197 |
import 'package:json_annotation/json_annotation.dart';
/// This allows the `User` class to access private members in
/// the generated file. The value for this is *.g.dart, where
/// the star denotes the source file name.
part 'user.g.dart';
/// An annotation for the code generator to know that this class needs the
/... | website/examples/development/data-and-backend/json/lib/serializable/user.dart/0 | {
"file_path": "website/examples/development/data-and-backend/json/lib/serializable/user.dart",
"repo_id": "website",
"token_count": 283
} | 1,198 |
// ignore_for_file: import_of_legacy_library_into_null_safe
// #docregion UrlLauncher
import 'package:flutter/material.dart';
import 'package:path/path.dart' as p;
import 'package:url_launcher/url_launcher.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key}... | website/examples/development/plugin_api_migration/lib/url_launcher.dart/0 | {
"file_path": "website/examples/development/plugin_api_migration/lib/url_launcher.dart",
"repo_id": "website",
"token_count": 334
} | 1,199 |
// #docregion StatefulWidget
import 'package:flutter/material.dart';
void main() {
runApp(const SampleApp());
}
class SampleApp extends StatelessWidget {
const SampleApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
... | website/examples/get-started/flutter-for/android_devs/lib/text_widget.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/android_devs/lib/text_widget.dart",
"repo_id": "website",
"token_count": 585
} | 1,200 |
import 'package:flutter/material.dart';
class MyWidget extends StatelessWidget {
const MyWidget({super.key});
@override
Widget build(BuildContext context) {
// #docregion InputHint
return const Center(
child: TextField(
decoration: InputDecoration(hintText: 'This is a hint'),
),
... | website/examples/get-started/flutter-for/ios_devs/lib/form.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/ios_devs/lib/form.dart",
"repo_id": "website",
"token_count": 705
} | 1,201 |
import 'package:flutter/cupertino.dart';
import 'package:url_launcher/url_launcher.dart';
void main() {
runApp(
const App(),
);
}
class App extends StatelessWidget {
const App({
super.key,
});
@override
Widget build(BuildContext context) {
return const CupertinoApp(
theme: CupertinoThem... | website/examples/get-started/flutter-for/ios_devs/lib/openapp.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/ios_devs/lib/openapp.dart",
"repo_id": "website",
"token_count": 485
} | 1,202 |
name: ios_devs
description: A new Flutter project.
publish_to: none
version: 1.0.0+1
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
cupertino_icons: ^1.0.6
http: ^1.2.0
shared_preferences: ^2.2.2
url_launcher: ^6.2.4
dev_dependencies:
example... | website/examples/get-started/flutter-for/ios_devs/pubspec.yaml/0 | {
"file_path": "website/examples/get-started/flutter-for/ios_devs/pubspec.yaml",
"repo_id": "website",
"token_count": 193
} | 1,203 |
import 'package:flutter/material.dart';
class MyForm extends StatelessWidget {
const MyForm({super.key});
@override
Widget build(BuildContext context) {
return const Center(
// #docregion HintText
child: TextField(
decoration: InputDecoration(hintText: 'This is a hint'),
),
/... | website/examples/get-started/flutter-for/xamarin_devs/lib/input_decoration.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/xamarin_devs/lib/input_decoration.dart",
"repo_id": "website",
"token_count": 136
} | 1,204 |
name: xamarin_devs
description: A new Flutter project.
publish_to: none
version: 1.0.0+1
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
cupertino_icons: ^1.0.6
http: ^1.2.0
dev_dependencies:
example_utils:
path: ../../../example_utils
flutt... | website/examples/get-started/flutter-for/xamarin_devs/pubspec.yaml/0 | {
"file_path": "website/examples/get-started/flutter-for/xamarin_devs/pubspec.yaml",
"repo_id": "website",
"token_count": 167
} | 1,205 |
name: integration_test_migration
description: A new Flutter project.
publish_to: none
version: 1.0.0+1
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
example_utils:
path: ../example_utils
integration_test:
sdk: flutter
flutter_test:
sdk: flutter
flutter_dr... | website/examples/integration_test_migration/pubspec.yaml/0 | {
"file_path": "website/examples/integration_test_migration/pubspec.yaml",
"repo_id": "website",
"token_count": 180
} | 1,206 |
import 'package:flutter/material.dart';
import 'box.dart' deferred as box;
class SomeWidget extends StatefulWidget {
const SomeWidget({super.key});
@override
State<SomeWidget> createState() => _SomeWidgetState();
}
class _SomeWidgetState extends State<SomeWidget> {
late Future<void> _libraryFuture;
@overr... | website/examples/perf/deferred_components/lib/use_deferred_box.dart/0 | {
"file_path": "website/examples/perf/deferred_components/lib/use_deferred_box.dart",
"repo_id": "website",
"token_count": 317
} | 1,207 |
import 'dart:collection';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'common.dart';
CartModel somehowGetMyCartModel(BuildContext context) {
return Provider.of<CartModel>(context);
}
// #docregion model
class CartModel extends ChangeNotifier {
/// Internal, private sta... | website/examples/state_mgmt/simple/lib/src/provider.dart/0 | {
"file_path": "website/examples/state_mgmt/simple/lib/src/provider.dart",
"repo_id": "website",
"token_count": 1132
} | 1,208 |
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(
const MaterialApp(
home: AppHome(),
),
);
}
class AppHome extends StatelessWidget {
const AppHome({super.key});
@override
Widget build(BuildContext ... | website/examples/testing/code_debugging/lib/dump_semantic_tree.dart/0 | {
"file_path": "website/examples/testing/code_debugging/lib/dump_semantic_tree.dart",
"repo_id": "website",
"token_count": 391
} | 1,209 |
import 'package:flutter/material.dart';
class ErrorHandler {
Future<void> initialize() async {
// initialize error handler
}
void onError(Object error, Object stack) {
// do something when there's an error
}
void onErrorDetails(FlutterErrorDetails details) {
// do something with FlutterErrorDet... | website/examples/testing/errors/lib/error_handler.dart/0 | {
"file_path": "website/examples/testing/errors/lib/error_handler.dart",
"repo_id": "website",
"token_count": 111
} | 1,210 |
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
/// A text field that also has buttons to select all the text and copy the
/// selected text to the clipboard.
class CopyableTextField extends StatefulWidget {
const CopyableTextField({super.key, required this.title});
final String ti... | website/examples/ui/advanced/actions_and_shortcuts/lib/copyable_text.dart/0 | {
"file_path": "website/examples/ui/advanced/actions_and_shortcuts/lib/copyable_text.dart",
"repo_id": "website",
"token_count": 1931
} | 1,211 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.