text
stringlengths
6
13.6M
id
stringlengths
13
176
metadata
dict
__index_level_0__
int64
0
1.69k
import 'package:flutter/material.dart'; // #docregion step1 class Menu extends StatefulWidget { const Menu({super.key}); @override State<Menu> createState() => _MenuState(); } class _MenuState extends State<Menu> { static const _menuTitles = [ 'Declarative Style', 'Premade Widgets', 'Stateful Hot...
website/examples/cookbook/effects/staggered_menu_animation/lib/step1.dart/0
{ "file_path": "website/examples/cookbook/effects/staggered_menu_animation/lib/step1.dart", "repo_id": "website", "token_count": 1021 }
1,439
import 'package:flutter/material.dart'; // Define a custom Form widget. class MyCustomForm extends StatefulWidget { const MyCustomForm({super.key}); @override State<MyCustomForm> createState() => _MyCustomFormState(); } // Define a corresponding State class. // This class holds data related to the form. class ...
website/examples/cookbook/forms/focus/lib/step3.dart/0
{ "file_path": "website/examples/cookbook/forms/focus/lib/step3.dart", "repo_id": "website", "token_count": 660 }
1,440
import 'package:flutter/material.dart'; // Define a custom Form widget. class MyCustomForm extends StatefulWidget { const MyCustomForm({super.key}); @override MyCustomFormState createState() { return MyCustomFormState(); } } // Define a corresponding State class. // This class holds data related to the f...
website/examples/cookbook/forms/validation/lib/form.dart/0
{ "file_path": "website/examples/cookbook/forms/validation/lib/form.dart", "repo_id": "website", "token_count": 302 }
1,441
name: firestore_multiplayer description: Firestore multiplayer environment: sdk: ^3.3.0 dependencies: flutter: sdk: flutter async: ^2.11.0 cloud_firestore: ^4.15.4 firebase_core: ^2.25.4 logging: ^1.2.0 provider: ^6.1.1 dev_dependencies: example_utils: path: ../../../example_utils flutter: ...
website/examples/cookbook/games/firestore_multiplayer/pubspec.yaml/0
{ "file_path": "website/examples/cookbook/games/firestore_multiplayer/pubspec.yaml", "repo_id": "website", "token_count": 144 }
1,442
import 'package:flutter/cupertino.dart'; void main() { runApp(const CupertinoApp( title: 'Navigation Basics', home: FirstRoute(), )); } class FirstRoute extends StatelessWidget { const FirstRoute({super.key}); @override Widget build(BuildContext context) { return CupertinoPageScaffold( na...
website/examples/cookbook/navigation/navigation_basics/lib/main_cupertino.dart/0
{ "file_path": "website/examples/cookbook/navigation/navigation_basics/lib/main_cupertino.dart", "repo_id": "website", "token_count": 522 }
1,443
import 'dart:async'; import 'dart:io'; import 'package:flutter/material.dart'; import 'package:path_provider/path_provider.dart'; void main() { runApp( MaterialApp( title: 'Reading and Writing Files', home: FlutterDemo(storage: CounterStorage()), ), ); } class CounterStorage { // #docregion...
website/examples/cookbook/persistence/reading_writing_files/lib/main.dart/0
{ "file_path": "website/examples/cookbook/persistence/reading_writing_files/lib/main.dart", "repo_id": "website", "token_count": 869 }
1,444
name: picture_using_camera description: A new Flutter project. environment: sdk: ^3.3.0 dependencies: flutter: sdk: flutter camera: ^0.10.5+6 path_provider: ^2.1.2 path: ^1.9.0 dev_dependencies: example_utils: path: ../../../example_utils flutter: uses-material-design: true
website/examples/cookbook/plugins/picture_using_camera/pubspec.yaml/0
{ "file_path": "website/examples/cookbook/plugins/picture_using_camera/pubspec.yaml", "repo_id": "website", "token_count": 126 }
1,445
import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; // #docregion main void main() { testWidgets('MyWidget has a title and message', (tester) async { // Create the widget by telling the tester to build it. await tester.pumpWidget(const MyWidget(title: 'T', message: 'M'));...
website/examples/cookbook/testing/widget/introduction/test/main_step4_test.dart/0
{ "file_path": "website/examples/cookbook/testing/widget/introduction/test/main_step4_test.dart", "repo_id": "website", "token_count": 319 }
1,446
name: json description: Sample state management code. publish_to: none version: 1.0.0+1 environment: sdk: ^3.3.0 dependencies: json_annotation: ^4.8.1 dev_dependencies: example_utils: path: ../../../example_utils build_runner: ^2.4.8 json_serializable: ^6.7.1
website/examples/development/data-and-backend/json/pubspec.yaml/0
{ "file_path": "website/examples/development/data-and-backend/json/pubspec.yaml", "repo_id": "website", "token_count": 114 }
1,447
import 'package:flutter/material.dart'; // #docregion WelcomeScreen class WelcomeScreen extends StatelessWidget { const WelcomeScreen({super.key}); @override Widget build(BuildContext context) { return Scaffold( body: Center( child: Text( 'Welcome!', style: Theme.of(context...
website/examples/get-started/codelab_web/lib/step1.dart/0
{ "file_path": "website/examples/get-started/codelab_web/lib/step1.dart", "repo_id": "website", "token_count": 1543 }
1,448
import 'dart:async'; import 'dart:convert'; import 'dart:isolate'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; void main() { runApp(const SampleApp()); } class SampleApp extends StatelessWidget { const SampleApp({super.key}); @override Widget build(BuildContext context) ...
website/examples/get-started/flutter-for/android_devs/lib/isolates.dart/0
{ "file_path": "website/examples/get-started/flutter-for/android_devs/lib/isolates.dart", "repo_id": "website", "token_count": 1045 }
1,449
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( title: 'Sample App', t...
website/examples/get-started/flutter-for/android_devs/lib/validation_errors.dart/0
{ "file_path": "website/examples/get-started/flutter-for/android_devs/lib/validation_errors.dart", "repo_id": "website", "token_count": 806 }
1,450
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; void main() { runApp( const App(), ); } class App extends StatelessWidget { const App({ super.key, }); @override Widget build(BuildContext context) { return const CupertinoApp( home: HomePage(), ); } ...
website/examples/get-started/flutter-for/ios_devs/lib/grid.dart/0
{ "file_path": "website/examples/get-started/flutter-for/ios_devs/lib/grid.dart", "repo_id": "website", "token_count": 405 }
1,451
import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; void main() { runApp(const SampleApp()); } class SampleApp extends StatelessWidget { const SampleApp({super.key}); @override Widget build(BuildContext context) { return const MaterialApp( title:...
website/examples/get-started/flutter-for/ios_devs/lib/progress.dart/0
{ "file_path": "website/examples/get-started/flutter-for/ios_devs/lib/progress.dart", "repo_id": "website", "token_count": 665 }
1,452
import 'package:flutter/material.dart'; void main() { runApp(const Center(child: LogoFade())); } class LogoFade extends StatefulWidget { const LogoFade({super.key}); @override State<LogoFade> createState() => _LogoFadeState(); } class _LogoFadeState extends State<LogoFade> with SingleTickerProviderState...
website/examples/get-started/flutter-for/react_native_devs/lib/animation.dart/0
{ "file_path": "website/examples/get-started/flutter-for/react_native_devs/lib/animation.dart", "repo_id": "website", "token_count": 412 }
1,453
name: my_widgets description: A library for `react_native_devs` to import. version: 1.0.0 environment: sdk: ^3.3.0 dev_dependencies: example_utils: path: ../../../../example_utils
website/examples/get-started/flutter-for/react_native_devs/my_widgets/pubspec.yaml/0
{ "file_path": "website/examples/get-started/flutter-for/react_native_devs/my_widgets/pubspec.yaml", "repo_id": "website", "token_count": 81 }
1,454
import 'package:flutter/material.dart'; class RowExample extends StatelessWidget { const RowExample({super.key}); // #docregion Row @override Widget build(BuildContext context) { return const Row( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text('Row One'), ...
website/examples/get-started/flutter-for/xamarin_devs/lib/layouts.dart/0
{ "file_path": "website/examples/get-started/flutter-for/xamarin_devs/lib/layouts.dart", "repo_id": "website", "token_count": 1125 }
1,455
// Copyright 2019 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:async'; import 'dart:convert'; // #docregion authImport import 'package:extension_google_sign_in_as_googleapis_auth/extension_google_sign_in_...
website/examples/googleapis/lib/main.dart/0
{ "file_path": "website/examples/googleapis/lib/main.dart", "repo_id": "website", "token_count": 2298 }
1,456
import 'package:flutter_driver/flutter_driver.dart'; import 'package:test/test.dart'; void main() { group('end-to-end test', () { late FlutterDriver driver; setUpAll(() async { // Connect to a running Flutter application instance. driver = await FlutterDriver.connect(); }); tearDownAll(...
website/examples/integration_test_migration/test_driver/main_test.dart/0
{ "file_path": "website/examples/integration_test_migration/test_driver/main_test.dart", "repo_id": "website", "token_count": 827 }
1,457
{ "title": "Hola Mundo", "@title": { "description": "Title for the Demo application", "type": "text" } }
website/examples/internationalization/intl_example/lib/l10n/intl_es.arb/0
{ "file_path": "website/examples/internationalization/intl_example/lib/l10n/intl_es.arb", "repo_id": "website", "token_count": 48 }
1,458
import 'package:flutter/cupertino.dart'; void main() { runApp(const MyApp()); } // #docregion MyApp class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return const CupertinoApp( title: 'Flutter layout demo', theme: CupertinoThemeData...
website/examples/layout/base/lib/cupertino.dart/0
{ "file_path": "website/examples/layout/base/lib/cupertino.dart", "repo_id": "website", "token_count": 385 }
1,459
# Flutter example apps To analyze, test and run individual apps, execute the following commands from the repo root (`$PROJECT` represents the app project path, such as `examples/layout/lakes/step6`): 1. `flutter create --no-overwrite $PROJECT` 2. `cd $PROJECT` 3. `dart analyze` 4. `flutter test` 5. `flutter run` To ...
website/examples/layout/lakes/interactive/README.md/0
{ "file_path": "website/examples/layout/lakes/interactive/README.md", "repo_id": "website", "token_count": 159 }
1,460
name: state_mgmt description: Sample state management code. publish_to: none environment: sdk: ^3.3.0 dependencies: flutter: sdk: flutter provider: ^6.1.1 dev_dependencies: example_utils: path: ../../example_utils flutter_test: sdk: flutter test: ^1.24.9 flutter: uses-material-design: tru...
website/examples/state_mgmt/simple/pubspec.yaml/0
{ "file_path": "website/examples/state_mgmt/simple/pubspec.yaml", "repo_id": "website", "token_count": 131 }
1,461
import 'dart:developer'; void main() { Timeline.startSync('interesting function'); // iWonderHowLongThisTakes(); Timeline.finishSync(); }
website/examples/testing/code_debugging/lib/perf_trace.dart/0
{ "file_path": "website/examples/testing/code_debugging/lib/perf_trace.dart", "repo_id": "website", "token_count": 46 }
1,462
// ignore_for_file: directives_ordering import './error_handler.dart'; // #docregion Main import 'package:flutter/material.dart'; import 'dart:ui'; Future<void> main() async { await myErrorsHandler.initialize(); FlutterError.onError = (details) { FlutterError.presentError(details); myErrorsHandler.onError...
website/examples/testing/errors/lib/main.dart/0
{ "file_path": "website/examples/testing/errors/lib/main.dart", "repo_id": "website", "token_count": 381 }
1,463
name: actions_and_shortcuts description: Sample actions and shortcuts code. publish_to: none environment: sdk: ^3.3.0 dependencies: flutter: sdk: flutter dev_dependencies: example_utils: path: ../../../example_utils flutter: uses-material-design: true
website/examples/ui/advanced/actions_and_shortcuts/pubspec.yaml/0
{ "file_path": "website/examples/ui/advanced/actions_and_shortcuts/pubspec.yaml", "repo_id": "website", "token_count": 101 }
1,464
// ignore_for_file: prefer_const_constructors import 'package:bitsdojo_window/bitsdojo_window.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'app_model.dart'; import 'main_app_scaffold.dart'; void main() { runApp(const AppScaffold()); // Required when using bits_d...
website/examples/ui/layout/adaptive_app_demos/lib/main.dart/0
{ "file_path": "website/examples/ui/layout/adaptive_app_demos/lib/main.dart", "repo_id": "website", "token_count": 504 }
1,465
import 'package:flutter/material.dart'; class CounterDisplay extends StatelessWidget { const CounterDisplay({required this.count, super.key}); final int count; @override Widget build(BuildContext context) { return Text('Count: $count'); } } class CounterIncrementor extends StatelessWidget { const Co...
website/examples/ui/widgets_intro/lib/main_counterdisplay.dart/0
{ "file_path": "website/examples/ui/widgets_intro/lib/main_counterdisplay.dart", "repo_id": "website", "token_count": 482 }
1,466
lockfileVersion: '6.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false dependencies: bootstrap-scss: specifier: ^4.6.2 version: 4.6.2 diff2html-cli: specifier: ^5.2.15 version: 5.2.15 devDependencies: firebase-tools: specifier: ^13.4.1 version: 13.4.1 packages: ...
website/pnpm-lock.yaml/0
{ "file_path": "website/pnpm-lock.yaml", "repo_id": "website", "token_count": 91411 }
1,467
{{site.alert.tip}} Each render object in any tree includes the first five hexadecimal digits of its [`hashCode`][]. This hash serves as a unique identifier for that render object. {{site.alert.end}} [`hashCode`]: {{site.api}}/flutter/rendering/TextSelectionPoint/hashCode.html
website/src/_includes/docs/admonitions/tip-hashCode-tree.md/0
{ "file_path": "website/src/_includes/docs/admonitions/tip-hashCode-tree.md", "repo_id": "website", "token_count": 86 }
1,468
#### Build the macOS version of the Flutter app in the Terminal To generate the needed macOS platform dependencies, run the `flutter build` command. ```terminal flutter build macos --debug ``` ```terminal Building macOS application... ``` {% comment %} Nav tabs {% endcomment -%} <ul class="nav nav-tabs" id="vscode-...
website/src/_includes/docs/debug/debug-flow-macos.md/0
{ "file_path": "website/src/_includes/docs/debug/debug-flow-macos.md", "repo_id": "website", "token_count": 1188 }
1,469
#### Set up your target physical iOS device To deploy your Flutter app to a physical iPhone or iPad, you need to do the following: - Create an [Apple Developer][] account. - Set up physical device deployment in Xcode. - Create a development provisioning profile to self-sign certificates. - Install the third-party Coc...
website/src/_includes/docs/install/devices/ios-physical.md/0
{ "file_path": "website/src/_includes/docs/install/devices/ios-physical.md", "repo_id": "website", "token_count": 2663 }
1,470
Some Flutter components require the [Rosetta 2 translation process][need-rosetta] on Macs running [Apple silicon][]. To run all Flutter components on Apple silicon, install [Rosetta 2][rosetta]. ```terminal $ sudo softwareupdate --install-rosetta --agree-to-license ``` [Apple silicon]: https://support.apple.com/en-u...
website/src/_includes/docs/install/reqs/macos/apple-silicon.md/0
{ "file_path": "website/src/_includes/docs/install/reqs/macos/apple-silicon.md", "repo_id": "website", "token_count": 153 }
1,471
<div class="tab-pane" id="terminal" role="tabpanel" aria-labelledby="terminal-tab" markdown="1"> ### Create your sample Flutter app {#create-app} To create a new Flutter app, run the following commands in your shell or Terminal. 1. Run the `flutter create` command. ```terminal flutter create test_drive ```...
website/src/_includes/docs/install/test-drive/terminal.md/0
{ "file_path": "website/src/_includes/docs/install/test-drive/terminal.md", "repo_id": "website", "token_count": 347 }
1,472
{% comment %} Include parameters: - toc_content: The HTML toc content - class: CSS classes to add to toc element. - header: header text, default 'Contents' If you don't want the back-to-top button style `site-toc__back-to-top` as `display: none`. {% endcomment -%} {% assign toc = include.toc_content -%} {...
website/src/_includes/side-toc.html/0
{ "file_path": "website/src/_includes/side-toc.html", "repo_id": "website", "token_count": 511 }
1,473
# Copyright (c) 2019, 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. require 'liquid/tag/parser' # https://github.com/envygeeks/liquid-tag-parser require_relative 'prettify_co...
website/src/_plugins/code_excerpt.rb/0
{ "file_path": "website/src/_plugins/code_excerpt.rb", "repo_id": "website", "token_count": 696 }
1,474
// THIS IS DOCS ONLY #animation_1_play_button_ { position: absolute; width: 464px; height: 192px; z-index: 100000; background-position: center center; background-repeat: no-repeat; display: block; background-image: url("/assets/images/docs/play_button.svg"); }
website/src/_sass/components/_animations.scss/0
{ "file_path": "website/src/_sass/components/_animations.scss", "repo_id": "website", "token_count": 98 }
1,475
// -- Vars/config @use 'base/variables'; @use 'base/material-colors'; // -- Vendor @use 'vendor/bootstrap'; @use 'vendor/prettify'; // -- Base @use 'base/base'; // -- Components // (alpha ordered) @use 'components/animations'; @use 'components/banner'; @use 'components/books'; @use 'components/code'; @use 'component...
website/src/_sass/site.scss/0
{ "file_path": "website/src/_sass/site.scss", "repo_id": "website", "token_count": 269 }
1,476
--- title: Load sequence, performance, and memory description: What are the steps involved when showing a Flutter UI. --- This page describes the breakdown of the steps involved to show a Flutter UI. Knowing this, you can make better, more informed decisions about when to pre-warm the Flutter engine, which operations ...
website/src/add-to-app/performance.md/0
{ "file_path": "website/src/add-to-app/performance.md", "repo_id": "website", "token_count": 2802 }
1,477
const animation1PlayButton = document.getElementById('animation_1_play_button_'); const animation1 = document.getElementById("animation_1"); if (animation1PlayButton && animation1) { animation1PlayButton.addEventListener('click', function (_) { if (animation1.paused) { animation1.play(); this...
website/src/assets/js/codelabs/animations_examples.js/0
{ "file_path": "website/src/assets/js/codelabs/animations_examples.js", "repo_id": "website", "token_count": 261 }
1,478
--- title: Animate a page route transition description: How to animate from one page to another. js: - defer: true url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js --- <?code-excerpt path-base="cookbook/animation/page_route_animation/"?> A design language, such as Material, defines standard behaviors...
website/src/cookbook/animation/page-route-animation.md/0
{ "file_path": "website/src/cookbook/animation/page-route-animation.md", "repo_id": "website", "token_count": 3057 }
1,479
--- title: Create a scrolling parallax effect description: How to implement a scrolling parallax effect. js: - defer: true url: https://old-dartpad-3ce3f.web.app/inject_embed.dart.js --- <?code-excerpt path-base="cookbook/effects/parallax_scrolling"?> When you scroll a list of cards (containing images, for exam...
website/src/cookbook/effects/parallax-scrolling.md/0
{ "file_path": "website/src/cookbook/effects/parallax-scrolling.md", "repo_id": "website", "token_count": 9729 }
1,480
--- title: Gestures description: A catalog of Flutter recipes for supporting gestures. --- {% include docs/cookbook-group-index.md %}
website/src/cookbook/gestures/index.md/0
{ "file_path": "website/src/cookbook/gestures/index.md", "repo_id": "website", "token_count": 39 }
1,481
--- title: Report errors to a service description: How to keep track of errors that users encounter. --- <?code-excerpt path-base="cookbook/maintenance/error_reporting/"?> While one always tries to create apps that are free of bugs, they're sure to crop up from time to time. Since buggy apps lead to unhappy users and...
website/src/cookbook/maintenance/error-reporting.md/0
{ "file_path": "website/src/cookbook/maintenance/error-reporting.md", "repo_id": "website", "token_count": 1184 }
1,482
--- title: Send data to the internet description: How to use the http package to send data over the internet. --- <?code-excerpt path-base="cookbook/networking/send_data/"?> Sending data to the internet is necessary for most apps. The `http` package has got that covered, too. This recipe uses the following steps: ...
website/src/cookbook/networking/send-data.md/0
{ "file_path": "website/src/cookbook/networking/send-data.md", "repo_id": "website", "token_count": 3934 }
1,483
--- title: An introduction to unit testing description: How to write unit tests. short-title: Introduction --- <?code-excerpt path-base="cookbook/testing/unit/counter_app"?> How can you ensure that your app continues to work as you add more features or change existing functionality? By writing tests. Unit tests are ...
website/src/cookbook/testing/unit/introduction.md/0
{ "file_path": "website/src/cookbook/testing/unit/introduction.md", "repo_id": "website", "token_count": 1654 }
1,484
--- title: Differentiate between ephemeral state and app state description: How to tell the difference between ephemeral and app state. prev: title: Start thinking declaratively path: /development/data-and-backend/state-mgmt/declarative next: title: Simple app state management path: /development/data-and-backen...
website/src/data-and-backend/state-mgmt/ephemeral-vs-app.md/0
{ "file_path": "website/src/data-and-backend/state-mgmt/ephemeral-vs-app.md", "repo_id": "website", "token_count": 1591 }
1,485
{ "_comments": [ "uniqueId must be updated with each new survey so DevTools knows to re-prompt users.", "title should not exceed 45 characters.", "startDate and endDate should follow ISO 8601 standard with a timezone offset." ], "uniqueId": "2023-Q4", "title": "Take our survey to help us improve Dev...
website/src/f/dart-devtools-survey-metadata.json/0
{ "file_path": "website/src/f/dart-devtools-survey-metadata.json", "repo_id": "website", "token_count": 187 }
1,486
--- title: Local caching description: Learn how to persist data locally. prev: title: Networking and data next: title: JSON serialization --- Now that you've learned about how to load data from servers over the network, your Flutter app should feel more alive. However, just because you *can* load data from remot...
website/src/get-started/fwe/local-caching.md/0
{ "file_path": "website/src/get-started/fwe/local-caching.md", "repo_id": "website", "token_count": 2473 }
1,487
### Update your path You can update your PATH variable for the current session at the command line, as shown in step 3 of [Get the Flutter SDK][]. To update this variable permanently so you can run `flutter` commands in _any_ terminal session, use the following instructions. The steps for modifying the `PATH` variabl...
website/src/get-started/install/_deprecated/_path-mac.md/0
{ "file_path": "website/src/get-started/install/_deprecated/_path-mac.md", "repo_id": "website", "token_count": 501 }
1,488
--- title: Start building Flutter web apps on macOS description: Configure your system to develop Flutter web apps on macOS. short-title: Make web apps target: web config: macOSWeb devos: macOS next: title: Create a test app path: /get-started/test-drive --- {% include docs/install/reqs/macos/base.md os=page.de...
website/src/get-started/install/macos/web.md/0
{ "file_path": "website/src/get-started/install/macos/web.md", "repo_id": "website", "token_count": 257 }
1,489
--- title: Measuring your app's size description: How to measure app size for iOS and Android. --- Many developers are concerned with the size of their compiled app. As the APK, app bundle, or IPA version of a Flutter app is self-contained and holds all the code and assets needed to run the app, its size can be a conc...
website/src/perf/app-size.md/0
{ "file_path": "website/src/perf/app-size.md", "repo_id": "website", "token_count": 2131 }
1,490
--- title: Add Android devtools for Flutter description: Configure your system to develop Flutter for Android. short-title: Add Android DevTools target-list: [Windows, 'Web on Windows', Linux, 'Web on Linux', macOS, 'Web on macOS', iOS, Web on ChromeOS] --- To choose the guide to add Android Studio to your Flutter con...
website/src/platform-integration/android/install-android/index.md/0
{ "file_path": "website/src/platform-integration/android/install-android/index.md", "repo_id": "website", "token_count": 1010 }
1,491
--- title: "Binding to native iOS code using dart:ffi" description: "To use C code in your Flutter program, use the dart:ffi library." --- <?code-excerpt path-base="development/platform_integration"?> Flutter mobile and desktop apps can use the [dart:ffi][] library to call native C APIs. _FFI_ stands for [_foreign fu...
website/src/platform-integration/ios/c-interop.md/0
{ "file_path": "website/src/platform-integration/ios/c-interop.md", "repo_id": "website", "token_count": 2052 }
1,492
--- title: Building macOS apps with Flutter description: Platform-specific considerations for building for macOS with Flutter. toc: true short-title: macOS development --- This page discusses considerations unique to building macOS apps with Flutter, including shell integration and distribution of macOS apps through t...
website/src/platform-integration/macos/building.md/0
{ "file_path": "website/src/platform-integration/macos/building.md", "repo_id": "website", "token_count": 1706 }
1,493
--- title: Add Web devtools to Flutter from Android on macOS start description: Configure your system to develop Flutter web apps on macOS. short-title: Starting from Android on macOS --- To add Web as a Flutter app target for macOS with Android, follow this procedure. ## Configure Chrome as the web DevTools tools {...
website/src/platform-integration/web/install-web/install-web-from-android-on-macos.md/0
{ "file_path": "website/src/platform-integration/web/install-web/install-web-from-android-on-macos.md", "repo_id": "website", "token_count": 147 }
1,494
--- title: "flutter: The Flutter command-line tool" description: "The reference page for using 'flutter' in a terminal window." --- The `flutter` command-line tool is how developers (or IDEs on behalf of developers) interact with Flutter. For Dart related commands, you can use the [`dart`][] command-line tool. Here's...
website/src/reference/flutter-cli.md/0
{ "file_path": "website/src/reference/flutter-cli.md", "repo_id": "website", "token_count": 1282 }
1,495
--- title: Deprecated API removed after v3.3 description: > After reaching end of life, the following deprecated APIs were removed from Flutter. --- ## Summary In accordance with Flutter's [Deprecation Policy][], deprecated APIs that reached end of life after the 3.3 stable release have been removed. All affecte...
website/src/release/breaking-changes/3-3-deprecations.md/0
{ "file_path": "website/src/release/breaking-changes/3-3-deprecations.md", "repo_id": "website", "token_count": 2520 }
1,496
--- title: At least one clipboard data variant must be provided description: > In preparation for supporting multiple clipboard data variants, at least one clipboard data variant must be provided. --- ## Summary The [`ClipboardData constructor`][]'s `text` argument is no longer nullable. Code that provides `null`...
website/src/release/breaking-changes/clipboard-data-required.md/0
{ "file_path": "website/src/release/breaking-changes/clipboard-data-required.md", "repo_id": "website", "token_count": 520 }
1,497
--- title: Migrating from flutter_driver description: > Learn how to migrate existing flutter_driver tests to integration_test. --- <?code-excerpt path-base="integration_test_migration/"?> This page describes how to migrate an existing project using `flutter_driver` to the `integration_test` package, in order to ru...
website/src/release/breaking-changes/flutter-driver-migration.md/0
{ "file_path": "website/src/release/breaking-changes/flutter-driver-migration.md", "repo_id": "website", "token_count": 2557 }
1,498
--- title: Required Kotlin version description: > Flutter apps built for the Android platform require Kotlin 1.5.31 or greater. --- ## Summary To build a Flutter app for Android, Kotlin 1.5.31 or greater is required. If your app uses a lower version, you will receive the following error message: ```nocode ...
website/src/release/breaking-changes/kotlin-version.md/0
{ "file_path": "website/src/release/breaking-changes/kotlin-version.md", "repo_id": "website", "token_count": 775 }
1,499
--- title: Page transitions replaced by ZoomPageTransitionsBuilder description: Using the latest page transition instead of the old one. --- ## Summary In order to ensure that libraries follow the latest OEM behavior, the default page transition builders now use `ZoomPageTransitionsBuilder` on all platforms (excludin...
website/src/release/breaking-changes/page-transition-replaced-by-ZoomPageTransitionBuilder.md/0
{ "file_path": "website/src/release/breaking-changes/page-transition-replaced-by-ZoomPageTransitionBuilder.md", "repo_id": "website", "token_count": 1395 }
1,500
--- title: Scribble Text Input Client description: > Add new methods to the TextInputClient interface to allow Scribble to insert or remove text placeholders and show the toolbar. --- ## Summary Adds three methods, `showToolbar`, `insertTextPlaceholder`, and `removeTextPlaceholder` to the `TextInputClient` interf...
website/src/release/breaking-changes/scribble-text-input-client.md/0
{ "file_path": "website/src/release/breaking-changes/scribble-text-input-client.md", "repo_id": "website", "token_count": 780 }
1,501
--- title: Accessibility traversal order of tooltip changed description: >- The Tooltip widget's message now immediately follows the Tooltip widget's child during accessibility traversal. --- ## Summary During accessibility focus traversal, `Tooltip.message` is visited immediately after `Tooltip.child`. ## Back...
website/src/release/breaking-changes/tooltip-semantics-order.md/0
{ "file_path": "website/src/release/breaking-changes/tooltip-semantics-order.md", "repo_id": "website", "token_count": 1381 }
1,502
--- title: Change log for Flutter 1.7.8 short-title: 1.7.8 change log description: Change log for Flutter 1.7.8 containing a list of all PRs merged for this release. --- ## PRs closed in this release of flutter/flutter From Wed May 1 16:56:00 2019 -0700 to Thu Jul 18 08:04:00 2019 -0700 [28808](https://github.com...
website/src/release/release-notes/changelogs/changelog-1.7.8.md/0
{ "file_path": "website/src/release/release-notes/changelogs/changelog-1.7.8.md", "repo_id": "website", "token_count": 55839 }
1,503
--- title: Flutter 2.8.0 release notes short-title: 2.8.0 release notes description: Release notes for Flutter 2.8.0. --- This page has release notes for 2.8.0. For information about subsequent bug-fix releases, see [Hotfixes to the Stable Channel][]. [Hotfixes to the Stable Channel]: https://github.com/flutter/flutte...
website/src/release/release-notes/release-notes-2.8.0.md/0
{ "file_path": "website/src/release/release-notes/release-notes-2.8.0.md", "repo_id": "website", "token_count": 379392 }
1,504
--- title: Create useful bug reports description: > Where to file bug reports and enhancement requests for flutter and the website. --- The instructions in this document detail the current steps required to provide the most actionable bug reports for crashes and other bad behavior. Each step is optional but will ...
website/src/resources/bug-reports.md/0
{ "file_path": "website/src/resources/bug-reports.md", "repo_id": "website", "token_count": 1253 }
1,505
--- title: Handling errors in Flutter description: How to control error messages and logging of errors --- <?code-excerpt path-base="testing/errors"?> The Flutter framework catches errors that occur during callbacks triggered by the framework itself, including errors encountered during the build, layout, and paint ph...
website/src/testing/errors.md/0
{ "file_path": "website/src/testing/errors.md", "repo_id": "website", "token_count": 1973 }
1,506
--- title: Using the Logging view description: Learn how to use the DevTools logging view. --- {{site.alert.note}} The logging view works with all Flutter and Dart applications. {{site.alert.end}} ## What is it? The logging view displays events from the Dart runtime, application frameworks (like Flutter), and appl...
website/src/tools/devtools/logging.md/0
{ "file_path": "website/src/tools/devtools/logging.md", "repo_id": "website", "token_count": 404 }
1,507
--- title: DevTools release notes description: Learn about the latest changes in Dart and Flutter DevTools. toc: false --- This page summarizes the changes in official stable releases of DevTools. To view a complete list of changes, check out the [DevTools git log]({{site.repo.organization}}/devtools/commits/master). ...
website/src/tools/devtools/release-notes/index.md/0
{ "file_path": "website/src/tools/devtools/release-notes/index.md", "repo_id": "website", "token_count": 264 }
1,508
--- short-title: 2.16.0 release notes description: Release notes for Dart and Flutter DevTools version 2.16.0. toc: false --- {% include_relative release-notes-2.16.0-src.md %}
website/src/tools/devtools/release-notes/release-notes-2.16.0.md/0
{ "file_path": "website/src/tools/devtools/release-notes/release-notes-2.16.0.md", "repo_id": "website", "token_count": 61 }
1,509
--- short-title: 2.24.0 release notes description: Release notes for Dart and Flutter DevTools version 2.24.0. toc: false --- {% include_relative release-notes-2.24.0-src.md %}
website/src/tools/devtools/release-notes/release-notes-2.24.0.md/0
{ "file_path": "website/src/tools/devtools/release-notes/release-notes-2.24.0.md", "repo_id": "website", "token_count": 61 }
1,510
--- short-title: 2.28.5 release notes description: Release notes for Dart and Flutter DevTools version 2.28.5. toc: false --- {% include_relative release-notes-2.28.5-src.md %}
website/src/tools/devtools/release-notes/release-notes-2.28.5.md/0
{ "file_path": "website/src/tools/devtools/release-notes/release-notes-2.28.5.md", "repo_id": "website", "token_count": 61 }
1,511
--- short-title: 2.9.1 release notes description: Release notes for Dart and Flutter DevTools version 2.9.1. toc: false --- {% include_relative release-notes-2.9.1-src.md %}
website/src/tools/devtools/release-notes/release-notes-2.9.1.md/0
{ "file_path": "website/src/tools/devtools/release-notes/release-notes-2.9.1.md", "repo_id": "website", "token_count": 61 }
1,512
--- title: Hero animations description: How to animate a widget to fly between two screens. short-title: Hero --- {{site.alert.secondary}} <h4>What you'll learn</h4> * The _hero_ refers to the widget that flies between screens. * Create a hero animation using Flutter's Hero widget. * Fly the hero from one screen to...
website/src/ui/animations/hero-animations.md/0
{ "file_path": "website/src/ui/animations/hero-animations.md", "repo_id": "website", "token_count": 7276 }
1,513
--- title: Understanding Flutter's keyboard focus system description: How to use the focus system in your Flutter app. --- This article explains how to control where keyboard input is directed. If you are implementing an application that uses a physical keyboard, such as most desktop and web applications, this page is...
website/src/ui/interactivity/focus.md/0
{ "file_path": "website/src/ui/interactivity/focus.md", "repo_id": "website", "token_count": 7324 }
1,514
--- title: Configuring the URL strategy on the web description: Use hash or path URL strategies on the web --- Flutter web apps support two ways of configuring URL-based navigation on the web: **Hash (default)** : Paths are read and written to the [hash fragment][]. For example, `flutterexample.dev/#/path/to/screen`....
website/src/ui/navigation/url-strategies.md/0
{ "file_path": "website/src/ui/navigation/url-strategies.md", "repo_id": "website", "token_count": 751 }
1,515
--- title: Text widgets short-title: Text description: A catalog of Flutter's widgets for displaying and styling text. --- {% include docs/catalogpage.html category="Text" %}
website/src/ui/widgets/text.md/0
{ "file_path": "website/src/ui/widgets/text.md", "repo_id": "website", "token_count": 49 }
1,516
# Contributing _See also: [Flutter's code of conduct](https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md)_ Want to contribute to the Flutter codelabs ecosystem? Great! First, read this page (including the small print at the end). ## Is this the right place for your contribution? This repo is used by ...
codelabs/CONTRIBUTING.md/0
{ "file_path": "codelabs/CONTRIBUTING.md", "repo_id": "codelabs", "token_count": 573 }
0
#include "../../Flutter/Flutter-Release.xcconfig" #include "Warnings.xcconfig"
codelabs/adaptive_app/step_03/macos/Runner/Configs/Release.xcconfig/0
{ "file_path": "codelabs/adaptive_app/step_03/macos/Runner/Configs/Release.xcconfig", "repo_id": "codelabs", "token_count": 32 }
1
// Copyright 2022 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:flex_color_scheme/flex_color_scheme.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.d...
codelabs/adaptive_app/step_04/lib/main.dart/0
{ "file_path": "codelabs/adaptive_app/step_04/lib/main.dart", "repo_id": "codelabs", "token_count": 912 }
2
package com.example.adaptive_app import io.flutter.embedding.android.FlutterActivity class MainActivity: FlutterActivity()
codelabs/adaptive_app/step_06/android/app/src/main/kotlin/com/example/adaptive_app/MainActivity.kt/0
{ "file_path": "codelabs/adaptive_app/step_06/android/app/src/main/kotlin/com/example/adaptive_app/MainActivity.kt", "repo_id": "codelabs", "token_count": 36 }
3
// // Generated file. Do not edit. // // clang-format off #include "generated_plugin_registrant.h" #include <url_launcher_windows/url_launcher_windows.h> void RegisterPlugins(flutter::PluginRegistry* registry) { UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows"))...
codelabs/adaptive_app/step_06/windows/flutter/generated_plugin_registrant.cc/0
{ "file_path": "codelabs/adaptive_app/step_06/windows/flutter/generated_plugin_registrant.cc", "repo_id": "codelabs", "token_count": 112 }
4
// Copyright 2022 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:async'; import 'dart:io'; import 'package:http/http.dart' as http; import 'package:shelf/shelf.dart'; import 'package:shelf/shelf_io.dart'; i...
codelabs/adaptive_app/step_07/yt_cors_proxy/bin/server.dart/0
{ "file_path": "codelabs/adaptive_app/step_07/yt_cors_proxy/bin/server.dart", "repo_id": "codelabs", "token_count": 406 }
5
#include "../../Flutter/Flutter-Release.xcconfig" #include "Warnings.xcconfig"
codelabs/animated-responsive-layout/step_03/macos/Runner/Configs/Release.xcconfig/0
{ "file_path": "codelabs/animated-responsive-layout/step_03/macos/Runner/Configs/Release.xcconfig", "repo_id": "codelabs", "token_count": 32 }
6
include: ../../analysis_options.yaml
codelabs/animated-responsive-layout/step_05/analysis_options.yaml/0
{ "file_path": "codelabs/animated-responsive-layout/step_05/analysis_options.yaml", "repo_id": "codelabs", "token_count": 12 }
7
// Copyright 2022 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'; class Destination { const Destination(this.icon, this.label); final IconData icon; final String label; } co...
codelabs/animated-responsive-layout/step_06/lib/destinations.dart/0
{ "file_path": "codelabs/animated-responsive-layout/step_06/lib/destinations.dart", "repo_id": "codelabs", "token_count": 171 }
8
import 'package:animated_responsive_layout/main.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('Build app and trigger a frame', (tester) async { await tester.pumpWidget(const MainApp()); }); }
codelabs/animated-responsive-layout/step_06/test/widget_test.dart/0
{ "file_path": "codelabs/animated-responsive-layout/step_06/test/widget_test.dart", "repo_id": "codelabs", "token_count": 82 }
9
org.gradle.jvmargs=-Xmx4G android.useAndroidX=true android.enableJetifier=true
codelabs/animated-responsive-layout/step_08/android/gradle.properties/0
{ "file_path": "codelabs/animated-responsive-layout/step_08/android/gradle.properties", "repo_id": "codelabs", "token_count": 30 }
10
#import "GeneratedPluginRegistrant.h"
codelabs/animated-responsive-layout/step_08/ios/Runner/Runner-Bridging-Header.h/0
{ "file_path": "codelabs/animated-responsive-layout/step_08/ios/Runner/Runner-Bridging-Header.h", "repo_id": "codelabs", "token_count": 13 }
11
// Copyright 2022 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 '../models/models.dart'; class SearchBar extends StatelessWidget { const SearchBar({ super.key, ...
codelabs/animated-responsive-layout/step_08/lib/widgets/search_bar.dart/0
{ "file_path": "codelabs/animated-responsive-layout/step_08/lib/widgets/search_bar.dart", "repo_id": "codelabs", "token_count": 661 }
12
#include "../../Flutter/Flutter-Release.xcconfig" #include "Warnings.xcconfig"
codelabs/animated-responsive-layout/step_08/macos/Runner/Configs/Release.xcconfig/0
{ "file_path": "codelabs/animated-responsive-layout/step_08/macos/Runner/Configs/Release.xcconfig", "repo_id": "codelabs", "token_count": 32 }
13
// Copyright 2022 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 '../../../shared/classes/classes.dart'; import '../../../shared/extensions.dart'; class ArtistBio extends ...
codelabs/boring_to_beautiful/final/lib/src/features/artists/view/artist_bio.dart/0
{ "file_path": "codelabs/boring_to_beautiful/final/lib/src/features/artists/view/artist_bio.dart", "repo_id": "codelabs", "token_count": 242 }
14
// Copyright 2022 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:go_router/go_router.dart'; import '../../../shared/classes/classes.dart'; import '../../../shared/...
codelabs/boring_to_beautiful/final/lib/src/features/playlists/view/playlist_home_screen.dart/0
{ "file_path": "codelabs/boring_to_beautiful/final/lib/src/features/playlists/view/playlist_home_screen.dart", "repo_id": "codelabs", "token_count": 1033 }
15
// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_na...
codelabs/boring_to_beautiful/final/lib/src/shared/playback/bloc/playback_bloc.freezed.dart/0
{ "file_path": "codelabs/boring_to_beautiful/final/lib/src/shared/playback/bloc/playback_bloc.freezed.dart", "repo_id": "codelabs", "token_count": 14617 }
16
// Copyright 2022 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:go_router/go_router.dart'; import '../features/artists/artists.dart'; import '../features/home/hom...
codelabs/boring_to_beautiful/step_01/lib/src/shared/router.dart/0
{ "file_path": "codelabs/boring_to_beautiful/step_01/lib/src/shared/router.dart", "repo_id": "codelabs", "token_count": 1681 }
17
// Copyright 2022 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/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import '../playback/bloc/...
codelabs/boring_to_beautiful/step_01/lib/src/shared/views/play_pause_listener.dart/0
{ "file_path": "codelabs/boring_to_beautiful/step_01/lib/src/shared/views/play_pause_listener.dart", "repo_id": "codelabs", "token_count": 678 }
18
// // Generated file. Do not edit. // import FlutterMacOS import Foundation import desktop_window import dynamic_color import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { DesktopWindowPlugin.register(with: registry.registrar(forPlugin: "DesktopWindowPlugin")) DynamicColorP...
codelabs/boring_to_beautiful/step_01/macos/Flutter/GeneratedPluginRegistrant.swift/0
{ "file_path": "codelabs/boring_to_beautiful/step_01/macos/Flutter/GeneratedPluginRegistrant.swift", "repo_id": "codelabs", "token_count": 141 }
19
// // Generated file. Do not edit. // import FlutterMacOS import Foundation import desktop_window import dynamic_color import path_provider_foundation import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { DesktopWindowPlugin.register(with: registry.registrar(forPlugin: "Deskto...
codelabs/boring_to_beautiful/step_03/macos/Flutter/GeneratedPluginRegistrant.swift/0
{ "file_path": "codelabs/boring_to_beautiful/step_03/macos/Flutter/GeneratedPluginRegistrant.swift", "repo_id": "codelabs", "token_count": 173 }
20
import 'package:flame/collisions.dart'; import 'package:flame/components.dart'; import 'package:flame/effects.dart'; import 'package:flutter/material.dart'; import '../brick_breaker.dart'; import 'bat.dart'; import 'play_area.dart'; class Ball extends CircleComponent with CollisionCallbacks, HasGameReference<Bric...
codelabs/brick_breaker/step_07/lib/src/components/ball.dart/0
{ "file_path": "codelabs/brick_breaker/step_07/lib/src/components/ball.dart", "repo_id": "codelabs", "token_count": 670 }
21