text stringlengths 6 13.6M | id stringlengths 13 176 | metadata dict | __index_level_0__ int64 0 1.69k |
|---|---|---|---|
// 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 org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the dev... | samples/add_to_app/fullscreen/android_fullscreen/app/src/test/java/dev/flutter/example/androidfullscreen/ExampleUnitTest.kt/0 | {
"file_path": "samples/add_to_app/fullscreen/android_fullscreen/app/src/test/java/dev/flutter/example/androidfullscreen/ExampleUnitTest.kt",
"repo_id": "samples",
"token_count": 165
} | 1,286 |
package dev.flutter.multipleflutters
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.TextView
/**
* The activity that uses standard platform UI APIs.
*
* This doesn't talk directly to or render Flutter content and... | samples/add_to_app/multiple_flutters/multiple_flutters_android/app/src/main/java/dev/flutter/multipleflutters/MainActivity.kt/0 | {
"file_path": "samples/add_to_app/multiple_flutters/multiple_flutters_android/app/src/main/java/dev/flutter/multipleflutters/MainActivity.kt",
"repo_id": "samples",
"token_count": 679
} | 1,287 |
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:MultipleFluttersIos.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
| samples/add_to_app/multiple_flutters/multiple_flutters_ios/MultipleFluttersIos.xcworkspace/contents.xcworkspacedata/0 | {
"file_path": "samples/add_to_app/multiple_flutters/multiple_flutters_ios/MultipleFluttersIos.xcworkspace/contents.xcworkspacedata",
"repo_id": "samples",
"token_count": 107
} | 1,288 |
package dev.flutter.example.androidusingprebuiltmodule
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_is... | samples/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/test/java/dev/flutter/example/androidusingprebuiltmodule/ExampleUnitTest.kt/0 | {
"file_path": "samples/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/test/java/dev/flutter/example/androidusingprebuiltmodule/ExampleUnitTest.kt",
"repo_id": "samples",
"token_count": 125
} | 1,289 |
// 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:flutter/material.dart';
class AnimatedPositionedDemo extends StatefulWidget {
const AnimatedPositionedDemo({super.key}... | samples/animations/lib/src/misc/animated_positioned.dart/0 | {
"file_path": "samples/animations/lib/src/misc/animated_positioned.dart",
"repo_id": "samples",
"token_count": 1087
} | 1,290 |
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
| samples/code_sharing/client/android/gradle.properties/0 | {
"file_path": "samples/code_sharing/client/android/gradle.properties",
"repo_id": "samples",
"token_count": 31
} | 1,291 |
name: client
description: A Flutter app which communicates with a Dart backend using shared business logic.
publish_to: "none"
version: 1.0.0+1
environment:
sdk: ^3.2.0
dependencies:
cupertino_icons: ^1.0.2
flutter:
sdk: flutter
http: ^1.0.0
shared:
path: ../shared
dev_dependencies:
flutter_lints... | samples/code_sharing/client/pubspec.yaml/0 | {
"file_path": "samples/code_sharing/client/pubspec.yaml",
"repo_id": "samples",
"token_count": 163
} | 1,292 |
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idio... | samples/code_sharing/server/analysis_options.yaml/0 | {
"file_path": "samples/code_sharing/server/analysis_options.yaml",
"repo_id": "samples",
"token_count": 297
} | 1,293 |
# Custom Context Menus
This sample shows how to create and customize cross-platform context menus,
such as the text selection toolbar on mobile or the right click menu on desktop.
| ;
/// Shows and hides the context menu based on user gestures.
///
/// By default, shows the menu on right clicks and long presses.
class ContextMenuR... | samples/context_menus/lib/context_menu_region.dart/0 | {
"file_path": "samples/context_menus/lib/context_menu_region.dart",
"repo_id": "samples",
"token_count": 805
} | 1,295 |
import 'package:context_menus/global_selection_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('Gives correct behavior for all values of contextMenuBuilder'... | samples/context_menus/test/global_selection_page_test.dart/0 | {
"file_path": "samples/context_menus/test/global_selection_page_test.dart",
"repo_id": "samples",
"token_count": 574
} | 1,296 |
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
| samples/deeplink_store_example/android/gradle.properties/0 | {
"file_path": "samples/deeplink_store_example/android/gradle.properties",
"repo_id": "samples",
"token_count": 31
} | 1,297 |
#include "../../Flutter/Flutter-Release.xcconfig"
#include "Warnings.xcconfig"
| samples/deeplink_store_example/macos/Runner/Configs/Release.xcconfig/0 | {
"file_path": "samples/deeplink_store_example/macos/Runner/Configs/Release.xcconfig",
"repo_id": "samples",
"token_count": 32
} | 1,298 |
// 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:convert';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
import '../serializers.dart';
part 'cur... | samples/desktop_photo_search/fluent_ui/lib/src/unsplash/current_user_collections.dart/0 | {
"file_path": "samples/desktop_photo_search/fluent_ui/lib/src/unsplash/current_user_collections.dart",
"repo_id": "samples",
"token_count": 410
} | 1,299 |
// 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 'dart:convert';
import 'dart:typed_data';
import 'package:http/http.dart' as http;
import 'package:logging/logging.dart';
import... | samples/desktop_photo_search/fluent_ui/lib/src/unsplash/unsplash.dart/0 | {
"file_path": "samples/desktop_photo_search/fluent_ui/lib/src/unsplash/unsplash.dart",
"repo_id": "samples",
"token_count": 1244
} | 1,300 |
name: federated_plugin_macos
description: macOS implementation of federated_plugin to retrieve current battery level.
version: 0.0.1
homepage:
environment:
sdk: ^3.2.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
analysis_defaults:
path: ../../../analysis_defaults
flutter_test:
sdk: flut... | samples/experimental/federated_plugin/federated_plugin_macos/pubspec.yaml/0 | {
"file_path": "samples/experimental/federated_plugin/federated_plugin_macos/pubspec.yaml",
"repo_id": "samples",
"token_count": 157
} | 1,301 |
<!-- This file is necessary just to run the e2e tests on the browser -->
<!DOCTYPE HTML>
<html>
<head>
<title>Browser Tests</title>
</head>
<body>
<script src="main.dart.js"></script>
</body>
</html>
| samples/experimental/federated_plugin/federated_plugin_web/web/index.html/0 | {
"file_path": "samples/experimental/federated_plugin/federated_plugin_web/web/index.html",
"repo_id": "samples",
"token_count": 85
} | 1,302 |
// 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:adaptive_breakpoints/adaptive_breakpoints.dart';
import 'package:flutter/material.dart';
/// Returns a boolean value whether the window is co... | samples/experimental/linting_tool/lib/layout/adaptive.dart/0 | {
"file_path": "samples/experimental/linting_tool/lib/layout/adaptive.dart",
"repo_id": "samples",
"token_count": 237
} | 1,303 |
// 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:http/http.dart' as http;
import 'package:linting_tool/model/rule.dart';
import 'package:linting_tool/repository/api_provider.dart';
import 'pa... | samples/experimental/linting_tool/lib/repository/repository.dart/0 | {
"file_path": "samples/experimental/linting_tool/lib/repository/repository.dart",
"repo_id": "samples",
"token_count": 193
} | 1,304 |
rootProject.name = 'pedometer'
| samples/experimental/pedometer/android/settings.gradle/0 | {
"file_path": "samples/experimental/pedometer/android/settings.gradle",
"repo_id": "samples",
"token_count": 10
} | 1,305 |
#import "GeneratedPluginRegistrant.h"
| samples/experimental/pedometer/example/ios/Runner/Runner-Bridging-Header.h/0 | {
"file_path": "samples/experimental/pedometer/example/ios/Runner/Runner-Bridging-Header.h",
"repo_id": "samples",
"token_count": 13
} | 1,306 |
// Copyright (c) 2011, the Dart 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.
#ifndef RUNTIME_INCLUDE_DART_TOOLS_API_H_
#define RUNTIME_INCLUDE_DART_TOOLS_API_H_
#include "dart_api... | samples/experimental/pedometer/src/dart-sdk/include/dart_tools_api.h/0 | {
"file_path": "samples/experimental/pedometer/src/dart-sdk/include/dart_tools_api.h",
"repo_id": "samples",
"token_count": 5764
} | 1,307 |
#import "GeneratedPluginRegistrant.h"
| samples/experimental/varfont_shader_puzzle/ios/Runner/Runner-Bridging-Header.h/0 | {
"file_path": "samples/experimental/varfont_shader_puzzle/ios/Runner/Runner-Bridging-Header.h",
"repo_id": "samples",
"token_count": 13
} | 1,308 |
// 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.
export 'page_ascender_descender.dart';
export 'page_narrative_post.dart';
export 'page_narrative_pre.dart';
export 'page_optical_size.dart';
export 'page_weig... | samples/experimental/varfont_shader_puzzle/lib/page_content/pages.dart/0 | {
"file_path": "samples/experimental/varfont_shader_puzzle/lib/page_content/pages.dart",
"repo_id": "samples",
"token_count": 118
} | 1,309 |
// 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.
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'pa... | samples/experimental/web_dashboard/lib/src/app.dart/0 | {
"file_path": "samples/experimental/web_dashboard/lib/src/app.dart",
"repo_id": "samples",
"token_count": 1236
} | 1,310 |
name: web_dashboard
description: A dashboard app sample
version: 1.0.0+1
publish_to: none
environment:
sdk: ^3.2.0
dependencies:
cloud_firestore: ^4.15.6
collection: ^1.16.0
community_charts_flutter: ^1.0.2
cupertino_icons: ^1.0.0
firebase_auth: ^4.0.1
firebase_core: ^2.25.5
flutter:
sdk: flutter
... | samples/experimental/web_dashboard/pubspec.yaml/0 | {
"file_path": "samples/experimental/web_dashboard/pubspec.yaml",
"repo_id": "samples",
"token_count": 309
} | 1,311 |
org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true
android.enableJetifier=true
| samples/form_app/android/gradle.properties/0 | {
"file_path": "samples/form_app/android/gradle.properties",
"repo_id": "samples",
"token_count": 30
} | 1,312 |
// 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.
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
... | samples/form_app/lib/src/sign_in_http.dart/0 | {
"file_path": "samples/form_app/lib/src/sign_in_http.dart",
"repo_id": "samples",
"token_count": 1930
} | 1,313 |
Sounds in this folder are made by Filip Hracek and are CC0 (Public Domain).
| samples/game_template/assets/sfx/README.md/0 | {
"file_path": "samples/game_template/assets/sfx/README.md",
"repo_id": "samples",
"token_count": 20
} | 1,314 |
// 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.
/// Represents the state of an in-app purchase of ad removal such as
/// [AdRemovalPurchase.notStarted()]... | samples/game_template/lib/src/in_app_purchase/ad_removal.dart/0 | {
"file_path": "samples/game_template/lib/src/in_app_purchase/ad_removal.dart",
"repo_id": "samples",
"token_count": 408
} | 1,315 |
// 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:collection';
import 'dart:math';
import 'package:flutter/widgets.dart';
/// Shows a confet... | samples/game_template/lib/src/style/confetti.dart/0 | {
"file_path": "samples/game_template/lib/src/style/confetti.dart",
"repo_id": "samples",
"token_count": 2202
} | 1,316 |
// Copyright 2020 The Chromium 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:infinitelist/main.dart';
void main() {
testWi... | samples/infinite_list/test/smoke_test.dart/0 | {
"file_path": "samples/infinite_list/test/smoke_test.dart",
"repo_id": "samples",
"token_count": 455
} | 1,317 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>ios_app_clip</string>
<key>... | samples/ios_app_clip/ios/AppClip/Info.plist/0 | {
"file_path": "samples/ios_app_clip/ios/AppClip/Info.plist",
"repo_id": "samples",
"token_count": 729
} | 1,318 |
// 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';
class TypographyScreen extends StatelessWidget {
const TypographyScreen({super.key});
@override
Widget build(B... | samples/material_3_demo/lib/typography_screen.dart/0 | {
"file_path": "samples/material_3_demo/lib/typography_screen.dart",
"repo_id": "samples",
"token_count": 862
} | 1,319 |
#include "../../Flutter/Flutter-Release.xcconfig"
#include "Warnings.xcconfig"
| samples/material_3_demo/macos/Runner/Configs/Release.xcconfig/0 | {
"file_path": "samples/material_3_demo/macos/Runner/Configs/Release.xcconfig",
"repo_id": "samples",
"token_count": 32
} | 1,320 |
// 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 'package:adaptive_navigation/adaptive_navigation.dart';
import 'package:flutter/material.dart';
im... | samples/navigation_and_routing/lib/src/screens/scaffold.dart/0 | {
"file_path": "samples/navigation_and_routing/lib/src/screens/scaffold.dart",
"repo_id": "samples",
"token_count": 596
} | 1,321 |
package dev.flutter.place_tracker
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
| samples/place_tracker/android/app/src/main/kotlin/dev/flutter/place_tracker/MainActivity.kt/0 | {
"file_path": "samples/place_tracker/android/app/src/main/kotlin/dev/flutter/place_tracker/MainActivity.kt",
"repo_id": "samples",
"token_count": 40
} | 1,322 |
// 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:async';
import 'dart:math';
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_ro... | samples/place_tracker/lib/place_map.dart/0 | {
"file_path": "samples/place_tracker/lib/place_map.dart",
"repo_id": "samples",
"token_count": 7565
} | 1,323 |
#import "GeneratedPluginRegistrant.h"
| samples/platform_channels/ios/Runner/Runner-Bridging-Header.h/0 | {
"file_path": "samples/platform_channels/ios/Runner/Runner-Bridging-Header.h",
"repo_id": "samples",
"token_count": 13
} | 1,324 |
// 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:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:platform_chan... | samples/platform_channels/test/src/method_channel_demo_test.dart/0 | {
"file_path": "samples/platform_channels/test/src/method_channel_demo_test.dart",
"repo_id": "samples",
"token_count": 595
} | 1,325 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Platform Design</string>
<k... | samples/platform_design/ios/Runner/Info.plist/0 | {
"file_path": "samples/platform_design/ios/Runner/Info.plist",
"repo_id": "samples",
"token_count": 647
} | 1,326 |
name: provider_shopper
description: A shopping app sample that uses Provider for state management.
publish_to: none
version: 1.0.0+1
environment:
sdk: ^3.2.0
dependencies:
flutter:
sdk: flutter
go_router: ^13.0.0
provider: ^6.0.2
window_size:
git:
url: https://github.com/google/flutter-deskto... | samples/provider_shopper/pubspec.yaml/0 | {
"file_path": "samples/provider_shopper/pubspec.yaml",
"repo_id": "samples",
"token_count": 261
} | 1,327 |
# `simple_shader`
A simple [Flutter fragment shaders][] sample project.
[Flutter fragment shaders]: https://docs.flutter.dev/development/ui/advanced/shaders

| samples/simple_shader/README.md/0 | {
"file_path": "samples/simple_shader/README.md",
"repo_id": "samples",
"token_count": 70
} | 1,328 |
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
version:
revision: a14a4eac6132065fcbd853a2ff376e6911cdb2ea
channel: beta
project_type: app
# Tracks metadata for the flutter migrate command
... | samples/simplistic_calculator/.metadata/0 | {
"file_path": "samples/simplistic_calculator/.metadata",
"repo_id": "samples",
"token_count": 743
} | 1,329 |
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'basic_text_input_client.dart';
/// A basic text field. Defines the appearance of a basic text input client.
class BasicTextField extends StatefulWidget {
const BasicTextField({
super... | samples/simplistic_editor/lib/basic_text_field.dart/0 | {
"file_path": "samples/simplistic_editor/lib/basic_text_field.dart",
"repo_id": "samples",
"token_count": 2959
} | 1,330 |
#include "ephemeral/Flutter-Generated.xcconfig"
| samples/simplistic_editor/macos/Flutter/Flutter-Debug.xcconfig/0 | {
"file_path": "samples/simplistic_editor/macos/Flutter/Flutter-Debug.xcconfig",
"repo_id": "samples",
"token_count": 19
} | 1,331 |
// 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:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'pack... | samples/testing_app/integration_test/perf_test.dart/0 | {
"file_path": "samples/testing_app/integration_test/perf_test.dart",
"repo_id": "samples",
"token_count": 1401
} | 1,332 |
// 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 'package:flutter/cupertino.dart';
class FadeTransitionPage<T> extends Page<T> {
final Widget ch... | samples/veggieseasons/lib/widgets/fade_transition_page.dart/0 | {
"file_path": "samples/veggieseasons/lib/widgets/fade_transition_page.dart",
"repo_id": "samples",
"token_count": 534
} | 1,333 |
include: package:flutter_lints/flutter.yaml
linter:
rules:
| samples/web/_packages/web_startup_analyzer/example/analysis_options.yaml/0 | {
"file_path": "samples/web/_packages/web_startup_analyzer/example/analysis_options.yaml",
"repo_id": "samples",
"token_count": 24
} | 1,334 |
// 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.
// Helper class to capture Flutter web app startup timing information
class FlutterWebStartupAnalyzer {
timings;
constructor() {
this.timings... | samples/web/_packages/web_startup_analyzer/lib/web_startup_analyzer.js/0 | {
"file_path": "samples/web/_packages/web_startup_analyzer/lib/web_startup_analyzer.js",
"repo_id": "samples",
"token_count": 653
} | 1,335 |
// 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:checked_yaml/checked_yaml.dart';
import 'package:samples_index/browser.dart';
import 'package:samples_index/samples_index.da... | samples/web/samples_index/test/samples_index_test.dart/0 | {
"file_path": "samples/web/samples_index/test/samples_index_test.dart",
"repo_id": "samples",
"token_count": 2304
} | 1,336 |
// Manages toggling the VFX of the buttons
(function () {
"use strict";
let handheld;
let fxButtons = document.querySelector("#fx");
let flutterTarget = document.querySelector("#flutter_target");
let attribution = document.createElement("span");
attribution.className = "imageAttribution";
attribution.i... | samples/web_embedding/element_embedding_demo/web/js/demo-css-fx.js/0 | {
"file_path": "samples/web_embedding/element_embedding_demo/web/js/demo-css-fx.js",
"repo_id": "samples",
"token_count": 955
} | 1,337 |
/// Exposes useful functions to interop with JS from our Flutter app.
library;
export 'js_interop/counter_state_manager.dart';
export 'js_interop/helper.dart' show broadcastAppEvent;
export 'dart:js_interop' show createJSInteropWrapper;
| samples/web_embedding/ng-flutter/flutter/lib/src/js_interop.dart/0 | {
"file_path": "samples/web_embedding/ng-flutter/flutter/lib/src/js_interop.dart",
"repo_id": "samples",
"token_count": 77
} | 1,338 |
steps:
- name: gcr.io/cloud-builders/git
args: ['submodule', 'update', '--init', '--recursive']
- name: gcr.io/cloud-builders/docker
entrypoint: '/bin/bash'
args:
- '-c'
- |-
set -e
echo "Building the website using a makefile..."
make build BUILD_CONFIGS=_config.yml
... | website/cloud_build/stage.yaml/0 | {
"file_path": "website/cloud_build/stage.yaml",
"repo_id": "website",
"token_count": 434
} | 1,339 |
name: hero_animation
publish_to: none
description: Shows how to create a simple Hero transition.
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
example_utils:
path: ../../example_utils
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
... | website/examples/_animation/hero_animation/pubspec.yaml/0 | {
"file_path": "website/examples/_animation/hero_animation/pubspec.yaml",
"repo_id": "website",
"token_count": 132
} | 1,340 |
import 'package:flutter/material.dart';
void main() => runApp(const LogoApp());
class LogoApp extends StatefulWidget {
const LogoApp({super.key});
@override
State<LogoApp> createState() => _LogoAppState();
}
class _LogoAppState extends State<LogoApp> {
@override
Widget build(BuildContext context) {
re... | website/examples/animation/animate0/lib/main.dart/0 | {
"file_path": "website/examples/animation/animate0/lib/main.dart",
"repo_id": "website",
"token_count": 201
} | 1,341 |
// ignore_for_file: unused_field, prefer_final_fields
import 'package:flutter/material.dart';
// #docregion Starter
class AnimatedContainerApp extends StatefulWidget {
const AnimatedContainerApp({super.key});
@override
State<AnimatedContainerApp> createState() => _AnimatedContainerAppState();
}
class _Animated... | website/examples/cookbook/animation/animated_container/lib/starter.dart/0 | {
"file_path": "website/examples/cookbook/animation/animated_container/lib/starter.dart",
"repo_id": "website",
"token_count": 225
} | 1,342 |
name: physics_simulation
description: Sample code for cookbook.
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
example_utils:
path: ../../../example_utils
flutter:
uses-material-design: true
| website/examples/cookbook/animation/physics_simulation/pubspec.yaml/0 | {
"file_path": "website/examples/cookbook/animation/physics_simulation/pubspec.yaml",
"repo_id": "website",
"token_count": 90
} | 1,343 |
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(
const MaterialApp(
home: ExampleCupertinoDownloadButton(),
debugShowCheckedModeBanner: false,
),
);
}
@immutable
class ExampleCupertinoDownloadButton extends StatefulWidget {
const ExampleC... | website/examples/cookbook/effects/download_button/lib/main.dart/0 | {
"file_path": "website/examples/cookbook/effects/download_button/lib/main.dart",
"repo_id": "website",
"token_count": 4368
} | 1,344 |
import 'package:flutter/material.dart';
// #docregion ParallaxRecipe
class ParallaxRecipe extends StatelessWidget {
const ParallaxRecipe({super.key});
@override
Widget build(BuildContext context) {
return const SingleChildScrollView(
child: Column(
children: [],
),
);
}
}
// #enddo... | website/examples/cookbook/effects/parallax_scrolling/lib/excerpt1.dart/0 | {
"file_path": "website/examples/cookbook/effects/parallax_scrolling/lib/excerpt1.dart",
"repo_id": "website",
"token_count": 122
} | 1,345 |
// ignore_for_file: unused_catch_clause
import 'package:flutter/services.dart';
import 'package:games_services/games_services.dart';
void main() async {
// #docregion signIn
try {
await GamesServices.signIn();
} on PlatformException catch (e) {
// ... deal with failures ...
}
// #enddocregion signIn... | website/examples/cookbook/games/achievements_leaderboards/lib/various.dart/0 | {
"file_path": "website/examples/cookbook/games/achievements_leaderboards/lib/various.dart",
"repo_id": "website",
"token_count": 390
} | 1,346 |
name: dismissible
description: Sample code for dismissible cookbook recipe.
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
dev_dependencies:
example_utils:
path: ../../../example_utils
flutter:
uses-material-design: true
| website/examples/cookbook/gestures/dismissible/pubspec.yaml/0 | {
"file_path": "website/examples/cookbook/gestures/dismissible/pubspec.yaml",
"repo_id": "website",
"token_count": 91
} | 1,347 |
import 'package:flutter/material.dart';
class MyGif extends StatelessWidget {
const MyGif({super.key});
@override
Widget build(BuildContext context) {
// #docregion Gif
return Image.network(
'https://docs.flutter.dev/assets/images/dash/dash-fainting.gif');
// #enddocregion Gif
}
}
| website/examples/cookbook/images/network_image/lib/gif.dart/0 | {
"file_path": "website/examples/cookbook/images/network_image/lib/gif.dart",
"repo_id": "website",
"token_count": 118
} | 1,348 |
name: horizontal_list
description: Example for horizontal_list cookbook recipe
publish_to: none
version: 1.0.0+1
environment:
sdk: ^3.3.0
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.6
dev_dependencies:
example_utils:
path: ../../../example_utils
flutter_test:
sdk: flutter
flutt... | website/examples/cookbook/lists/horizontal_list/pubspec.yaml/0 | {
"file_path": "website/examples/cookbook/lists/horizontal_list/pubspec.yaml",
"repo_id": "website",
"token_count": 140
} | 1,349 |
import 'package:flutter/material.dart';
class MainScreen extends StatelessWidget {
const MainScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Main Screen'),
),
body: GestureDetector(
onTap: () {
... | website/examples/cookbook/navigation/hero_animations/lib/main_original.dart/0 | {
"file_path": "website/examples/cookbook/navigation/hero_animations/lib/main_original.dart",
"repo_id": "website",
"token_count": 438
} | 1,350 |
import 'package:flutter/material.dart';
// #docregion Todo
class Todo {
final String title;
final String description;
const Todo(this.title, this.description);
}
// #enddocregion Todo
void main() {
runApp(
MaterialApp(
title: 'Passing Data',
home: TodosScreen(
// #docregion Generate
... | website/examples/cookbook/navigation/passing_data/lib/main.dart/0 | {
"file_path": "website/examples/cookbook/navigation/passing_data/lib/main.dart",
"repo_id": "website",
"token_count": 950
} | 1,351 |
import 'package:flutter/material.dart';
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
// ignore_for_file: unused_local_variable
void main() async {
// #docregion openDatabase
// Avoid errors caused by flutter upgrade.
// Importing 'package:flutter/widgets.dart' is required.
WidgetsFl... | website/examples/cookbook/persistence/sqlite/lib/step3.dart/0 | {
"file_path": "website/examples/cookbook/persistence/sqlite/lib/step3.dart",
"repo_id": "website",
"token_count": 218
} | 1,352 |
import 'package:flutter/material.dart';
void main() {
runApp(MyApp(
items: List<String>.generate(10000, (i) => 'Item $i'),
));
}
class MyApp extends StatelessWidget {
final List<String> items;
const MyApp({super.key, required this.items});
@override
Widget build(BuildContext context) {
const tit... | website/examples/cookbook/testing/widget/scrolling/lib/main.dart/0 | {
"file_path": "website/examples/cookbook/testing/widget/scrolling/lib/main.dart",
"repo_id": "website",
"token_count": 532
} | 1,353 |
// #docregion Import
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
// #enddocregion Import
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
// #docregion MyHomePageS... | website/examples/development/platform_integration/lib/platform_channels.dart/0 | {
"file_path": "website/examples/development/platform_integration/lib/platform_channels.dart",
"repo_id": "website",
"token_count": 557
} | 1,354 |
# Take our settings from the example_utils analysis_options.yaml file.
# If necessary for a particular example, this file can also include
# overrides for individual lints.
include: package:example_utils/analysis.yaml
analyzer:
language:
strict-casts: false
| website/examples/get-started/flutter-for/android_devs/analysis_options.yaml/0 | {
"file_path": "website/examples/get-started/flutter-for/android_devs/analysis_options.yaml",
"repo_id": "website",
"token_count": 75
} | 1,355 |
import 'dart:developer' as developer;
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 Material... | website/examples/get-started/flutter-for/android_devs/lib/listview_builder.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/android_devs/lib/listview_builder.dart",
"repo_id": "website",
"token_count": 624
} | 1,356 |
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const SampleApp());
}
// #docregion ToggleWidget
class SampleApp extends StatelessWidget {
// This widget is the root of your application.
const SampleApp({super.key});
@override
Widget build(BuildContext ... | website/examples/get-started/flutter-for/ios_devs/lib/layout.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/ios_devs/lib/layout.dart",
"repo_id": "website",
"token_count": 1177
} | 1,357 |
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const CupertinoApp(
home: MyHomePage(),
);
}
}
class MyHo... | website/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart",
"repo_id": "website",
"token_count": 487
} | 1,358 |
// Dart
import 'dart:convert';
import 'package:http/http.dart' as http;
class Example {
Future<String> _getIPAddress() {
final url = Uri.https('httpbin.org', '/ip');
return http.get(url).then((response) {
final ip = jsonDecode(response.body)['origin'] as String;
return ip;
});
}
}
void ma... | website/examples/get-started/flutter-for/react_native_devs/lib/futures.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/react_native_devs/lib/futures.dart",
"repo_id": "website",
"token_count": 184
} | 1,359 |
import 'package:flutter/material.dart';
// #docregion Main
void main() {
runApp(const MyApp());
}
// #enddocregion Main
// #docregion MyApp
class MyApp extends StatelessWidget {
/// This widget is the root of your application.
const MyApp({super.key});
@override
Widget build(BuildContext context) {
ret... | website/examples/get-started/flutter-for/xamarin_devs/lib/main.dart/0 | {
"file_path": "website/examples/get-started/flutter-for/xamarin_devs/lib/main.dart",
"repo_id": "website",
"token_count": 173
} | 1,360 |
name: integration_test_example
publish_to: none
version: 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_driver:
sdk: flutter
test: ^1.24.9
f... | website/examples/integration_test/pubspec.yaml/0 | {
"file_path": "website/examples/integration_test/pubspec.yaml",
"repo_id": "website",
"token_count": 152
} | 1,361 |
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:intl/date_symbol_data_custom.dart' as date_symbol_data_custom;
import 'package:intl/date_symbols.dart' as intl;
import 'package:intl/... | website/examples/internationalization/add_language/lib/nn_intl.dart/0 | {
"file_path": "website/examples/internationalization/add_language/lib/nn_intl.dart",
"repo_id": "website",
"token_count": 6564
} | 1,362 |
// Basic Flutter widget test.
// Learn more at https://docs.flutter.dev/testing/overview#widget-tests.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:interactive/main.dart';
void main() {
testWidgets('Example app smoke test', (tester) async {
await teste... | website/examples/layout/lakes/interactive/test/widget_test.dart/0 | {
"file_path": "website/examples/layout/lakes/interactive/test/widget_test.dart",
"repo_id": "website",
"token_count": 335
} | 1,363 |
// Basic Flutter widget test.
// Learn more at https://docs.flutter.dev/testing/overview#widget-tests.
import 'package:flutter_test/flutter_test.dart';
import 'package:layout/main.dart';
void main() {
testWidgets('Example app smoke test', (tester) async {
await tester.pumpWidget(const MyApp());
expect(find.... | website/examples/layout/non_material/test/widget_test.dart/0 | {
"file_path": "website/examples/layout/non_material/test/widget_test.dart",
"repo_id": "website",
"token_count": 124
} | 1,364 |
import 'package:flutter/cupertino.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const CupertinoApp(
home: HomePage(),
);
}
}
// #docregion Weather
enum Weather {
rainy,
w... | website/examples/resources/dart_swift_concurrency/lib/async_weather.dart/0 | {
"file_path": "website/examples/resources/dart_swift_concurrency/lib/async_weather.dart",
"repo_id": "website",
"token_count": 667
} | 1,365 |
import 'package:flutter/material.dart';
class ProblemWidget extends StatelessWidget {
const ProblemWidget({super.key});
@override
// #docregion Problem
Widget build(BuildContext context) {
// Don't do this.
showDialog(
context: context,
builder: (context) {
return const Alert... | website/examples/testing/common_errors/lib/set_state_build.dart/0 | {
"file_path": "website/examples/testing/common_errors/lib/set_state_build.dart",
"repo_id": "website",
"token_count": 719
} | 1,366 |
import 'package:flextras/flextras.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../global/device_type.dart';
class FocusExamplesPage extends StatelessWidget {
const FocusExamplesPage({super.key});
@override
Widget build(BuildContext context) {
return Padding... | website/examples/ui/layout/adaptive_app_demos/lib/pages/focus_examples_page.dart/0 | {
"file_path": "website/examples/ui/layout/adaptive_app_demos/lib/pages/focus_examples_page.dart",
"repo_id": "website",
"token_count": 3120
} | 1,367 |
import 'package:flutter/material.dart';
void main() {
runApp(
const MaterialApp(
title: 'Flutter Tutorial',
home: TutorialHome(),
),
);
}
class TutorialHome extends StatelessWidget {
const TutorialHome({super.key});
@override
Widget build(BuildContext context) {
// Scaffold is a lay... | website/examples/ui/widgets_intro/lib/main_tutorial.dart/0 | {
"file_path": "website/examples/ui/widgets_intro/lib/main_tutorial.dart",
"repo_id": "website",
"token_count": 476
} | 1,368 |
{% for section in site.data.catalog.index %}
{% if section.name == include.category %}
{% assign category = section %}
{% break %}
{% endif %}
{% endfor %}
<div class="catalog">
<div class="category-description">
<p>{{category.description}}</p>
</div>
{% if category.subcateg... | website/src/_includes/docs/catalogpage.html/0 | {
"file_path": "website/src/_includes/docs/catalogpage.html",
"repo_id": "website",
"token_count": 1349
} | 1,369 |
<?code-excerpt "animation/implicit/opacity5/lib/main.dart"?>
```run-dartpad:theme-light:mode-flutter:split-60:width-100%:height-532px:ga_id-fade_in_complete
// Copyright 2019 the Dart project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE ... | website/src/_includes/docs/implicit-animations/fade-in-complete.md/0 | {
"file_path": "website/src/_includes/docs/implicit-animations/fade-in-complete.md",
"repo_id": "website",
"token_count": 727
} | 1,370 |
{% assign terminal=include.terminal %}
### Download then install Flutter
{:.no_toc}
{% assign os = include.os %}
{% assign osl = os | downcase | replace: "chromeos","linux" %}
{% assign target = include.target %}
{% case os %}
{% when 'Windows' -%}
{% assign unzip='Expand-Archive .\' %}
{% assign path='C:\user\... | website/src/_includes/docs/install/flutter/download.md/0 | {
"file_path": "website/src/_includes/docs/install/flutter/download.md",
"repo_id": "website",
"token_count": 1488
} | 1,371 |
{% assign terminal=include.terminal %}
### Remove Flutter from your macOS PATH
{:.no_toc}
To remove Flutter commands from {{terminal}},
remove Flutter to the `PATH` environment variable.
This guide presumes your [Mac runs the latest default shell][zsh-mac], `zsh`.
Zsh uses the `.zshenv` file for [environment variable... | website/src/_includes/docs/install/reqs/macos/unset-path.md/0 | {
"file_path": "website/src/_includes/docs/install/reqs/macos/unset-path.md",
"repo_id": "website",
"token_count": 307
} | 1,372 |
## Performance
Platform views in Flutter come with performance trade-offs.
For example, in a typical Flutter app, the Flutter UI is composed
on a dedicated raster thread. This allows Flutter apps to be fast,
as the main platform thread is rarely blocked.
While a platform view is rendered with hybrid composition,
the... | website/src/_includes/docs/platform-view-perf.md/0 | {
"file_path": "website/src/_includes/docs/platform-view-perf.md",
"repo_id": "website",
"token_count": 461
} | 1,373 |
<div class="snackbar {{ include.class }}">
<div class="snackbar__container">
<div class="snackbar__label">
{{ include.label }}
</div>
{% if include.action -%}
<button class="snackbar__action btn btn-link">{{ include.action }}</button>
{% endif -%}
</div>
</div>
| website/src/_includes/snackbar.html/0 | {
"file_path": "website/src/_includes/snackbar.html",
"repo_id": "website",
"token_count": 118
} | 1,374 |
module Jekyll
module Tags
# A block that preserves the indentation of its content.
#
# This is useful for use in markdown where indentation can be significant.
class Indent < Liquid::Block
# def initialize(tag_name, tag_arg_raw, liquid_parse_context) end
def render(liquid_context)
... | website/src/_plugins/indent.rb/0 | {
"file_path": "website/src/_plugins/indent.rb",
"repo_id": "website",
"token_count": 842
} | 1,375 |
@use '../vendor/bootstrap';
#cookie-notice {
background-color: white;
padding: 2.5rem 0;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
box-shadow: -1px 1px 4px rgba(0, 0, 0, 0.3);
opacity: 0;
display: none;
z-index: bootstrap.$zindex-popover;
@keyframes fadein {
0% { opacity: 0; }
... | website/src/_sass/components/_cookie-notice.scss/0 | {
"file_path": "website/src/_sass/components/_cookie-notice.scss",
"repo_id": "website",
"token_count": 387
} | 1,376 |
---
title: Add a Flutter screen to an Android app
short-title: Add a Flutter screen
description: >
Learn how to add a single Flutter screen to your existing Android app.
---
This guide describes how to add a single Flutter screen to an
existing Android app. A Flutter screen can be added as a normal,
opaque screen, o... | website/src/add-to-app/android/add-flutter-screen.md/0 | {
"file_path": "website/src/add-to-app/android/add-flutter-screen.md",
"repo_id": "website",
"token_count": 3841
} | 1,377 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="1.9999179in"
height="1.9999999in"
version="1.1"
viewBox="0 0 50.796725 50.798808"
id="svg11"
sodipodi:docname="windows-bug.svg"
inkscape:version="1.3.2 (091e20e, 2023-11-25)"
xmlns:inkscape="http://www.inkscape.org/namespaces/ink... | website/src/assets/images/docs/brand-svg/windows-bug.svg/0 | {
"file_path": "website/src/assets/images/docs/brand-svg/windows-bug.svg",
"repo_id": "website",
"token_count": 921
} | 1,378 |
---
title: Update the UI based on orientation
description: Respond to a change in the screen's orientation.
js:
- defer: true
url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js
---
<?code-excerpt path-base="cookbook/design/orientation"?>
In some situations,
you want to update the display of an app when... | website/src/cookbook/design/orientation.md/0 | {
"file_path": "website/src/cookbook/design/orientation.md",
"repo_id": "website",
"token_count": 1782
} | 1,379 |
---
title: Focus and text fields
description: How focus works with text fields.
js:
- defer: true
url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js
---
<?code-excerpt path-base="cookbook/forms/focus/"?>
When a text field is selected and accepting input,
it is said to have "focus."
Generally, users shi... | website/src/cookbook/forms/focus.md/0 | {
"file_path": "website/src/cookbook/forms/focus.md",
"repo_id": "website",
"token_count": 2230
} | 1,380 |
These image files are used by the embedded DartPads
in the effects cookbook. DartPad can't extract
images from the _assets/image directory.
| website/src/cookbook/img-files/README/0 | {
"file_path": "website/src/cookbook/img-files/README",
"repo_id": "website",
"token_count": 34
} | 1,381 |
---
title: Pass arguments to a named route
description: How to pass arguments to a named route.
js:
- defer: true
url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js
---
<?code-excerpt path-base="cookbook/navigation/navigate_with_arguments"?>
The [`Navigator`][] provides the ability to navigate
to a nam... | website/src/cookbook/navigation/navigate-with-arguments.md/0 | {
"file_path": "website/src/cookbook/navigation/navigate-with-arguments.md",
"repo_id": "website",
"token_count": 4544
} | 1,382 |
---
title: Read and write files
description: How to read from and write to files on disk.
---
<?code-excerpt path-base="cookbook/persistence/reading_writing_files/"?>
In some cases, you need to read and write files to disk.
For example, you might need to persist data across app launches,
or download data from the int... | website/src/cookbook/persistence/reading-writing-files.md/0 | {
"file_path": "website/src/cookbook/persistence/reading-writing-files.md",
"repo_id": "website",
"token_count": 2036
} | 1,383 |
---
title: Handle scrolling
description: How to handle scrolling in a widget test.
---
<?code-excerpt path-base="cookbook/testing/widget/scrolling/"?>
Many apps feature lists of content,
from email clients to music apps and beyond.
To verify that lists contain the expected content
using widget tests,
you need a way t... | website/src/cookbook/testing/widget/scrolling.md/0 | {
"file_path": "website/src/cookbook/testing/widget/scrolling.md",
"repo_id": "website",
"token_count": 1646
} | 1,384 |
---
title: Build and release an Android app
description: How to prepare for and release an Android app to the Play store.
short-title: Android
---
During a typical development cycle,
you test an app using `flutter run` at the command line,
or by using the **Run** and **Debug**
options in your IDE. By default,
Flutter ... | website/src/deployment/android.md/0 | {
"file_path": "website/src/deployment/android.md",
"repo_id": "website",
"token_count": 6429
} | 1,385 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.